diff --git a/ci-infra/ntp-chrony/Readme.md b/ci-infra/ntp-chrony/Readme.md new file mode 100644 index 000000000..fb1c66f09 --- /dev/null +++ b/ci-infra/ntp-chrony/Readme.md @@ -0,0 +1,19 @@ +We need a reliable 2 NTP servers for testing NTP reconfiguration. + +Setup them once in VMs + +``` +apt install -y chrony ntpdate +cat /etc/chrony/chrony.conf + # See chrony.conf example file. + # Just add 'allow all' line if needed +grep 'allow all' /etc/chrony/chrony.conf || echo 'allow all' + +systemctl enable chrony +systemctl restart chrony +chronyc tracking + +ntpdate -qup1 localhost +``` + +Check from outside if firewall allows NTP traffic - port 123/UDP. diff --git a/ci-infra/ntp-chrony/chrony.conf b/ci-infra/ntp-chrony/chrony.conf new file mode 100644 index 000000000..3a1b23834 --- /dev/null +++ b/ci-infra/ntp-chrony/chrony.conf @@ -0,0 +1,47 @@ +# Welcome to the chrony configuration file. See chrony.conf(5) for more +# information about usuable directives. + +# This will use (up to): +# - 4 sources from ntp.ubuntu.com which some are ipv6 enabled +# - 2 sources from 2.ubuntu.pool.ntp.org which is ipv6 enabled as well +# - 1 source from [01].ubuntu.pool.ntp.org each (ipv4 only atm) +# This means by default, up to 6 dual-stack and up to 2 additional IPv4-only +# sources will be used. +# At the same time it retains some protection against one of the entries being +# down (compare to just using one of the lines). See (LP: #1754358) for the +# discussion. +# +# About using servers from the NTP Pool Project in general see (LP: #104525). +# Approved by Ubuntu Technical Board on 2011-02-08. +# See http://www.pool.ntp.org/join.html for more information. +pool ntp.ubuntu.com iburst maxsources 4 +pool 0.ubuntu.pool.ntp.org iburst maxsources 1 +pool 1.ubuntu.pool.ntp.org iburst maxsources 1 +pool 2.ubuntu.pool.ntp.org iburst maxsources 2 + +# This directive specify the location of the file containing ID/key pairs for +# NTP authentication. +keyfile /etc/chrony/chrony.keys + +# This directive specify the file into which chronyd will store the rate +# information. +driftfile /var/lib/chrony/chrony.drift + +# Uncomment the following line to turn logging on. +#log tracking measurements statistics + +# Log files location. +logdir /var/log/chrony + +# Stop bad estimates upsetting machine clock. +maxupdateskew 100.0 + +# This directive enables kernel synchronisation (every 11 minutes) of the +# real-time clock. Note that it can't be used along with the 'rtcfile' directive. +rtcsync + +# Step the system clock instead of slewing it if the adjustment is larger than +# one second, but only in the first three clock updates. +makestep 1 3 + +allow all diff --git a/tests/integration/integration_config.yml.j2 b/tests/integration/integration_config.yml.j2 index 5f39be9a9..ef279f0db 100644 --- a/tests/integration/integration_config.yml.j2 +++ b/tests/integration/integration_config.yml.j2 @@ -94,6 +94,9 @@ sc_config: # Can we update the host? VSNS hosts report update as available, # but if we try to update, the update fails (unsupported HW is reported back). can_be_applied: True + # If the cluster was updated before, then we can access + # https://IP/update/update_status.json (version_update_status_info module). + old_update_status_present: True virtual_disk: # Virtual disk feature is supported iff version ">=9.2.10" is_supported: True @@ -126,6 +129,8 @@ sc_config: next_version: "9.1.23.210897" latest_version: "9.1.23.210897" can_be_applied: False + # We can try update, update will fail, and status.json will be present. + old_update_status_present: True virtual_disk: is_supported: False # replication_factor: @@ -155,6 +160,7 @@ sc_config: next_version: "" latest_version: "" can_be_applied: False + old_update_status_present: False virtual_disk: is_supported: True replication_factor: 1 diff --git a/tests/integration/targets/email_alert/tasks/02_email_alert.yml b/tests/integration/targets/email_alert/tasks/02_email_alert.yml index 4f6206e92..93617832c 100644 --- a/tests/integration/targets/email_alert/tasks/02_email_alert.yml +++ b/tests/integration/targets/email_alert/tasks/02_email_alert.yml @@ -119,18 +119,30 @@ ['alert_tag_uuid', 'email', 'latest_task_tag', 'resend_delay', 'silent_period', 'uuid'] - + # Sending email can fail. + # We are using external SMTP server, and email address is from external domain. + # Either of two might not work. + # Try to resend after delay. + # Alternatives: + # - Set up a dedicated SMTP server, and use it during test. + # It will have IP, but no DNS domain. + # - Use a temp email address from some public service (like https://temp-mail.org). + # Again external service. - name: Send test email to an existing Email Alert Recipient scale_computing.hypercore.email_alert: email: "{{ new_email }}" state: test register: result + retries: 5 + delay: 10 + until: result is succeeded - scale_computing.hypercore.email_alert_info: register: info - ansible.builtin.debug: msg: "{{ result }}" - ansible.builtin.assert: that: + - result is succeeded - result.changed == False - result.diff.before == result.diff.after - info.records|length == 1|int diff --git a/tests/integration/targets/inventory/runme.sh b/tests/integration/targets/inventory/runme.sh index 4f6793416..7fc9786ad 100755 --- a/tests/integration/targets/inventory/runme.sh +++ b/tests/integration/targets/inventory/runme.sh @@ -6,9 +6,10 @@ eval "$(cat <