From 74d0e860e62fd270a1c0d7dbd3749bd5feab769d Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 11:41:45 +0000 Subject: [PATCH 01/13] enable only additional discoverytest --- .github/workflows/integration.yaml | 214 --------- .github/workflows/testing.yml | 685 +++++++++++++++-------------- 2 files changed, 364 insertions(+), 535 deletions(-) delete mode 100644 .github/workflows/integration.yaml diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml deleted file mode 100644 index 0caa26fe5..000000000 --- a/.github/workflows/integration.yaml +++ /dev/null @@ -1,214 +0,0 @@ -name: UDMI Integration Suite - -on: - push: - tags: - - '**' - branches: - - '**' - workflow_dispatch: - -jobs: - images: - name: Build Docker Images - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - timeout-minutes: 5 - strategy: - fail-fast: false - matrix: - container: [ "udmis", "validator", "pubber", "misc" ] - env: - PUSH_REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - CONTAINER: ${{ matrix.container }} - REF_NAME: ${{ github.ref_name }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - name: Log in to the github registry - uses: docker/login-action@v3 - with: - registry: ${{ env.PUSH_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Container build and push - run: | - revhash=$(git log -n 1 --pretty=format:"%h") - IMAGE_HASH=g${revhash:0:8} - PUSH_REPO=$PUSH_REGISTRY/${IMAGE_NAME,,} - - TAG_BASE=$PUSH_REPO:$CONTAINER - PUSH_TAG=${TAG_BASE}-$IMAGE_HASH - echo PUSH_TAG=$PUSH_TAG >> $GITHUB_ENV - - bin/clone_model - $CONTAINER/bin/build check - bin/container $CONTAINER push --no-check $PUSH_TAG - - docker tag $CONTAINER:latest $TAG_BASE-latest - docker push $TAG_BASE-latest - docker tag $CONTAINER:latest $TAG_BASE-$REF_NAME - docker push $TAG_BASE-$REF_NAME - - echo Pushed built $CONTAINER container as $PUSH_TAG | tee -a $GITHUB_STEP_SUMMARY - - name: Docker images summary - run: | - docker images - echo - docker history $PUSH_TAG - - simple: - name: Simple sequence test - runs-on: ubuntu-latest - timeout-minutes: 5 - needs: images - strategy: - fail-fast: false - matrix: - device_id: [ "AHU-1", "AHU-22", "GAT-123" ] - env: - IMAGE_NAME: ${{ github.repository }} - REF_NAME: ${{ github.ref_name }} - DEVICE_ID: ${{ matrix.device_id }} - steps: - - name: Setup Environment - run: | - sudo apt-get install moreutils - git clone https://github.com/faucetsdn/udmi_site_model.git - ln -s udmi_site_model/ site_model - (cd site_model; git log -n 1) - jq ".device_id = \"$DEVICE_ID\"" site_model/cloud_iot_config.json | sponge site_model/cloud_iot_config.json - jq . site_model/cloud_iot_config.json - docker network create udminet --subnet 192.168.99.0/24 - - name: Start UDMIS container - run: | - export IMAGE_TAG=ghcr.io/$IMAGE_NAME:udmis-$REF_NAME - docker run $IMAGE_TAG cat bin/actualize > /tmp/actualize.sh - cat /tmp/actualize.sh && bash /tmp/actualize.sh - - name: Registrar run - run: | - docker run --net udminet --name registrar -v $(realpath site_model):/root/site_model \ - ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/registrar site_model/cloud_iot_config.json - - name: Pubber background run - run: | - echo docker run -d --net udminet --name pubber -v $(realpath site_model):/root/site_model \ - ghcr.io/$IMAGE_NAME:pubber-$REF_NAME bin/pubber site_model/cloud_iot_config.json - docker run -d --net udminet --name pubber -v $(realpath site_model):/root/site_model \ - ghcr.io/$IMAGE_NAME:pubber-$REF_NAME bin/pubber site_model/cloud_iot_config.json - for count in `seq 0 30`; do - (docker ps | fgrep -q pubber) || break - (docker logs pubber 2>&1 | fgrep -q -v "Connection complete") || break - echo Waiting for pubber startup $((30 - count))... - sleep 1 - done - docker logs pubber 2>&1 | fgrep "Connection complete" - - name: Sequencer run - run: | - SEQUENCER_TESTS="broken_config extra_config device_config_acked" - [[ $REF_NAME =~ test- ]] && SEQUENCER_TESTS=${REF_NAME#test-} - docker run --net udminet --name sequencer -v $(realpath site_model):/root/site_model \ - ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/sequencer site_model/cloud_iot_config.json \ - $SEQUENCER_TESTS - - name: Sequencer results - run: | - cat site_model/out/devices/$DEVICE_ID/results.md - if [[ $REF_NAME =~ test- ]]; then - SPECIFIC_TEST=${REF_NAME#test-} - more site_model/out/devices/$DEVICE_ID/tests/$SPECIFIC_TEST/* - else - [[ $(cat site_model/out/devices/$DEVICE_ID/results.md | egrep 'stable \| [0-9]+ \| (pass|skip)' | wc -l) == 3 ]] - fi - - name: UDMIS logs - if: ${{ !cancelled() }} - run: | - docker logs udmis - more var/tmp/udmis.log - - name: Registrar logs - if: ${{ !cancelled() }} - run: docker logs registrar - - name: Pubber logs - if: ${{ !cancelled() }} - run: docker logs pubber - - name: Sequencer logs - if: ${{ !cancelled() }} - run: docker logs sequencer - - discovery: - name: Simple discovery sequencer test - runs-on: ubuntu-latest - timeout-minutes: 5 - needs: images - env: - IMAGE_NAME: ${{ github.repository }} - REF_NAME: ${{ github.ref_name }} - DEVICE_ID: ${{'AHU-1'}} - steps: - - name: Setup Environment - run: | - sudo apt-get install moreutils - git clone https://github.com/faucetsdn/udmi_site_model.git - ln -s udmi_site_model/ site_model - (cd site_model; git log -n 1) - jq ".device_id = \"$DEVICE_ID\"" site_model/cloud_iot_config.json | sponge site_model/cloud_iot_config.json - jq . site_model/cloud_iot_config.json - docker network create udminet --subnet 192.168.99.0/24 - - name: Start UDMIS container - run: | - export IMAGE_TAG=ghcr.io/$IMAGE_NAME:udmis-$REF_NAME - docker run $IMAGE_TAG cat bin/actualize > /tmp/actualize.sh - cat /tmp/actualize.sh && bash /tmp/actualize.sh - - name: Generate keys - run: | - docker run --net udminet --name keygen -v $(realpath site_model):/root/site_model \ - ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/keygen CERT site_model/devices/$DEVICE_ID - - name: Registrar run - run: | - docker run --net udminet --name registrar -v $(realpath site_model):/root/site_model \ - ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/registrar site_model/cloud_iot_config.json - - name: Start discoverynode - run: | - export IMAGE_TAG=ghcr.io/$IMAGE_NAME:misc-$REF_NAME - # This currently fails (no config), but just check that it actually runs. - docker run -d \ - --net udminet \ - -v $(realpath site_model):/var/site_model \ - --name discoverynode \ - $IMAGE_TAG \ - bin/run /var/site_model //mqtt/udmis AHU-1 vendor.range=0x65,28179023,20231,,,,,,,,,,,,,,,, - - name: Sequencer run - run: | - docker run --net udminet --name sequencer -v $(realpath site_model):/root/site_model \ - ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/sequencer site_model/cloud_iot_config.json \ - scan_single_future - - name: Sequencer results - run: | - cat site_model/out/devices/$DEVICE_ID/results.md - [[ $(cat site_model/out/devices/$DEVICE_ID/results.md | grep -Ec ".*discovery.* pass") == 1 ]] - - name: Discoverynode logs - if: ${{ !cancelled() }} - run: docker logs discoverynode - - udmif: - name: UDMIF unit tests - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20.9.0 - - name: Install Angular CLI - run: npm install -g @angular/cli - - name: web tests - run: echo Disabled udmif/web/runTests due to dependency integration problems - - name: api tests - run: echo Disabled udmif/api/runTests due to dependency integration problems diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0dbb63d02..6671a7ef9 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,341 +14,384 @@ concurrency: cancel-in-progress: true jobs: - unit: - name: Unit Tests - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Checkout source - uses: actions/checkout@v4 - - name: start and test local servers - run: | - bin/setup_base - bin/clone_model - bin/start_pubsub - - name: bin/run_tests all_tests - run: bin/run_tests all_tests - - name: all test output - if: ${{ !cancelled() }} - run: more out/test_* - - name: gencode test output - if: ${{ !cancelled() }} - run: more out/test_bin+gencode+check - - name: validator test output - if: ${{ !cancelled() }} - run: more out/test_validator+bin+build+check - - name: pubber test output - if: ${{ !cancelled() }} - run: more out/test_pubber+bin+build+check - - name: udmis test output - if: ${{ !cancelled() }} - run: more out/test_udmis+bin+build+check - - name: site test output - if: ${{ !cancelled() }} - run: more out/test_bin+test_sites + # unit: + # name: Unit Tests + # runs-on: ubuntu-24.04 + # timeout-minutes: 10 + # steps: + # - uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: '17' + # - uses: actions/setup-python@v5 + # with: + # python-version: '3.10' + # - name: Checkout source + # uses: actions/checkout@v4 + # - name: start and test local servers + # run: | + # bin/setup_base + # bin/clone_model + # bin/start_pubsub + # - name: bin/run_tests all_tests + # run: bin/run_tests all_tests + # - name: all test output + # if: ${{ !cancelled() }} + # run: more out/test_* + # - name: gencode test output + # if: ${{ !cancelled() }} + # run: more out/test_bin+gencode+check + # - name: validator test output + # if: ${{ !cancelled() }} + # run: more out/test_validator+bin+build+check + # - name: pubber test output + # if: ${{ !cancelled() }} + # run: more out/test_pubber+bin+build+check + # - name: udmis test output + # if: ${{ !cancelled() }} + # run: more out/test_udmis+bin+build+check + # - name: site test output + # if: ${{ !cancelled() }} + # run: more out/test_bin+test_sites - spelling: - name: Docs Spelling Checks - runs-on: ubuntu-24.04 - timeout-minutes: 2 - steps: - - uses: actions/checkout@v4 - - name: Check Spelling - uses: rojopolis/spellcheck-github-actions@0.35.0 - with: - config_path: .spellcheck.yml - task_name: Markdown + # spelling: + # name: Docs Spelling Checks + # runs-on: ubuntu-24.04 + # timeout-minutes: 2 + # steps: + # - uses: actions/checkout@v4 + # - name: Check Spelling + # uses: rojopolis/spellcheck-github-actions@0.35.0 + # with: + # config_path: .spellcheck.yml + # task_name: Markdown - automapping: - name: Automapping capability - runs-on: ubuntu-24.04 - timeout-minutes: 10 - if: ${{ vars.TARGET_PROJECT != '' && !cancelled() }} - env: - TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - name: base setup - run: | - bin/setup_base - bin/clone_model - - name: local setup - run: | - bin/start_local sites/udmi_site_model $TARGET_PROJECT - bin/pull_messages ${TARGET_PROJECT}%ZZ-TRI-FECTA > /tmp/message_capture.log 2>&1 & - - name: bin/test_automapper - run: bin/test_automapper $TARGET_PROJECT - - name: extra devices - run: | - find sites/udmi_site_model/extras/ -type f | xargs sed -i '$a\' - find sites/udmi_site_model/extras/ -type f | xargs more - - name: udmis log - if: ${{ !cancelled() }} - run: cat /tmp/udmis.log - - name: pubber log - if: ${{ !cancelled() }} - run: cat out/pubber.log.GAT-123 - - name: captured messages - if: ${{ !cancelled() }} - run: | - cat /tmp/message_capture.log - mkdir -p out/registries && cd out/registries/ - find . -type f | sort | xargs more - - name: support bundle - if: ${{ !cancelled() }} - run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - if-no-files-found: error - name: udmi-support_${{ github.run_id }}-m - path: '*_udmi-support_*.tgz' + # automapping: + # name: Automapping capability + # runs-on: ubuntu-24.04 + # timeout-minutes: 10 + # if: ${{ vars.TARGET_PROJECT != '' && !cancelled() }} + # env: + # TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: '17' + # - name: base setup + # run: | + # bin/setup_base + # bin/clone_model + # - name: local setup + # run: | + # bin/start_local sites/udmi_site_model $TARGET_PROJECT + # bin/pull_messages ${TARGET_PROJECT}%ZZ-TRI-FECTA > /tmp/message_capture.log 2>&1 & + # - name: bin/test_automapper + # run: bin/test_automapper $TARGET_PROJECT + # - name: extra devices + # run: | + # find sites/udmi_site_model/extras/ -type f | xargs sed -i '$a\' + # find sites/udmi_site_model/extras/ -type f | xargs more + # - name: udmis log + # if: ${{ !cancelled() }} + # run: cat /tmp/udmis.log + # - name: pubber log + # if: ${{ !cancelled() }} + # run: cat out/pubber.log.GAT-123 + # - name: captured messages + # if: ${{ !cancelled() }} + # run: | + # cat /tmp/message_capture.log + # mkdir -p out/registries && cd out/registries/ + # find . -type f | sort | xargs more + # - name: support bundle + # if: ${{ !cancelled() }} + # run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ + # - uses: actions/upload-artifact@v4 + # if: ${{ !cancelled() }} + # with: + # if-no-files-found: error + # name: udmi-support_${{ github.run_id }}-m + # path: '*_udmi-support_*.tgz' - baseline: - name: Baseline Tests - runs-on: ubuntu-24.04 - timeout-minutes: 15 - needs: automapping - if: vars.TARGET_PROJECT != '' - env: - TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} - UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - name: base setup - run: bin/run_tests install_dependencies - - name: local setup - run: bin/start_local sites/udmi_site_model $TARGET_PROJECT - - name: registrar clean - run: bin/test_regclean solo $TARGET_PROJECT - - name: special sequences - if: ${{ !cancelled() }} - run: bin/test_special $TARGET_PROJECT - - name: telemetry validator - if: ${{ !cancelled() }} - run: bin/test_validator $TARGET_PROJECT - - name: validator result - if: ${{ !cancelled() }} - run: more out/validator.out || true - - name: message captures - if: ${{ !cancelled() }} - run: | - cd sites/udmi_site_model/out - find . -type f | sort | xargs ls -l - find . -type f | sort | xargs more | cat - - name: nostate sequences - if: ${{ !cancelled() }} - run: bin/test_sequencer nostate full $TARGET_PROJECT - - name: support bundle - if: ${{ !cancelled() }} - run: UDMI_REGISTRY_SUFFIX=_b bin/support ${{ github.repository_owner }}_${{ github.job }}_ - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - if-no-files-found: error - name: udmi-support_${{ github.run_id }}-b - path: '*_udmi-support_*.tgz' + # baseline: + # name: Baseline Tests + # runs-on: ubuntu-24.04 + # timeout-minutes: 15 + # needs: automapping + # if: vars.TARGET_PROJECT != '' + # env: + # TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} + # UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: '17' + # - name: base setup + # run: bin/run_tests install_dependencies + # - name: local setup + # run: bin/start_local sites/udmi_site_model $TARGET_PROJECT + # - name: registrar clean + # run: bin/test_regclean solo $TARGET_PROJECT + # - name: special sequences + # if: ${{ !cancelled() }} + # run: bin/test_special $TARGET_PROJECT + # - name: telemetry validator + # if: ${{ !cancelled() }} + # run: bin/test_validator $TARGET_PROJECT + # - name: validator result + # if: ${{ !cancelled() }} + # run: more out/validator.out || true + # - name: message captures + # if: ${{ !cancelled() }} + # run: | + # cd sites/udmi_site_model/out + # find . -type f | sort | xargs ls -l + # find . -type f | sort | xargs more | cat + # - name: nostate sequences + # if: ${{ !cancelled() }} + # run: bin/test_sequencer nostate full $TARGET_PROJECT + # - name: support bundle + # if: ${{ !cancelled() }} + # run: UDMI_REGISTRY_SUFFIX=_b bin/support ${{ github.repository_owner }}_${{ github.job }}_ + # - uses: actions/upload-artifact@v4 + # if: ${{ !cancelled() }} + # with: + # if-no-files-found: error + # name: udmi-support_${{ github.run_id }}-b + # path: '*_udmi-support_*.tgz' - sequencer: - name: Sequencer Tests - runs-on: ubuntu-24.04 - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - if: vars.TARGET_PROJECT != '' - env: - TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} - UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA - UDMI_REGISTRY_SUFFIX: _${{ matrix.shard }} - MATRIX_SHARD_COUNT: 10 - MATRIX_SHARD_INDEX: ${{ matrix.shard }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - name: base setup - run: bin/run_tests install_dependencies - - name: local setup - run: bin/start_local sites/udmi_site_model $TARGET_PROJECT - - name: registrar clean - run: bin/test_regclean $TARGET_PROJECT - - name: sequence tests clean - if: ${{ !cancelled() }} - run: bin/test_sequencer clean nocheck $TARGET_PROJECT - - name: sequence tests alpha - if: ${{ !cancelled() }} - run: bin/test_sequencer alpha nocheck $TARGET_PROJECT - - name: sequence test post-process - if: ${{ !cancelled() }} - run: egrep ' test .* after .*s ' out/sequencer.log | tee out/timing_sequencer.out - - name: itemized sequencer tests - if: ${{ !cancelled() }} - run: bin/test_itemized $TARGET_PROJECT - - name: output files - if: ${{ !cancelled() }} - run: more out/*.out* | cat - - name: pubber logs - if: ${{ !cancelled() }} - run: more out/pubber.log* pubber/out/*.json | cat - - name: udmis log - if: ${{ !cancelled() }} - run: cat /tmp/udmis.log - - name: itemized test post-process - if: ${{ !cancelled() }} - run: egrep ' test .* after .*s ' out/sequencer.log-* | tee out/timing_itemized.out - - name: support bundle - if: ${{ !cancelled() }} - run: | - bin/support ${{ github.repository_owner }}_${{ github.job }}_ - tar -tzvf *udmi-support*.tgz - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - if-no-files-found: error - name: udmi-support_${{ github.run_id }}-${{ matrix.shard }} - path: '*_udmi-support_*.tgz' + # sequencer: + # name: Sequencer Tests + # runs-on: ubuntu-24.04 + # timeout-minutes: 20 + # strategy: + # fail-fast: false + # matrix: + # shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + # if: vars.TARGET_PROJECT != '' + # env: + # TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} + # UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA + # UDMI_REGISTRY_SUFFIX: _${{ matrix.shard }} + # MATRIX_SHARD_COUNT: 10 + # MATRIX_SHARD_INDEX: ${{ matrix.shard }} + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: '17' + # - name: base setup + # run: bin/run_tests install_dependencies + # - name: local setup + # run: bin/start_local sites/udmi_site_model $TARGET_PROJECT + # - name: registrar clean + # run: bin/test_regclean $TARGET_PROJECT + # - name: sequence tests clean + # if: ${{ !cancelled() }} + # run: bin/test_sequencer clean nocheck $TARGET_PROJECT + # - name: sequence tests alpha + # if: ${{ !cancelled() }} + # run: bin/test_sequencer alpha nocheck $TARGET_PROJECT + # - name: sequence test post-process + # if: ${{ !cancelled() }} + # run: egrep ' test .* after .*s ' out/sequencer.log | tee out/timing_sequencer.out + # - name: itemized sequencer tests + # if: ${{ !cancelled() }} + # run: bin/test_itemized $TARGET_PROJECT + # - name: output files + # if: ${{ !cancelled() }} + # run: more out/*.out* | cat + # - name: pubber logs + # if: ${{ !cancelled() }} + # run: more out/pubber.log* pubber/out/*.json | cat + # - name: udmis log + # if: ${{ !cancelled() }} + # run: cat /tmp/udmis.log + # - name: itemized test post-process + # if: ${{ !cancelled() }} + # run: egrep ' test .* after .*s ' out/sequencer.log-* | tee out/timing_itemized.out + # - name: support bundle + # if: ${{ !cancelled() }} + # run: | + # bin/support ${{ github.repository_owner }}_${{ github.job }}_ + # tar -tzvf *udmi-support*.tgz + # - uses: actions/upload-artifact@v4 + # if: ${{ !cancelled() }} + # with: + # if-no-files-found: error + # name: udmi-support_${{ github.run_id }}-${{ matrix.shard }} + # path: '*_udmi-support_*.tgz' + + # runlocal: + # name: UDMIS Local Setup + # runs-on: ubuntu-24.04 + # timeout-minutes: 20 + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: '17' + # - name: base setup + # run: | + # bin/setup_base + # bin/clone_model + # bin/registrar sites/udmi_site_model + # - name: local setup + # run: bin/start_local sites/udmi_site_model //mqtt/localhost + # - name: bin/test_etcd + # run: bin/test_etcd + # - name: bin/test_mosquitto + # run: bin/test_mosquitto + # - name: bin/test_regclean + # run: bin/test_regclean //mqtt/localhost + # - name: bin/test_sequencer + # run: bin/test_sequencer local full //mqtt/localhost $(< etc/local_tests.txt) + # - name: bin/test_udmis + # run: bin/test_udmis + # - name: mosquitto debug + # if: ${{ !cancelled() }} + # run: | + # mosquitto -h || true + # sudo more /etc/mosquitto/* /etc/mosquitto/conf.d/* || true + # - name: udmis log + # if: ${{ !cancelled() }} + # run: cat /tmp/udmis.log + # - name: mosquitto logs + # if: ${{ !cancelled() }} + # run: cat /var/log/mosquitto/mosquitto.log || true + # - name: support bundle + # if: ${{ !cancelled() }} + # run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ + # - uses: actions/upload-artifact@v4 + # if: ${{ !cancelled() }} + # with: + # if-no-files-found: error + # name: udmi-support_${{ github.run_id }}-l + # path: '*_udmi-support_*.tgz' + + # endpoint: + # name: Endpoint Redirection + # runs-on: ubuntu-24.04 + # timeout-minutes: 15 + # env: + # UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA + # TARGET_PROJECT: //mqtt/localhost + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: '17' + # - name: base setup + # run: bin/run_tests install_dependencies + # - name: local setup + # run: bin/start_local sites/udmi_site_model $TARGET_PROJECT + # - name: regclean + # run: bin/test_regclean $TARGET_PROJECT + # - name: bin/test_proxy + # if: ${{ env.MQTT_PROXY_HOST != '' }} + # run: bin/test_proxy $TARGET_PROJECT $MQTT_PROXY_HOST + # - name: bin/test_redirect + # run: bin/test_redirect $TARGET_PROJECT + # - name: pubber.log + # if: ${{ !cancelled() }} + # run: more out/pubber.log* | cat + # - name: support bundle + # if: ${{ !cancelled() }} + # run: UDMI_REGISTRY_SUFFIX=_r bin/support ${{ github.repository_owner }}_${{ github.job }}_ + # - uses: actions/upload-artifact@v4 + # if: ${{ !cancelled() }} + # with: + # if-no-files-found: error + # name: udmi-support_${{ github.run_id }}-r + # path: '*_udmi-support_*.tgz' - runlocal: - name: UDMIS Local Setup + # posttest: + # name: Post-test Summarization + # runs-on: ubuntu-24.04 + # timeout-minutes: 5 + # needs: [ baseline, sequencer, endpoint, runlocal ] + # if: ${{ !cancelled() && vars.TARGET_PROJECT != '' }} + # env: + # TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} + # UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: '3.10' + # - name: Base setup + # run: bin/setup_base + # - name: Download all sharded support packages + # uses: actions/download-artifact@v4 + # with: + # path: udmi-support_${{ github.run_id }} + # pattern: udmi-support_${{ github.run_id }}-* + # merge-multiple: true + # - name: Upload merged support package + # uses: actions/upload-artifact@v4 + # with: + # if-no-files-found: error + # name: udmi-support_${{ github.run_id }} + # path: 'udmi-support_${{ github.run_id }}/*_udmi-support_*.tgz' + # - name: Processing support package + # run: bin/support_process udmi-support_* + # - name: Test run index + # run: | + # ls -d sites/udmi_site_model*/out*/devices/AHU-1/tests/* + # find out* -name 'schema*.out*' -size +0 | xargs more | cat + # - name: Sequencer validation + # if: ${{ !cancelled() }} + # run: bin/test_sequcheck + # - name: Itemized validation + # if: ${{ !cancelled() }} + # run: bin/test_itemcheck + + discovery: + name: Discovery Tests runs-on: ubuntu-24.04 - timeout-minutes: 20 + timeout-minutes: 15 steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' - - name: base setup + - name: Setup prerequisites run: | bin/setup_base bin/clone_model - bin/registrar sites/udmi_site_model - - name: local setup - run: bin/start_local sites/udmi_site_model //mqtt/localhost - - name: bin/test_etcd - run: bin/test_etcd - - name: bin/test_mosquitto - run: bin/test_mosquitto - - name: bin/test_regclean - run: bin/test_regclean //mqtt/localhost - - name: bin/test_sequencer - run: bin/test_sequencer local full //mqtt/localhost $(< etc/local_tests.txt) - - name: bin/test_udmis - run: bin/test_udmis - - name: mosquitto debug - if: ${{ !cancelled() }} + ln -s sites/udmi_site_model/ site_model + (cd site_model; git log -n 1) + docker network create udminet --subnet 192.168.99.0/24 + - name: Build UDMIS run: | - mosquitto -h || true - sudo more /etc/mosquitto/* /etc/mosquitto/conf.d/* || true - - name: udmis log - if: ${{ !cancelled() }} - run: cat /tmp/udmis.log - - name: mosquitto logs - if: ${{ !cancelled() }} - run: cat /var/log/mosquitto/mosquitto.log || true - - name: support bundle - if: ${{ !cancelled() }} - run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - if-no-files-found: error - name: udmi-support_${{ github.run_id }}-l - path: '*_udmi-support_*.tgz' - - endpoint: - name: Endpoint Redirection - runs-on: ubuntu-24.04 - timeout-minutes: 15 - env: - UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA - TARGET_PROJECT: //mqtt/localhost - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - name: base setup - run: bin/run_tests install_dependencies - - name: local setup - run: bin/start_local sites/udmi_site_model $TARGET_PROJECT - - name: regclean - run: bin/test_regclean $TARGET_PROJECT - - name: bin/test_proxy - if: ${{ env.MQTT_PROXY_HOST != '' }} - run: bin/test_proxy $TARGET_PROJECT $MQTT_PROXY_HOST - - name: bin/test_redirect - run: bin/test_redirect $TARGET_PROJECT - - name: pubber.log - if: ${{ !cancelled() }} - run: more out/pubber.log* | cat - - name: support bundle - if: ${{ !cancelled() }} - run: UDMI_REGISTRY_SUFFIX=_r bin/support ${{ github.repository_owner }}_${{ github.job }}_ - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - if-no-files-found: error - name: udmi-support_${{ github.run_id }}-r - path: '*_udmi-support_*.tgz' - - posttest: - name: Post-test Summarization - runs-on: ubuntu-24.04 - timeout-minutes: 5 - needs: [ baseline, sequencer, endpoint, runlocal ] - if: ${{ !cancelled() && vars.TARGET_PROJECT != '' }} - env: - TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} - UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Base setup - run: bin/setup_base - - name: Download all sharded support packages - uses: actions/download-artifact@v4 - with: - path: udmi-support_${{ github.run_id }} - pattern: udmi-support_${{ github.run_id }}-* - merge-multiple: true - - name: Upload merged support package - uses: actions/upload-artifact@v4 - with: - if-no-files-found: error - name: udmi-support_${{ github.run_id }} - path: 'udmi-support_${{ github.run_id }}/*_udmi-support_*.tgz' - - name: Processing support package - run: bin/support_process udmi-support_* - - name: Test run index + udmis/bin/build check + bin/container udmis build --no-check latest + echo Built local UDMIS + - name: Start UDMIS container run: | - ls -d sites/udmi_site_model*/out*/devices/AHU-1/tests/* - find out* -name 'schema*.out*' -size +0 | xargs more | cat - - name: Sequencer validation - if: ${{ !cancelled() }} - run: bin/test_sequcheck - - name: Itemized validation - if: ${{ !cancelled() }} - run: bin/test_itemcheck + docker run -d --net udminet --name udmis -p 8883:8883 \ + -v $PWD/site_model:/root/site_model \ + -v $PWD/var/tmp:/tmp \ + -v $PWD/var/etcd:/root/udmi/var/etcd \ + -v $PWD/var/mosquitto:/etc/mosquitto \ + udmis udmi/bin/start_local block site_model/cloud_iot_config.json + for count in `seq 0 30`; do + echo Waiting for UDMIS startup $((30 - count)) + [[ ! -f var/tmp/pod_ready.txt ]] || break + (docker ps | fgrep -q udmis) || break + sleep 1 + done + ls -l var/tmp/pod_ready.txt 2>&1 + - name: Run Tests + run: misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file From 8b95db6956fad5df73aadc8ec2a20a1620ea043a Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 11:52:45 +0000 Subject: [PATCH 02/13] add permissions debug --- .github/workflows/testing.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 6671a7ef9..89858cda6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -373,7 +373,7 @@ jobs: ln -s sites/udmi_site_model/ site_model (cd site_model; git log -n 1) docker network create udminet --subnet 192.168.99.0/24 - - name: Build UDMIS + - name: Build UDMIS container run: | udmis/bin/build check bin/container udmis build --no-check latest @@ -393,5 +393,7 @@ jobs: sleep 1 done ls -l var/tmp/pod_ready.txt 2>&1 - - name: Run Tests - run: misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file + - name: debug + run: ls -l site_model/reflector + # - name: Run Tests + # run: misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file From 55dc80427145d92a134b486b7b8ba655255ae34f Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 11:54:20 +0000 Subject: [PATCH 03/13] show file permissions for site model dir too --- .github/workflows/testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 89858cda6..744cc1a6f 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -394,6 +394,8 @@ jobs: done ls -l var/tmp/pod_ready.txt 2>&1 - name: debug - run: ls -l site_model/reflector + run: | + ls -l site_model + ls -l site_model/reflector # - name: Run Tests # run: misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file From 87cd72a5a0f8a230ef002379844e1f5bd97414ee Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 12:17:23 +0000 Subject: [PATCH 04/13] set reflector directory 644 not just rsa_private files --- bin/setup_ca | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/setup_ca b/bin/setup_ca index b9dd17794..c1dbbdc35 100755 --- a/bin/setup_ca +++ b/bin/setup_ca @@ -20,5 +20,5 @@ echo Importing server certs from $site_model... sudo cp $site_model/reflector/ca.* $CERT_DIR/ sudo cp $site_model/reflector/rsa_private.* $CERT_DIR/ sudo chgrp -R mosquitto $CERT_DIR -sudo chmod 0644 $CERT_DIR/rsa_private.* +sudo chmod -R 0644 $CERT_DIR ls -l $CERT_DIR From 41f5a778223da7c3e00227f2a795b7bbfdbee215 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 12:18:36 +0000 Subject: [PATCH 05/13] renable tests --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 744cc1a6f..882dc6ba0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -397,5 +397,5 @@ jobs: run: | ls -l site_model ls -l site_model/reflector - # - name: Run Tests - # run: misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file + - name: Run Tests + run: misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file From 85d564ca99b64d2a198ded33faea6c74b6110208 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 12:36:35 +0000 Subject: [PATCH 06/13] change permissions --- .github/workflows/testing.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 882dc6ba0..0e145969c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -395,7 +395,13 @@ jobs: ls -l var/tmp/pod_ready.txt 2>&1 - name: debug run: | + ls -l sites/udmi_site_model ls -l site_model ls -l site_model/reflector + whoami + chmod -R 755 site_model + ls -l site_model + ls -l sites/udmi_site_model + ls -l site_model/reflector - name: Run Tests run: misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file From 58f2c3e8cc3d6f39c557ff11e1861881d9cc2008 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 12:43:31 +0000 Subject: [PATCH 07/13] use sudo --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0e145969c..1bef1b489 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -399,7 +399,7 @@ jobs: ls -l site_model ls -l site_model/reflector whoami - chmod -R 755 site_model + sudo chmod -R 755 site_model ls -l site_model ls -l sites/udmi_site_model ls -l site_model/reflector From ea4161953836f32d42ef8616282e7a44a7ad61de Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 12:50:04 +0000 Subject: [PATCH 08/13] chwon --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1bef1b489..5a03200a3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -399,7 +399,7 @@ jobs: ls -l site_model ls -l site_model/reflector whoami - sudo chmod -R 755 site_model + sudo chown -R runner site_model ls -l site_model ls -l sites/udmi_site_model ls -l site_model/reflector From 5c1211a7399f7f75763dbe42c7a76d9ebe28304f Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 12:56:18 +0000 Subject: [PATCH 09/13] more --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5a03200a3..e1affe25b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -399,9 +399,9 @@ jobs: ls -l site_model ls -l site_model/reflector whoami - sudo chown -R runner site_model + sudo chown -R $(whoami) site_model ls -l site_model ls -l sites/udmi_site_model ls -l site_model/reflector - name: Run Tests - run: misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file + run: sudo misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file From b5cea43761b453b944de35c2580264e864c2b572 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 13:09:19 +0000 Subject: [PATCH 10/13] renable discovery/automapper tests in tests --- .github/workflows/testing.yml | 677 +++++++++++++++++----------------- 1 file changed, 336 insertions(+), 341 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e1affe25b..b86b41937 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,344 +14,344 @@ concurrency: cancel-in-progress: true jobs: - # unit: - # name: Unit Tests - # runs-on: ubuntu-24.04 - # timeout-minutes: 10 - # steps: - # - uses: actions/setup-java@v4 - # with: - # distribution: 'temurin' - # java-version: '17' - # - uses: actions/setup-python@v5 - # with: - # python-version: '3.10' - # - name: Checkout source - # uses: actions/checkout@v4 - # - name: start and test local servers - # run: | - # bin/setup_base - # bin/clone_model - # bin/start_pubsub - # - name: bin/run_tests all_tests - # run: bin/run_tests all_tests - # - name: all test output - # if: ${{ !cancelled() }} - # run: more out/test_* - # - name: gencode test output - # if: ${{ !cancelled() }} - # run: more out/test_bin+gencode+check - # - name: validator test output - # if: ${{ !cancelled() }} - # run: more out/test_validator+bin+build+check - # - name: pubber test output - # if: ${{ !cancelled() }} - # run: more out/test_pubber+bin+build+check - # - name: udmis test output - # if: ${{ !cancelled() }} - # run: more out/test_udmis+bin+build+check - # - name: site test output - # if: ${{ !cancelled() }} - # run: more out/test_bin+test_sites + unit: + name: Unit Tests + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Checkout source + uses: actions/checkout@v4 + - name: start and test local servers + run: | + bin/setup_base + bin/clone_model + bin/start_pubsub + - name: bin/run_tests all_tests + run: bin/run_tests all_tests + - name: all test output + if: ${{ !cancelled() }} + run: more out/test_* + - name: gencode test output + if: ${{ !cancelled() }} + run: more out/test_bin+gencode+check + - name: validator test output + if: ${{ !cancelled() }} + run: more out/test_validator+bin+build+check + - name: pubber test output + if: ${{ !cancelled() }} + run: more out/test_pubber+bin+build+check + - name: udmis test output + if: ${{ !cancelled() }} + run: more out/test_udmis+bin+build+check + - name: site test output + if: ${{ !cancelled() }} + run: more out/test_bin+test_sites - # spelling: - # name: Docs Spelling Checks - # runs-on: ubuntu-24.04 - # timeout-minutes: 2 - # steps: - # - uses: actions/checkout@v4 - # - name: Check Spelling - # uses: rojopolis/spellcheck-github-actions@0.35.0 - # with: - # config_path: .spellcheck.yml - # task_name: Markdown + spelling: + name: Docs Spelling Checks + runs-on: ubuntu-24.04 + timeout-minutes: 2 + steps: + - uses: actions/checkout@v4 + - name: Check Spelling + uses: rojopolis/spellcheck-github-actions@0.35.0 + with: + config_path: .spellcheck.yml + task_name: Markdown - # automapping: - # name: Automapping capability - # runs-on: ubuntu-24.04 - # timeout-minutes: 10 - # if: ${{ vars.TARGET_PROJECT != '' && !cancelled() }} - # env: - # TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-java@v4 - # with: - # distribution: 'temurin' - # java-version: '17' - # - name: base setup - # run: | - # bin/setup_base - # bin/clone_model - # - name: local setup - # run: | - # bin/start_local sites/udmi_site_model $TARGET_PROJECT - # bin/pull_messages ${TARGET_PROJECT}%ZZ-TRI-FECTA > /tmp/message_capture.log 2>&1 & - # - name: bin/test_automapper - # run: bin/test_automapper $TARGET_PROJECT - # - name: extra devices - # run: | - # find sites/udmi_site_model/extras/ -type f | xargs sed -i '$a\' - # find sites/udmi_site_model/extras/ -type f | xargs more - # - name: udmis log - # if: ${{ !cancelled() }} - # run: cat /tmp/udmis.log - # - name: pubber log - # if: ${{ !cancelled() }} - # run: cat out/pubber.log.GAT-123 - # - name: captured messages - # if: ${{ !cancelled() }} - # run: | - # cat /tmp/message_capture.log - # mkdir -p out/registries && cd out/registries/ - # find . -type f | sort | xargs more - # - name: support bundle - # if: ${{ !cancelled() }} - # run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ - # - uses: actions/upload-artifact@v4 - # if: ${{ !cancelled() }} - # with: - # if-no-files-found: error - # name: udmi-support_${{ github.run_id }}-m - # path: '*_udmi-support_*.tgz' + automapping: + name: Automapping capability + runs-on: ubuntu-24.04 + timeout-minutes: 10 + if: ${{ vars.TARGET_PROJECT != '' && !cancelled() }} + env: + TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: base setup + run: | + bin/setup_base + bin/clone_model + - name: local setup + run: | + bin/start_local sites/udmi_site_model $TARGET_PROJECT + bin/pull_messages ${TARGET_PROJECT}%ZZ-TRI-FECTA > /tmp/message_capture.log 2>&1 & + - name: bin/test_automapper + run: bin/test_automapper $TARGET_PROJECT + - name: extra devices + run: | + find sites/udmi_site_model/extras/ -type f | xargs sed -i '$a\' + find sites/udmi_site_model/extras/ -type f | xargs more + - name: udmis log + if: ${{ !cancelled() }} + run: cat /tmp/udmis.log + - name: pubber log + if: ${{ !cancelled() }} + run: cat out/pubber.log.GAT-123 + - name: captured messages + if: ${{ !cancelled() }} + run: | + cat /tmp/message_capture.log + mkdir -p out/registries && cd out/registries/ + find . -type f | sort | xargs more + - name: support bundle + if: ${{ !cancelled() }} + run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + if-no-files-found: error + name: udmi-support_${{ github.run_id }}-m + path: '*_udmi-support_*.tgz' - # baseline: - # name: Baseline Tests - # runs-on: ubuntu-24.04 - # timeout-minutes: 15 - # needs: automapping - # if: vars.TARGET_PROJECT != '' - # env: - # TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} - # UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-java@v4 - # with: - # distribution: 'temurin' - # java-version: '17' - # - name: base setup - # run: bin/run_tests install_dependencies - # - name: local setup - # run: bin/start_local sites/udmi_site_model $TARGET_PROJECT - # - name: registrar clean - # run: bin/test_regclean solo $TARGET_PROJECT - # - name: special sequences - # if: ${{ !cancelled() }} - # run: bin/test_special $TARGET_PROJECT - # - name: telemetry validator - # if: ${{ !cancelled() }} - # run: bin/test_validator $TARGET_PROJECT - # - name: validator result - # if: ${{ !cancelled() }} - # run: more out/validator.out || true - # - name: message captures - # if: ${{ !cancelled() }} - # run: | - # cd sites/udmi_site_model/out - # find . -type f | sort | xargs ls -l - # find . -type f | sort | xargs more | cat - # - name: nostate sequences - # if: ${{ !cancelled() }} - # run: bin/test_sequencer nostate full $TARGET_PROJECT - # - name: support bundle - # if: ${{ !cancelled() }} - # run: UDMI_REGISTRY_SUFFIX=_b bin/support ${{ github.repository_owner }}_${{ github.job }}_ - # - uses: actions/upload-artifact@v4 - # if: ${{ !cancelled() }} - # with: - # if-no-files-found: error - # name: udmi-support_${{ github.run_id }}-b - # path: '*_udmi-support_*.tgz' + baseline: + name: Baseline Tests + runs-on: ubuntu-24.04 + timeout-minutes: 15 + needs: automapping + if: vars.TARGET_PROJECT != '' + env: + TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} + UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: base setup + run: bin/run_tests install_dependencies + - name: local setup + run: bin/start_local sites/udmi_site_model $TARGET_PROJECT + - name: registrar clean + run: bin/test_regclean solo $TARGET_PROJECT + - name: special sequences + if: ${{ !cancelled() }} + run: bin/test_special $TARGET_PROJECT + - name: telemetry validator + if: ${{ !cancelled() }} + run: bin/test_validator $TARGET_PROJECT + - name: validator result + if: ${{ !cancelled() }} + run: more out/validator.out || true + - name: message captures + if: ${{ !cancelled() }} + run: | + cd sites/udmi_site_model/out + find . -type f | sort | xargs ls -l + find . -type f | sort | xargs more | cat + - name: nostate sequences + if: ${{ !cancelled() }} + run: bin/test_sequencer nostate full $TARGET_PROJECT + - name: support bundle + if: ${{ !cancelled() }} + run: UDMI_REGISTRY_SUFFIX=_b bin/support ${{ github.repository_owner }}_${{ github.job }}_ + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + if-no-files-found: error + name: udmi-support_${{ github.run_id }}-b + path: '*_udmi-support_*.tgz' - # sequencer: - # name: Sequencer Tests - # runs-on: ubuntu-24.04 - # timeout-minutes: 20 - # strategy: - # fail-fast: false - # matrix: - # shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - # if: vars.TARGET_PROJECT != '' - # env: - # TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} - # UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA - # UDMI_REGISTRY_SUFFIX: _${{ matrix.shard }} - # MATRIX_SHARD_COUNT: 10 - # MATRIX_SHARD_INDEX: ${{ matrix.shard }} - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-java@v4 - # with: - # distribution: 'temurin' - # java-version: '17' - # - name: base setup - # run: bin/run_tests install_dependencies - # - name: local setup - # run: bin/start_local sites/udmi_site_model $TARGET_PROJECT - # - name: registrar clean - # run: bin/test_regclean $TARGET_PROJECT - # - name: sequence tests clean - # if: ${{ !cancelled() }} - # run: bin/test_sequencer clean nocheck $TARGET_PROJECT - # - name: sequence tests alpha - # if: ${{ !cancelled() }} - # run: bin/test_sequencer alpha nocheck $TARGET_PROJECT - # - name: sequence test post-process - # if: ${{ !cancelled() }} - # run: egrep ' test .* after .*s ' out/sequencer.log | tee out/timing_sequencer.out - # - name: itemized sequencer tests - # if: ${{ !cancelled() }} - # run: bin/test_itemized $TARGET_PROJECT - # - name: output files - # if: ${{ !cancelled() }} - # run: more out/*.out* | cat - # - name: pubber logs - # if: ${{ !cancelled() }} - # run: more out/pubber.log* pubber/out/*.json | cat - # - name: udmis log - # if: ${{ !cancelled() }} - # run: cat /tmp/udmis.log - # - name: itemized test post-process - # if: ${{ !cancelled() }} - # run: egrep ' test .* after .*s ' out/sequencer.log-* | tee out/timing_itemized.out - # - name: support bundle - # if: ${{ !cancelled() }} - # run: | - # bin/support ${{ github.repository_owner }}_${{ github.job }}_ - # tar -tzvf *udmi-support*.tgz - # - uses: actions/upload-artifact@v4 - # if: ${{ !cancelled() }} - # with: - # if-no-files-found: error - # name: udmi-support_${{ github.run_id }}-${{ matrix.shard }} - # path: '*_udmi-support_*.tgz' + sequencer: + name: Sequencer Tests + runs-on: ubuntu-24.04 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + if: vars.TARGET_PROJECT != '' + env: + TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} + UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA + UDMI_REGISTRY_SUFFIX: _${{ matrix.shard }} + MATRIX_SHARD_COUNT: 10 + MATRIX_SHARD_INDEX: ${{ matrix.shard }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: base setup + run: bin/run_tests install_dependencies + - name: local setup + run: bin/start_local sites/udmi_site_model $TARGET_PROJECT + - name: registrar clean + run: bin/test_regclean $TARGET_PROJECT + - name: sequence tests clean + if: ${{ !cancelled() }} + run: bin/test_sequencer clean nocheck $TARGET_PROJECT + - name: sequence tests alpha + if: ${{ !cancelled() }} + run: bin/test_sequencer alpha nocheck $TARGET_PROJECT + - name: sequence test post-process + if: ${{ !cancelled() }} + run: egrep ' test .* after .*s ' out/sequencer.log | tee out/timing_sequencer.out + - name: itemized sequencer tests + if: ${{ !cancelled() }} + run: bin/test_itemized $TARGET_PROJECT + - name: output files + if: ${{ !cancelled() }} + run: more out/*.out* | cat + - name: pubber logs + if: ${{ !cancelled() }} + run: more out/pubber.log* pubber/out/*.json | cat + - name: udmis log + if: ${{ !cancelled() }} + run: cat /tmp/udmis.log + - name: itemized test post-process + if: ${{ !cancelled() }} + run: egrep ' test .* after .*s ' out/sequencer.log-* | tee out/timing_itemized.out + - name: support bundle + if: ${{ !cancelled() }} + run: | + bin/support ${{ github.repository_owner }}_${{ github.job }}_ + tar -tzvf *udmi-support*.tgz + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + if-no-files-found: error + name: udmi-support_${{ github.run_id }}-${{ matrix.shard }} + path: '*_udmi-support_*.tgz' - # runlocal: - # name: UDMIS Local Setup - # runs-on: ubuntu-24.04 - # timeout-minutes: 20 - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-java@v4 - # with: - # distribution: 'temurin' - # java-version: '17' - # - name: base setup - # run: | - # bin/setup_base - # bin/clone_model - # bin/registrar sites/udmi_site_model - # - name: local setup - # run: bin/start_local sites/udmi_site_model //mqtt/localhost - # - name: bin/test_etcd - # run: bin/test_etcd - # - name: bin/test_mosquitto - # run: bin/test_mosquitto - # - name: bin/test_regclean - # run: bin/test_regclean //mqtt/localhost - # - name: bin/test_sequencer - # run: bin/test_sequencer local full //mqtt/localhost $(< etc/local_tests.txt) - # - name: bin/test_udmis - # run: bin/test_udmis - # - name: mosquitto debug - # if: ${{ !cancelled() }} - # run: | - # mosquitto -h || true - # sudo more /etc/mosquitto/* /etc/mosquitto/conf.d/* || true - # - name: udmis log - # if: ${{ !cancelled() }} - # run: cat /tmp/udmis.log - # - name: mosquitto logs - # if: ${{ !cancelled() }} - # run: cat /var/log/mosquitto/mosquitto.log || true - # - name: support bundle - # if: ${{ !cancelled() }} - # run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ - # - uses: actions/upload-artifact@v4 - # if: ${{ !cancelled() }} - # with: - # if-no-files-found: error - # name: udmi-support_${{ github.run_id }}-l - # path: '*_udmi-support_*.tgz' + runlocal: + name: UDMIS Local Setup + runs-on: ubuntu-24.04 + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: base setup + run: | + bin/setup_base + bin/clone_model + bin/registrar sites/udmi_site_model + - name: local setup + run: bin/start_local sites/udmi_site_model //mqtt/localhost + - name: bin/test_etcd + run: bin/test_etcd + - name: bin/test_mosquitto + run: bin/test_mosquitto + - name: bin/test_regclean + run: bin/test_regclean //mqtt/localhost + - name: bin/test_sequencer + run: bin/test_sequencer local full //mqtt/localhost $(< etc/local_tests.txt) + - name: bin/test_udmis + run: bin/test_udmis + - name: mosquitto debug + if: ${{ !cancelled() }} + run: | + mosquitto -h || true + sudo more /etc/mosquitto/* /etc/mosquitto/conf.d/* || true + - name: udmis log + if: ${{ !cancelled() }} + run: cat /tmp/udmis.log + - name: mosquitto logs + if: ${{ !cancelled() }} + run: cat /var/log/mosquitto/mosquitto.log || true + - name: support bundle + if: ${{ !cancelled() }} + run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + if-no-files-found: error + name: udmi-support_${{ github.run_id }}-l + path: '*_udmi-support_*.tgz' - # endpoint: - # name: Endpoint Redirection - # runs-on: ubuntu-24.04 - # timeout-minutes: 15 - # env: - # UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA - # TARGET_PROJECT: //mqtt/localhost - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-java@v4 - # with: - # distribution: 'temurin' - # java-version: '17' - # - name: base setup - # run: bin/run_tests install_dependencies - # - name: local setup - # run: bin/start_local sites/udmi_site_model $TARGET_PROJECT - # - name: regclean - # run: bin/test_regclean $TARGET_PROJECT - # - name: bin/test_proxy - # if: ${{ env.MQTT_PROXY_HOST != '' }} - # run: bin/test_proxy $TARGET_PROJECT $MQTT_PROXY_HOST - # - name: bin/test_redirect - # run: bin/test_redirect $TARGET_PROJECT - # - name: pubber.log - # if: ${{ !cancelled() }} - # run: more out/pubber.log* | cat - # - name: support bundle - # if: ${{ !cancelled() }} - # run: UDMI_REGISTRY_SUFFIX=_r bin/support ${{ github.repository_owner }}_${{ github.job }}_ - # - uses: actions/upload-artifact@v4 - # if: ${{ !cancelled() }} - # with: - # if-no-files-found: error - # name: udmi-support_${{ github.run_id }}-r - # path: '*_udmi-support_*.tgz' + endpoint: + name: Endpoint Redirection + runs-on: ubuntu-24.04 + timeout-minutes: 15 + env: + UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA + TARGET_PROJECT: //mqtt/localhost + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: base setup + run: bin/run_tests install_dependencies + - name: local setup + run: bin/start_local sites/udmi_site_model $TARGET_PROJECT + - name: regclean + run: bin/test_regclean $TARGET_PROJECT + - name: bin/test_proxy + if: ${{ env.MQTT_PROXY_HOST != '' }} + run: bin/test_proxy $TARGET_PROJECT $MQTT_PROXY_HOST + - name: bin/test_redirect + run: bin/test_redirect $TARGET_PROJECT + - name: pubber.log + if: ${{ !cancelled() }} + run: more out/pubber.log* | cat + - name: support bundle + if: ${{ !cancelled() }} + run: UDMI_REGISTRY_SUFFIX=_r bin/support ${{ github.repository_owner }}_${{ github.job }}_ + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + if-no-files-found: error + name: udmi-support_${{ github.run_id }}-r + path: '*_udmi-support_*.tgz' - # posttest: - # name: Post-test Summarization - # runs-on: ubuntu-24.04 - # timeout-minutes: 5 - # needs: [ baseline, sequencer, endpoint, runlocal ] - # if: ${{ !cancelled() && vars.TARGET_PROJECT != '' }} - # env: - # TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} - # UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v5 - # with: - # python-version: '3.10' - # - name: Base setup - # run: bin/setup_base - # - name: Download all sharded support packages - # uses: actions/download-artifact@v4 - # with: - # path: udmi-support_${{ github.run_id }} - # pattern: udmi-support_${{ github.run_id }}-* - # merge-multiple: true - # - name: Upload merged support package - # uses: actions/upload-artifact@v4 - # with: - # if-no-files-found: error - # name: udmi-support_${{ github.run_id }} - # path: 'udmi-support_${{ github.run_id }}/*_udmi-support_*.tgz' - # - name: Processing support package - # run: bin/support_process udmi-support_* - # - name: Test run index - # run: | - # ls -d sites/udmi_site_model*/out*/devices/AHU-1/tests/* - # find out* -name 'schema*.out*' -size +0 | xargs more | cat - # - name: Sequencer validation - # if: ${{ !cancelled() }} - # run: bin/test_sequcheck - # - name: Itemized validation - # if: ${{ !cancelled() }} - # run: bin/test_itemcheck + posttest: + name: Post-test Summarization + runs-on: ubuntu-24.04 + timeout-minutes: 5 + needs: [ baseline, sequencer, endpoint, runlocal ] + if: ${{ !cancelled() && vars.TARGET_PROJECT != '' }} + env: + TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} + UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Base setup + run: bin/setup_base + - name: Download all sharded support packages + uses: actions/download-artifact@v4 + with: + path: udmi-support_${{ github.run_id }} + pattern: udmi-support_${{ github.run_id }}-* + merge-multiple: true + - name: Upload merged support package + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: udmi-support_${{ github.run_id }} + path: 'udmi-support_${{ github.run_id }}/*_udmi-support_*.tgz' + - name: Processing support package + run: bin/support_process udmi-support_* + - name: Test run index + run: | + ls -d sites/udmi_site_model*/out*/devices/AHU-1/tests/* + find out* -name 'schema*.out*' -size +0 | xargs more | cat + - name: Sequencer validation + if: ${{ !cancelled() }} + run: bin/test_sequcheck + - name: Itemized validation + if: ${{ !cancelled() }} + run: bin/test_itemcheck discovery: name: Discovery Tests @@ -393,15 +393,10 @@ jobs: sleep 1 done ls -l var/tmp/pod_ready.txt 2>&1 - - name: debug - run: | - ls -l sites/udmi_site_model - ls -l site_model - ls -l site_model/reflector - whoami - sudo chown -R $(whoami) site_model - ls -l site_model - ls -l sites/udmi_site_model - ls -l site_model/reflector - name: Run Tests + # This runs as sudo because docker containers in Github CI run as root. + # So, when the UDMIS container runs `keygen`, the CSR and SRL files are + # owned by root, and cannot be ovewritten by system calls to keygen, + # unless it too is root, or the behaviour is changed, or the permisions + # are fixed. run: sudo misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file From f4b78e3474517d7567bd21e1cd87d7f73e9e8ba6 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 13:14:32 +0000 Subject: [PATCH 11/13] undo unwanted changes --- .github/workflows/integration.yaml | 214 +++++++++++++++++++++++++++++ bin/setup_ca | 2 +- 2 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/integration.yaml diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml new file mode 100644 index 000000000..0caa26fe5 --- /dev/null +++ b/.github/workflows/integration.yaml @@ -0,0 +1,214 @@ +name: UDMI Integration Suite + +on: + push: + tags: + - '**' + branches: + - '**' + workflow_dispatch: + +jobs: + images: + name: Build Docker Images + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + timeout-minutes: 5 + strategy: + fail-fast: false + matrix: + container: [ "udmis", "validator", "pubber", "misc" ] + env: + PUSH_REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + CONTAINER: ${{ matrix.container }} + REF_NAME: ${{ github.ref_name }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: Log in to the github registry + uses: docker/login-action@v3 + with: + registry: ${{ env.PUSH_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Container build and push + run: | + revhash=$(git log -n 1 --pretty=format:"%h") + IMAGE_HASH=g${revhash:0:8} + PUSH_REPO=$PUSH_REGISTRY/${IMAGE_NAME,,} + + TAG_BASE=$PUSH_REPO:$CONTAINER + PUSH_TAG=${TAG_BASE}-$IMAGE_HASH + echo PUSH_TAG=$PUSH_TAG >> $GITHUB_ENV + + bin/clone_model + $CONTAINER/bin/build check + bin/container $CONTAINER push --no-check $PUSH_TAG + + docker tag $CONTAINER:latest $TAG_BASE-latest + docker push $TAG_BASE-latest + docker tag $CONTAINER:latest $TAG_BASE-$REF_NAME + docker push $TAG_BASE-$REF_NAME + + echo Pushed built $CONTAINER container as $PUSH_TAG | tee -a $GITHUB_STEP_SUMMARY + - name: Docker images summary + run: | + docker images + echo + docker history $PUSH_TAG + + simple: + name: Simple sequence test + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: images + strategy: + fail-fast: false + matrix: + device_id: [ "AHU-1", "AHU-22", "GAT-123" ] + env: + IMAGE_NAME: ${{ github.repository }} + REF_NAME: ${{ github.ref_name }} + DEVICE_ID: ${{ matrix.device_id }} + steps: + - name: Setup Environment + run: | + sudo apt-get install moreutils + git clone https://github.com/faucetsdn/udmi_site_model.git + ln -s udmi_site_model/ site_model + (cd site_model; git log -n 1) + jq ".device_id = \"$DEVICE_ID\"" site_model/cloud_iot_config.json | sponge site_model/cloud_iot_config.json + jq . site_model/cloud_iot_config.json + docker network create udminet --subnet 192.168.99.0/24 + - name: Start UDMIS container + run: | + export IMAGE_TAG=ghcr.io/$IMAGE_NAME:udmis-$REF_NAME + docker run $IMAGE_TAG cat bin/actualize > /tmp/actualize.sh + cat /tmp/actualize.sh && bash /tmp/actualize.sh + - name: Registrar run + run: | + docker run --net udminet --name registrar -v $(realpath site_model):/root/site_model \ + ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/registrar site_model/cloud_iot_config.json + - name: Pubber background run + run: | + echo docker run -d --net udminet --name pubber -v $(realpath site_model):/root/site_model \ + ghcr.io/$IMAGE_NAME:pubber-$REF_NAME bin/pubber site_model/cloud_iot_config.json + docker run -d --net udminet --name pubber -v $(realpath site_model):/root/site_model \ + ghcr.io/$IMAGE_NAME:pubber-$REF_NAME bin/pubber site_model/cloud_iot_config.json + for count in `seq 0 30`; do + (docker ps | fgrep -q pubber) || break + (docker logs pubber 2>&1 | fgrep -q -v "Connection complete") || break + echo Waiting for pubber startup $((30 - count))... + sleep 1 + done + docker logs pubber 2>&1 | fgrep "Connection complete" + - name: Sequencer run + run: | + SEQUENCER_TESTS="broken_config extra_config device_config_acked" + [[ $REF_NAME =~ test- ]] && SEQUENCER_TESTS=${REF_NAME#test-} + docker run --net udminet --name sequencer -v $(realpath site_model):/root/site_model \ + ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/sequencer site_model/cloud_iot_config.json \ + $SEQUENCER_TESTS + - name: Sequencer results + run: | + cat site_model/out/devices/$DEVICE_ID/results.md + if [[ $REF_NAME =~ test- ]]; then + SPECIFIC_TEST=${REF_NAME#test-} + more site_model/out/devices/$DEVICE_ID/tests/$SPECIFIC_TEST/* + else + [[ $(cat site_model/out/devices/$DEVICE_ID/results.md | egrep 'stable \| [0-9]+ \| (pass|skip)' | wc -l) == 3 ]] + fi + - name: UDMIS logs + if: ${{ !cancelled() }} + run: | + docker logs udmis + more var/tmp/udmis.log + - name: Registrar logs + if: ${{ !cancelled() }} + run: docker logs registrar + - name: Pubber logs + if: ${{ !cancelled() }} + run: docker logs pubber + - name: Sequencer logs + if: ${{ !cancelled() }} + run: docker logs sequencer + + discovery: + name: Simple discovery sequencer test + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: images + env: + IMAGE_NAME: ${{ github.repository }} + REF_NAME: ${{ github.ref_name }} + DEVICE_ID: ${{'AHU-1'}} + steps: + - name: Setup Environment + run: | + sudo apt-get install moreutils + git clone https://github.com/faucetsdn/udmi_site_model.git + ln -s udmi_site_model/ site_model + (cd site_model; git log -n 1) + jq ".device_id = \"$DEVICE_ID\"" site_model/cloud_iot_config.json | sponge site_model/cloud_iot_config.json + jq . site_model/cloud_iot_config.json + docker network create udminet --subnet 192.168.99.0/24 + - name: Start UDMIS container + run: | + export IMAGE_TAG=ghcr.io/$IMAGE_NAME:udmis-$REF_NAME + docker run $IMAGE_TAG cat bin/actualize > /tmp/actualize.sh + cat /tmp/actualize.sh && bash /tmp/actualize.sh + - name: Generate keys + run: | + docker run --net udminet --name keygen -v $(realpath site_model):/root/site_model \ + ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/keygen CERT site_model/devices/$DEVICE_ID + - name: Registrar run + run: | + docker run --net udminet --name registrar -v $(realpath site_model):/root/site_model \ + ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/registrar site_model/cloud_iot_config.json + - name: Start discoverynode + run: | + export IMAGE_TAG=ghcr.io/$IMAGE_NAME:misc-$REF_NAME + # This currently fails (no config), but just check that it actually runs. + docker run -d \ + --net udminet \ + -v $(realpath site_model):/var/site_model \ + --name discoverynode \ + $IMAGE_TAG \ + bin/run /var/site_model //mqtt/udmis AHU-1 vendor.range=0x65,28179023,20231,,,,,,,,,,,,,,,, + - name: Sequencer run + run: | + docker run --net udminet --name sequencer -v $(realpath site_model):/root/site_model \ + ghcr.io/$IMAGE_NAME:validator-$REF_NAME bin/sequencer site_model/cloud_iot_config.json \ + scan_single_future + - name: Sequencer results + run: | + cat site_model/out/devices/$DEVICE_ID/results.md + [[ $(cat site_model/out/devices/$DEVICE_ID/results.md | grep -Ec ".*discovery.* pass") == 1 ]] + - name: Discoverynode logs + if: ${{ !cancelled() }} + run: docker logs discoverynode + + udmif: + name: UDMIF unit tests + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.9.0 + - name: Install Angular CLI + run: npm install -g @angular/cli + - name: web tests + run: echo Disabled udmif/web/runTests due to dependency integration problems + - name: api tests + run: echo Disabled udmif/api/runTests due to dependency integration problems diff --git a/bin/setup_ca b/bin/setup_ca index c1dbbdc35..4116a0130 100755 --- a/bin/setup_ca +++ b/bin/setup_ca @@ -20,5 +20,5 @@ echo Importing server certs from $site_model... sudo cp $site_model/reflector/ca.* $CERT_DIR/ sudo cp $site_model/reflector/rsa_private.* $CERT_DIR/ sudo chgrp -R mosquitto $CERT_DIR -sudo chmod -R 0644 $CERT_DIR +sudo chmod 0640 $CERT_DIR/rsa_private.* ls -l $CERT_DIR From d6afe26c05a5a677e9b0831d8a4f4d6b8d96f8bc Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 13:15:45 +0000 Subject: [PATCH 12/13] more unwanted changes --- .github/workflows/testing.yml | 2 +- bin/setup_ca | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b86b41937..f8dafaabf 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -399,4 +399,4 @@ jobs: # owned by root, and cannot be ovewritten by system calls to keygen, # unless it too is root, or the behaviour is changed, or the permisions # are fixed. - run: sudo misc/discoverynode/testing/e2e/test_local site_model \ No newline at end of file + run: sudo misc/discoverynode/testing/e2e/test_local site_model diff --git a/bin/setup_ca b/bin/setup_ca index 4116a0130..250915f18 100755 --- a/bin/setup_ca +++ b/bin/setup_ca @@ -20,5 +20,6 @@ echo Importing server certs from $site_model... sudo cp $site_model/reflector/ca.* $CERT_DIR/ sudo cp $site_model/reflector/rsa_private.* $CERT_DIR/ sudo chgrp -R mosquitto $CERT_DIR -sudo chmod 0640 $CERT_DIR/rsa_private.* +sudo chmod 0644 $CERT_DIR/rsa_private.* + ls -l $CERT_DIR From 5ea83d3aa99104c9c1a31c16e74fbc64a2b878c1 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Jan 2025 13:16:16 +0000 Subject: [PATCH 13/13] more unwanted changes --- bin/setup_ca | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/setup_ca b/bin/setup_ca index 250915f18..b9dd17794 100755 --- a/bin/setup_ca +++ b/bin/setup_ca @@ -21,5 +21,4 @@ sudo cp $site_model/reflector/ca.* $CERT_DIR/ sudo cp $site_model/reflector/rsa_private.* $CERT_DIR/ sudo chgrp -R mosquitto $CERT_DIR sudo chmod 0644 $CERT_DIR/rsa_private.* - ls -l $CERT_DIR