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 6b704e8
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 7 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
70 changes: 65 additions & 5 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,71 @@ 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"

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 ;"

greenprint "🔧 Check container running status"
sudo podman ps -a

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 ;"

greenprint "🔧 Check container running status"
sudo podman ps -a

greenprint "🔧 Collecting container logs"
sudo podman logs owner-onboarding-server rendezvous-server

rm -rf initdb export-ov
exit 0

0 comments on commit 6b704e8

Please sign in to comment.