Skip to content

Commit

Permalink
fix ci typo
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywang committed Jan 3, 2024
1 parent 254df4e commit 39a27fc
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/fdo-fb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Clone repository
uses: actions/checkout@v3

- name: Checkout db pr
- name: Checkout fdo postgres pr
uses: actions/checkout@v3
with:
repository: 7flying/fido-device-onboard-rs
Expand All @@ -24,6 +24,6 @@ jobs:
cp fido-test/fdo-postgres.sh fido-device-onboard-rs/test
cp fido-test/files/clients fido-device-onboard-rs/test/files
- name: Prepare greenboot
- name: Run fdo-postgres.sh
run: test/fdo-postgres.sh
working-directory: fido-device-onboard-rs
80 changes: 74 additions & 6 deletions fido-test/fdo-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ sudo buildah images
##########################################################
greenprint "πŸ”§ Generate FDO key and configuration files"
sudo mkdir aio
sudo podman run -v "$PWD"/aio/:/aio:z \
"localhost/aio:latest" \
aio --directory aio generate-configs-and-keys --contact-hostname "$FDO_MANUFACTURING_ADDRESS"
sudo podman run --rm \
-v "$PWD"/aio/:/aio:z \
"localhost/aio:latest" \
aio --directory aio generate-configs-and-keys --contact-hostname "$FDO_MANUFACTURING_ADDRESS"

# Prepare FDO config files
greenprint "πŸ”§ Prepare FDO key and configuration files for FDO containers"
Expand Down Expand Up @@ -117,12 +118,79 @@ until [ "$(curl -X POST http://${FDO_RENDEZVOUS_ADDRESS}:8082/ping)" == "pong" ]
sleep 1;
done;


greenprint "πŸ”§ Check container running status"
sudo podman ps -a

greenprint "πŸ”§ Collecting container logs"
sudo podman logs postgres manufacture-server owner-onboarding-server rendezvous-server

greenprint "πŸ”§ Check db tables"
sudo podman run exec \
sudo podman exec \
postgres \
psql \
--username="${POSTGRES_USERNAME}" \
-c "\dt" | grep "3 rows"

greenprint "πŸ”§ Generate OV"
sudo podman run \
--rm \
--network edge \
--privileged \
localhost/clients \
fdo-manufacturing-client no-plain-di --insecure --manufacturing-server-url "http://${FDO_MANUFACTURING_ADDRESS}:8080"

greenprint "πŸ”§ Check manufacturing server db for new OV"
sudo podman exec \
postgres \
psql \
--username="${POSTGRES_USERNAME}" \
-c "SELECT * FROM manufacturer_vouchers ;" | grep "1 row"

greenprint "πŸ”§ Check container running status"
sudo podman ps -a

greenprint "πŸ”§ Export OV"
mkdir export-ov
sudo podman run \
--rm \
--network edge \
--privileged \
-v "$PWD"/export-ov:/export-ov:z \
localhost/clients \
fdo-owner-tool export-manufacturer-vouchers postgres "postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_IP}/${POSTGRES_DB}" /export-ov/ | grep "exported"
EXPORTED_FILE=$(ls -1 export-ov)
greenprint "πŸ”§ Import OV into owner db"
sudo podman run \
--rm \
--network edge \
--privileged \
-v "$PWD"/export-ov:/export-ov:z \
localhost/clients \
fdo-owner-tool import-ownership-vouchers postgres "postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_IP}/${POSTGRES_DB}" "/export-ov/${EXPORTED_FILE}" | grep "OV import finished"

greenprint "πŸ”§ Check owner db for imported OV"
sudo podman exec \
postgres \
psql \
--username="${POSTGRES_USERNAME}" \
-c "SELECT * FROM owner_vouchers ;" | grep "1 row"

greenprint "πŸ”§ Sleep 60 seconds to sync with rendezvous db"
sleep 60

greenprint "πŸ”§ Check rendezvous db for synced OV"
sudo podman exec \
postgres \
psql \
--username="${POSTGRES_USERNAME}" \
-c "\dt"
-c "SELECT * FROM rendezvous_vouchers ;" | grep "1 row"

greenprint "πŸ”§ Check container running status"
sudo podman ps -a

greenprint "πŸ”§ Collecting container logs"
sudo podman logs rendezvous-server

rm -rf initdb
rm -rf initdb export-ov
exit 0

0 comments on commit 39a27fc

Please sign in to comment.