github.com/crowdsecurity/crowdsec@v1.6.1/test/bats-detect/gitea.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      load "${BATS_TEST_DIRNAME}/lib/setup_file_detect.sh"
     9  }
    10  
    11  teardown_file() {
    12      load "../lib/teardown_file.sh"
    13  }
    14  
    15  setup() {
    16      load "../lib/setup.sh"
    17      load "../lib/bats-file/load.bash"
    18      skip 'WIP'
    19      ./instance-data load
    20  }
    21  
    22  #----------
    23  
    24  @test "gitea: detect unit (fail)" {
    25      run -0 cscli setup detect
    26      run -0 jq -r '.setup | .[].detected_service' <(output)
    27      refute_line 'gitea-systemd'
    28  }
    29  
    30  @test "gitea: install" {
    31      # https://docs.gitea.io/en-us/install-from-binary/#download
    32      version=1.16.9
    33      # don't download twice
    34      run -0 wget -nc --directory-prefix "$CACHEDIR" "https://dl.gitea.io/gitea/${version}/gitea-${version}-linux-amd64"
    35  }
    36  
    37  @test "gitea: detect unit (succeed)" {
    38      run -0 cscli setup detect
    39      run -0 jq -r '.setup | .[].detected_service' <(output)
    40      assert_line 'gitea-systemd'
    41  }
    42  
    43  @test "gitea: install detected collection" {
    44      run -0 cscli setup detect
    45      run -0 cscli setup install-hub <(output)
    46  }