Skip to content

Commit

Permalink
add tests for clean upload
Browse files Browse the repository at this point in the history
  • Loading branch information
unglaublicherdude committed Jun 7, 2024
1 parent 9ed50fa commit 4b2ba8e
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,37 @@ jobs:
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
run: ./install.sh

- name: test admin Upload
- name: create testuser
run: |
docker exec --env OC_PASS=myfancysecurepassword234 --user www-data nextcloud-container php occ user:add testuser --password-from-env
- name: create testfiles
run: |
echo 'nothingwronghere' > /tmp/clear.txt
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > /tmp/eicar.com.txt
- name: admin eicar Upload
run: |
curl --silent -u admin:admin -T /tmp/eicar.com.txt http://127.0.0.1/remote.php/dav/files/admin/eicar.com.txt \
| grep -o "Virus EICAR-Test-File is detected in the file. Upload cannot be completed." \
|| exit 1
- name: test new user Upload
- name: admin clean Upload
run: |
STATUS_CODE=$(curl --silent -u admin:admin -T /tmp/clean.txt http://127.0.0.1/remote.php/dav/files/admin/clean.txt)
[[ $STATUS_CODE -ge 200 && $STATUS_CODE -lt 300 ]] || exit 1
- name: testuser eicar Upload
run: |
docker exec --env OC_PASS=myfancysecurepassword234 --user www-data nextcloud-container php occ user:add testuser --password-from-env
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > /tmp/eicar.com.txt
curl --silent -u testuser:myfancysecurepassword234 -T /tmp/eicar.com.txt http://127.0.0.1/remote.php/dav/files/testuser/eicar.com.txt \
| grep -o "Virus EICAR-Test-File is detected in the file. Upload cannot be completed." \
|| exit 1
- name: admin clean Upload
run: |
STATUS_CODE=$(curl --silent -u testuser:myfancysecurepassword234 -T /tmp/clean.txt http://127.0.0.1/remote.php/dav/files/testuser/clean.txt)
[[ $STATUS_CODE -ge 200 && $STATUS_CODE -lt 300 ]] || exit 1
- uses: actions/upload-artifact@master
with:
name: build-dir
Expand Down

0 comments on commit 4b2ba8e

Please sign in to comment.