From 0c15cbd09cbd4d38a6c8b34bce34d8f741f61a4a Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Fri, 23 Jan 2026 14:27:07 +0100 Subject: [PATCH 1/9] Fix typo in DEVELOPMENT.md Signed-off-by: Justin Cinkelj --- DEVELOPMENT.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 29667327..739e1359 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -231,7 +231,7 @@ ScaleComputing does setup new VSNS, with suitable HyperCore version installed. Steps: - Request / reserve static IP address from Alex - - either replacing existing static IP or using next in series 105.11.20x + - either replacing existing static IP or using next in series 10.5.11.20x - create empty VM with 1 virtio disk, type other, tag hc3nested, 16GB ram, 4 cores. - image new vSNS node using test iso image (vs. release - this may change in upcoming releases) - (optional) Save it as template VM, example name `vsns9213-unconfigured` @@ -240,6 +240,7 @@ Steps: - `sudo singleNodeCluster=1 scclusterinit` - Save it as template VM, example name `vsns9213-template` - Create a final vSNS from template VM, example name `vsns9213-ci` + - keep same MAC address? - Add vSNS login URL to Azure OIDC redirectUris - ensure ip address is added to entraAD (azure) app registration for OIDC integration (ask Dave if needed) - "app_display_name": "Scale Computing HC3", From c08a6c028e0b624d4d2332ad774472c0d57b0d5b Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Fri, 23 Jan 2026 14:27:47 +0100 Subject: [PATCH 2/9] Document run-tests.sh - helper to re-test failed integration tests easily Signed-off-by: Justin Cinkelj --- DEVELOPMENT.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 739e1359..7dabda9b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -213,6 +213,33 @@ Sample ansible.cfg is there to ensure collection does not need to be installed. ansible-playbook -i localhost, examples/iso_info.yml -v ``` +## Running integration tests + +The `ansible-test integration` will try to run all integration test, and will fail on first problematic test. +It does allow you to continue from the failed test. + +You might want to automatically continue running remaining tests. +A few failed tests can be reviewed and retried later. +The `./ci-infra/helpers/run-tests.sh` was made for this. +If N tests fail in first pass, the `run-tests.sh` will retry only those N test in second pass. +The script is used like: + +```bash +source ci-infra/local-dev/env-host-4.sh +./ci-infra/helpers/run-tests.sh outdir +``` + +File `tests.txt` is optional input. +It contains one test name per line. +If ommited, all tests from `tests/integration` are run. + +After run, the scripts create in `outd` directory: + +- directory `log-${timestamp}` directory containing a log file for each run test +- file `status.txt` contains OK/ERR/PEND/SKIP status for each run test + +On next run, only tests that have PEND/ERR status are retried. + ## Creating a release Releases are automatically created when a tag is created with a name matching From 09cec227673a6cea5800178fed48f1a1b3caba50 Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Fri, 23 Jan 2026 17:23:31 +0100 Subject: [PATCH 3/9] CI how to prepare HC3 host for integration tests Signed-off-by: Justin Cinkelj --- DEVELOPMENT.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 7dabda9b..4509b4b8 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -215,6 +215,15 @@ ansible-playbook -i localhost, examples/iso_info.yml -v ## Running integration tests +Some test objects (ISO image, VirtualDisk, VM) needs to be created before we run integration tests. +Use command: + +```bash +ansible-playbook -i localhost, tests/integration/prepare/prepare_vm.yml -v +ansible-playbook -i localhost, tests/integration/prepare/prepare_iso.yml -v +ansible-playbook -i localhost, tests/integration/prepare/prepare_examples.yml -v +``` + The `ansible-test integration` will try to run all integration test, and will fail on first problematic test. It does allow you to continue from the failed test. From 578cd4f6350965a79c29af5f057ac51de11c536c Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Mon, 26 Jan 2026 07:57:03 +0100 Subject: [PATCH 4/9] Print test progress - number and total count Signed-off-by: Justin Cinkelj --- ci-infra/helpers/run-tests.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci-infra/helpers/run-tests.sh b/ci-infra/helpers/run-tests.sh index 293992f1..8db1192d 100755 --- a/ci-infra/helpers/run-tests.sh +++ b/ci-infra/helpers/run-tests.sh @@ -40,14 +40,17 @@ then echo "ERROR file content $TSTATUS" 1>&2 exit 1 fi +/bin/cp "$TSTATUS" "$OUTD2/status.txt" TEST_NAMES=$(grep "^PEND" "$TSTATUS" | awk '{print $2}') # shellcheck disable=SC2086 echo "Pending tests: "$TEST_NAMES # shellcheck disable=SC2086 +TEST_COUNT=$(echo $TEST_NAMES | wc -w) +ii=0 for TN in $TEST_NAMES do - echo "Running test $TN" + echo "Running test $TN ($ii/$TEST_COUNT)" ( echo ansible-test integration --local "$TN" echo "======================" @@ -67,4 +70,5 @@ do ) >"$OUTD2/$TN.log" 2>&1 res=$(grep $'\t'"$TN\$" "$TSTATUS" | awk '{print $1}') echo " result $res $TN" + ii=$((ii+1)) done From 7489859b45b8c74dd4b17bfdcff82472103c09c2 Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Mon, 26 Jan 2026 07:57:45 +0100 Subject: [PATCH 5/9] Auto retry failed test if there are no pending tests Signed-off-by: Justin Cinkelj --- ci-infra/helpers/run-tests.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ci-infra/helpers/run-tests.sh b/ci-infra/helpers/run-tests.sh index 8db1192d..860ad7f4 100755 --- a/ci-infra/helpers/run-tests.sh +++ b/ci-infra/helpers/run-tests.sh @@ -5,6 +5,7 @@ # Input: # - outdir will contain status/progress file, and log files of individual tests # - (optional) test-names.txt contains integration tests to be run, one per line. +# If not given, all tests in tests/integration/targets/ are run. # Output: # - logs are one test per file, in outdir/log-timestamp/ # - list of succeded/failed tests are in outdir/status.txt @@ -12,6 +13,8 @@ # - PEND (or contains just test name), test will be run # - SKIP means skip this test # - OK or ERR are set after test is run +# On second run, only PEND tests are run. +# If there are no PEND tests, the ERR tests are retried. set -ue # set -v @@ -43,10 +46,22 @@ fi /bin/cp "$TSTATUS" "$OUTD2/status.txt" TEST_NAMES=$(grep "^PEND" "$TSTATUS" | awk '{print $2}') +if [ -z "$TEST_NAMES" ] +then + echo "No PEND tests, retrying ERR tests" + sed -i 's/^ERR/PEND/' "$TSTATUS" +fi +TEST_NAMES=$(grep "^PEND" "$TSTATUS" | awk '{print $2}') +if [ -z "$TEST_NAMES" ] +then + echo "No tests to run, exiting." + exit 0 +fi # shellcheck disable=SC2086 echo "Pending tests: "$TEST_NAMES # shellcheck disable=SC2086 TEST_COUNT=$(echo $TEST_NAMES | wc -w) + ii=0 for TN in $TEST_NAMES do From cd14233f7d80a837fa5ac3541e350b813cf651e9 Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Tue, 27 Jan 2026 23:10:34 +0100 Subject: [PATCH 6/9] CI setup OIDC login for inventory test Signed-off-by: Justin Cinkelj --- .../targets/inventory/oidc_config.yml | 10 ++++++++++ tests/integration/targets/inventory/runme.sh | 2 ++ .../inventory/tasks/setup_oidc_config.yml | 20 +++++++++++++++++++ .../targets/utils_login/tasks/main.yml | 13 ++++++++++++ .../utils_login/tasks/setup_oidc_config.yml | 1 + 5 files changed, 46 insertions(+) create mode 100644 tests/integration/targets/inventory/oidc_config.yml create mode 100644 tests/integration/targets/inventory/tasks/setup_oidc_config.yml create mode 120000 tests/integration/targets/utils_login/tasks/setup_oidc_config.yml diff --git a/tests/integration/targets/inventory/oidc_config.yml b/tests/integration/targets/inventory/oidc_config.yml new file mode 100644 index 00000000..56f9044c --- /dev/null +++ b/tests/integration/targets/inventory/oidc_config.yml @@ -0,0 +1,10 @@ +--- +- name: Set OIDC configuration + hosts: localhost + gather_facts: False + vars: + oidc_config: "{{ sc_config[sc_host].oidc }}" + + tasks: + - name: Import tasks setup_oidc_config.yml + import_tasks: tasks/setup_oidc_config.yml diff --git a/tests/integration/targets/inventory/runme.sh b/tests/integration/targets/inventory/runme.sh index af979300..dca9280c 100755 --- a/tests/integration/targets/inventory/runme.sh +++ b/tests/integration/targets/inventory/runme.sh @@ -55,6 +55,8 @@ ansible-playbook -i localhost, -i hypercore_inventory_ansible_both_false.yml run # test with OIDC user # We can do this only if OIDC login is configured. +echo "Ensure OIDC login is setup on tested HyperCore." +ansible-playbook -e @"$vars_file" oidc_config.yml echo "Testing inventory plugin with OIDC user." eval "$(cat < Date: Wed, 28 Jan 2026 09:13:02 +0100 Subject: [PATCH 7/9] CI check VM is running before VM reset test Signed-off-by: Justin Cinkelj --- .../targets/i_vm_params/tasks/02_machine_type.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integration/targets/i_vm_params/tasks/02_machine_type.yml b/tests/integration/targets/i_vm_params/tasks/02_machine_type.yml index dd68f06f..c39db3b2 100644 --- a/tests/integration/targets/i_vm_params/tasks/02_machine_type.yml +++ b/tests/integration/targets/i_vm_params/tasks/02_machine_type.yml @@ -210,6 +210,12 @@ - not output.records[0].snapshot_schedule # =================================================================== + # Reset a running VM + - name: Check initial VM power_state + ansible.builtin.assert: + that: + - output.records[0].power_state == "started" + - name: Set VMs power_state - reset scale_computing.hypercore.vm_params: vm_name: "{{ vm_name }}" From 2bd589cc875e1dbc67781eee9134224c06d2b3fd Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Wed, 28 Jan 2026 10:05:19 +0100 Subject: [PATCH 8/9] CI cloud-init workaround Signed-off-by: Justin Cinkelj --- .../templates/meta-data.ubuntu-20.04.yml.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/integration/targets/role_template2vm/templates/meta-data.ubuntu-20.04.yml.j2 b/tests/integration/targets/role_template2vm/templates/meta-data.ubuntu-20.04.yml.j2 index ba6198f0..77c15c2e 100644 --- a/tests/integration/targets/role_template2vm/templates/meta-data.ubuntu-20.04.yml.j2 +++ b/tests/integration/targets/role_template2vm/templates/meta-data.ubuntu-20.04.yml.j2 @@ -1,5 +1,11 @@ dsmode: local local-hostname: "{{ vm_name }}" +{# + Comment out network configuration to use cloud-init default + which is to enable DHCP on the first detected interface. + In generated /var/lib/cloud/instance/network-config.json is string "_orig_eni_name". + This is invalid cloud-init config. + network-interfaces: | auto lo iface lo inet loopback @@ -13,6 +19,8 @@ network-interfaces: | # - CI VSNS v9.3.5 (https://10.5.11.203/) # - CI VSNS v9.4.17 (https://10.5.11.205/) iface ens1 inet dhcp + # Device enp1s1 on VSNS 4.7.0.221603 prerelease + iface enp1 inet dhcp {% endif %} {% if vm_network_mode == "static" %} iface {{ vm_network_iface }} inet static @@ -21,3 +29,4 @@ network-interfaces: | gateway {{ vm_network_gateway }} dns-nameservers {{ vm_network_dns_nameservers }} {% endif %} +#} From 0364c7d94d03cded8525f702f5c65056ff1388fd Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Wed, 28 Jan 2026 11:19:38 +0100 Subject: [PATCH 9/9] CI get test NTP servers from integration_config.yml.j2 Signed-off-by: Justin Cinkelj --- tests/integration/integration_config.yml.j2 | 4 ++++ .../targets/time_server/tasks/01_time_server_info.yml | 4 +--- .../targets/time_server/tasks/02_time_server.yml | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/integration/integration_config.yml.j2 b/tests/integration/integration_config.yml.j2 index d0df1fbc..2f3cf772 100644 --- a/tests/integration/integration_config.yml.j2 +++ b/tests/integration/integration_config.yml.j2 @@ -35,6 +35,10 @@ sc_config: # pool.ntp.org servers frequently return KOD. # time.google.com does not complain. source: time.google.com + # We need 2 NTP servers. + # Set them up per ci-infra/ntp-chrony/Readme.md. + time_server_a: 10.5.11.5 + time_server_b: 10.5.11.75 time_zone: zone: US/Eastern dns_config: diff --git a/tests/integration/targets/time_server/tasks/01_time_server_info.yml b/tests/integration/targets/time_server/tasks/01_time_server_info.yml index e85558e7..ffa24954 100644 --- a/tests/integration/targets/time_server/tasks/01_time_server_info.yml +++ b/tests/integration/targets/time_server/tasks/01_time_server_info.yml @@ -6,9 +6,7 @@ vars: actual_uuid: "timesource_guid" - # We need 2 NTP servers. - # Set them up per ci-infra/ntp-chrony/Readme.md. - actual_host: "10.5.11.5" + actual_host: "{{ sc_config[sc_host].time_server.time_server_a }}" block: # ------------------------------------------------------- diff --git a/tests/integration/targets/time_server/tasks/02_time_server.yml b/tests/integration/targets/time_server/tasks/02_time_server.yml index d813224a..ddb1bec0 100644 --- a/tests/integration/targets/time_server/tasks/02_time_server.yml +++ b/tests/integration/targets/time_server/tasks/02_time_server.yml @@ -5,10 +5,8 @@ SC_PASSWORD: "{{ sc_config[sc_host].sc_password }}" SC_TIMEOUT: "{{ sc_timeout * 10 }}" vars: - # We need 2 NTP servers. - # Set them up per ci-infra/ntp-chrony/Readme.md. - time_server_a: 10.5.11.5 - time_server_b: 10.5.11.75 + time_server_a: "{{ sc_config[sc_host].time_server.time_server_a }}" + time_server_b: "{{ sc_config[sc_host].time_server.time_server_b }}" actual_uuid: timesource_guid block: