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 2, 2024
1 parent 254df4e commit c3d5f0e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 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
47 changes: 45 additions & 2 deletions fido-test/fdo-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,54 @@ until [ "$(curl -X POST http://${FDO_RENDEZVOUS_ADDRESS}:8082/ping)" == "pong" ]
done;

greenprint "🔧 Check db tables"
sudo podman run exec \
sudo podman exec \
postgres \
psql \
--username="${POSTGRES_USERNAME}" \
-c "\dt"

rm -rf initdb
sudo podman run \
--rm \
--network edge \
--privileged \
localhost/clients \
fdo-manufacturing-client no-plain-di --insecure --manufacturing-server-url "http://${FDO_MANUFACTURING_ADDRESS}:8080"

sudo podman exec \
postgres \
psql \
--username="${POSTGRES_USERNAME}" \
-c "SELECT * FROM manufacturer_vouchers ;"

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/
EXPORTED_FILE=$(ls -1 export-ov)
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}"

sleep 10

sudo podman exec \
postgres \
psql \
--username="${POSTGRES_USERNAME}" \
-c "SELECT * FROM owner_vouchers ;"
sudo podman exec \
postgres \
psql \
--username="${POSTGRES_USERNAME}" \
-c "SELECT * FROM rendezvous_vouchers ;"

rm -rf initdb export-ov
exit 0

0 comments on commit c3d5f0e

Please sign in to comment.