github.com/crowdsecurity/crowdsec@v1.6.1/test/bats/12_notifications.bats (about)

     1  #!/usr/bin/env bats
     2  # vim: ft=bats:list:ts=8:sts=4:sw=4:et:ai:si:
     3  
     4  set -u
     5  
     6  setup_file() {
     7      load "../lib/setup_file.sh"
     8  }
     9  
    10  teardown_file() {
    11      load "../lib/teardown_file.sh"
    12  }
    13  
    14  setup() {
    15      load "../lib/setup.sh"
    16      load "../lib/bats-file/load.bash"
    17      ./instance-data load
    18      ./instance-crowdsec start
    19  }
    20  
    21  teardown() {
    22      cd "$TEST_DIR" || exit 1
    23      ./instance-crowdsec stop
    24  }
    25  
    26  #----------
    27  
    28  @test "cscli notifications list" {
    29      rune -0 cscli notifications list
    30      assert_output --partial "Name"
    31      assert_output --partial "Type"
    32      assert_output --partial "Profile name"
    33  }
    34  
    35  @test "cscli notifications must be run from lapi" {
    36      config_disable_lapi
    37      rune -1 cscli notifications list
    38      assert_stderr --partial "local API is disabled -- this command must be run on the local API machine"
    39  }