Skip to content

Commit

Permalink
chore: fix legacy daemon support in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierChanth committed Oct 2, 2023
1 parent 84eb917 commit 9c21e07
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
9 changes: 8 additions & 1 deletion .github/composite/setup_entrypoints/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ inputs:
devicename:
description: Unique sshnp devicename
required: true
legacy_daemon:
description: Legacy daemon
required: false

runs:
using: composite
Expand All @@ -37,7 +40,11 @@ runs:
entrypoint_filename="sshnp_entrypoint.sh"
;;
esac
echo "entrypoint_filename: $entrypoint_filename"
ARGS=""
if [ "${{ inputs.legacy_daemon }}" = "true" ]; then
ARGS="$ARGS --legacy-daemon"
fi
sed -i "s/ARGS=.*/ARGS=\"$ARGS\"/" "$entrypoint_filename"
./setup-sshnp-entrypoint.sh ${{ inputs.devicename }} ${{ inputs.sshnp_atsign }} ${{ inputs.sshnpd_atsign }} ${{ inputs.sshrvd_atsign }} "$entrypoint_filename"
- name: Setup NPD entrypoint
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/end2end_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ jobs:
# Don't run these against themselves, pointless to test
- np: local
npd: local

include:
- np: local
npd: installer
legacy_daemon: true
steps:
- name: Show Matrix Values
run: |
Expand Down Expand Up @@ -244,6 +249,7 @@ jobs:
sshnpd_atsign: ${{ env.SSHNPD_ATSIGN }}
sshrvd_atsign: ${{ env[env.PROD_RVD_ATSIGN] }}
devicename: ${{ env.DEVICENAME }}
legacy_daemon: ${{ matrix.legacy_daemon || false }}

- name: Ensure entrypoints exist
working-directory: tests/end2end_tests/contexts
Expand Down Expand Up @@ -368,12 +374,14 @@ jobs:
matrix:
include:
- np: local
npd: latest
- np: latest
npd: v3.4.2
legacy_daemon: true
- np: v3.4.2
npd: local

- np: local
npd: v3.3.0
legacy_daemon: true
- np: v3.3.0
npd: local

Expand Down Expand Up @@ -415,6 +423,7 @@ jobs:
sshnpd_atsign: ${{ env.SSHNPD_ATSIGN }}
sshrvd_atsign: ${{ env[env.PROD_RVD_ATSIGN] }}
devicename: ${{ env.DEVICENAME }}
legacy_daemon: ${{ matrix.legacy_daemon || false }}

- name: Ensure entrypoints exist
working-directory: tests/end2end_tests/contexts
Expand Down Expand Up @@ -610,4 +619,4 @@ jobs:
continue-on-error: true # failing this step does not fail the entire job
working-directory: tests/end2end_tests/tests
run: |
docker compose down
docker compose down
3 changes: 2 additions & 1 deletion tests/end2end_tests/entrypoints/sshnp_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
echo "SSHNP START ENTRY"
SSHNP_COMMAND="$HOME/.local/bin/sshnp -f @sshnpatsign -t @sshnpdatsign -d deviceName -h @sshrvdatsign -s id_ed25519.pub -v > sshnp.log"
ARGS=""
SSHNP_COMMAND="$HOME/.local/bin/sshnp -f @sshnpatsign -t @sshnpdatsign -d deviceName -h @sshrvdatsign -s id_ed25519.pub -v $ARGS > sshnp.log"

run_test()
{
Expand Down
5 changes: 2 additions & 3 deletions tests/end2end_tests/entrypoints/sshnp_installer_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
sleep WAITING_TIME # time for sshnpd to share device name

SSHNP_COMMAND="$HOME/.local/bin/sshnp -f @sshnpatsign -t @sshnpdatsign -d deviceName -h @sshrvdatsign -s id_ed25519.pub -v > sshnp.log"
ARGS=""
SSHNP_COMMAND="$HOME/.local/bin/sshnp -f @sshnpatsign -t @sshnpdatsign -d deviceName -h @sshrvdatsign -s id_ed25519.pub -v $ARGS > sshnp.log"
echo "Running: $SSHNP_COMMAND"
eval "$SSHNP_COMMAND"
cat sshnp.log
Expand Down

0 comments on commit 9c21e07

Please sign in to comment.