Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Macedo <camila.macedo@foundries.io>
  • Loading branch information
Camila Macedo committed Nov 4, 2023
1 parent 35c11d5 commit dd5af89
Showing 1 changed file with 33 additions and 37 deletions.
70 changes: 33 additions & 37 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,42 @@ jobs:
openssl x509 -req -in ./data/certs/server.csr -CA ./data/certs/local-ca.pem -CAkey ./data/certs/local-ca.key -CAcreateserial -out ./data/certs/tls-crt -days 365 -sha256
ls -la ./data/certs
- name: Build Docker Compose
run: |
docker-compose build
- name: Run Docker Compose
run: |
docker-compose up --force-recreate -d
docker-compose up --build --force-recreate --wait-timeout 60
sleep 10
- name: Check Service Status
run: |
for i in {1..12}; do
status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null -X POST http://localhost:80/sign)
if [ "$status_code" -eq 400 ]; then
echo "Service is up and returned 400 Bad Request. Ready to proceed."
break
else
echo "Service responded with status code $status_code, waiting for 400. Attempt $i of 12."
sleep 10
fi
done
if [ "$status_code" -ne 400 ]; then
echo "Service did not respond with 400 Bad Request after 12 attempts. Exiting."
exit 1
fi
- name: Execute Script
run: |
python3 fake-lmp-device-register --registration-url "http://localhost:80/sign" --factory fake-test-sample
- name: Check relative /var/sota directory and pkey.pem file
run: |
if [[ -d "var/sota" && -f "var/sota/pkey.pem" ]]; then
echo "Relative /var/sota directory exists and pkey.pem is present"
else
echo "Relative /var/sota directory or pkey.pem is missing"
exit 1
fi
ls -la var/sota/
#
# - name: Check Service Status
# run: |
# for i in {1..12}; do
# status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null -X POST http://localhost:80/sign)
# if [ "$status_code" -eq 400 ]; then
# echo "Service is up and returned 400 Bad Request. Ready to proceed."
# break
# else
# echo "Service responded with status code $status_code, waiting for 400. Attempt $i of 12."
# sleep 10
# fi
# done
#
# if [ "$status_code" -ne 400 ]; then
# echo "Service did not respond with 400 Bad Request after 12 attempts. Exiting."
# exit 1
# fi
#
# - name: Execute Script
# run: |
# python3 fake-lmp-device-register --registration-url "http://localhost:80/sign" --factory fake-test-sample
#
# - name: Check relative /var/sota directory and pkey.pem file
# run: |
# if [[ -d "var/sota" && -f "var/sota/pkey.pem" ]]; then
# echo "Relative /var/sota directory exists and pkey.pem is present"
# else
# echo "Relative /var/sota directory or pkey.pem is missing"
# exit 1
# fi
# ls -la var/sota/

- name: Output Docker Compose Logs
if: always()
Expand Down

0 comments on commit dd5af89

Please sign in to comment.