Functional tests staticbuild (#767)

* try out func tests on uploaded tarball
* fix url of tarball
* fix tarball and uncompress

Co-authored-by: bui <thibault@crowdsec.net>
This commit is contained in:
registergoofy 2021-04-27 10:23:45 +02:00 committed by GitHub
parent 60740f6279
commit 9102d37f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,3 +44,59 @@ jobs:
args: crowdsec-release-static.tgz application/x-gzip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test_tarball:
strategy:
matrix:
tarball:
- name: crowdsec-release
- name: crowdsec-release-static
name: Download tarball and run functional tests
runs-on: ubuntu-20.04
steps:
- id: fetch_prerelease_version
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: crowdsecurity/crowdsec
excludes: draft
- name: download tarball
run: wget -qO - https://github.com/crowdsecurity/crowdsec/releases/download/${{ steps.fetch_prerelease_version.outputs.release }}/${{ matrix.tarball.name }}.tgz | tar xvzf -
- name: "Force machineid"
run: |
sudo chmod +w /etc/machine-id
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /etc/machine-id
- name: Install release
run: |
cd crowdsec-${{ steps.fetch_prerelease_version.outputs.release }}
sudo ./wizard.sh --unattended
- name: Check out code to get functional tests scripts
uses: actions/checkout@v2
- name: "Test post-install base"
run: |
cd scripts/func_tests/
./tests_post-install_0base.sh
- name: "Test post-install bouncer"
run: |
cd scripts/func_tests/
./tests_post-install_1bouncers.sh
- name: "Test post-install collections"
run: |
cd scripts/func_tests/
./tests_post-install_2collections.sh
- name: "Test post-install macines"
run: |
cd scripts/func_tests/
./tests_post-install_3machines.sh
- name: "Test post-install ip management"
run: |
cd scripts/func_tests/
./tests_post-install_99ip_mgmt.sh
- name: "Test cold logs"
run: |
cd scripts/func_tests/
./tests_post-install_4cold-logs.sh
- name: "Uninstall"
run: sudo ./wizard.sh --uninstall
- name: "Test post remove"
run: |
cd scripts/func_tests/
bash -x ./tests_post-remove_0base.sh