From 9c21e07d1df6b75a7e77d298c0ea97687adee4d0 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Mon, 2 Oct 2023 17:25:54 -0400 Subject: [PATCH] chore: fix legacy daemon support in e2e tests --- .github/composite/setup_entrypoints/action.yaml | 9 ++++++++- .github/workflows/end2end_tests.yaml | 15 ++++++++++++--- .../end2end_tests/entrypoints/sshnp_entrypoint.sh | 3 ++- .../entrypoints/sshnp_installer_entrypoint.sh | 5 ++--- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/composite/setup_entrypoints/action.yaml b/.github/composite/setup_entrypoints/action.yaml index 994874ab4..43d162d09 100644 --- a/.github/composite/setup_entrypoints/action.yaml +++ b/.github/composite/setup_entrypoints/action.yaml @@ -21,6 +21,9 @@ inputs: devicename: description: Unique sshnp devicename required: true + legacy_daemon: + description: Legacy daemon + required: false runs: using: composite @@ -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 diff --git a/.github/workflows/end2end_tests.yaml b/.github/workflows/end2end_tests.yaml index aa7b4afd0..a45882a81 100644 --- a/.github/workflows/end2end_tests.yaml +++ b/.github/workflows/end2end_tests.yaml @@ -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: | @@ -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 @@ -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 @@ -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 @@ -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 \ No newline at end of file + docker compose down diff --git a/tests/end2end_tests/entrypoints/sshnp_entrypoint.sh b/tests/end2end_tests/entrypoints/sshnp_entrypoint.sh index ad3bdbb9c..c49902105 100644 --- a/tests/end2end_tests/entrypoints/sshnp_entrypoint.sh +++ b/tests/end2end_tests/entrypoints/sshnp_entrypoint.sh @@ -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() { diff --git a/tests/end2end_tests/entrypoints/sshnp_installer_entrypoint.sh b/tests/end2end_tests/entrypoints/sshnp_installer_entrypoint.sh index 97ea189b8..55b3ab918 100644 --- a/tests/end2end_tests/entrypoints/sshnp_installer_entrypoint.sh +++ b/tests/end2end_tests/entrypoints/sshnp_installer_entrypoint.sh @@ -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