diff --git a/test/scenarios-bootc/presubmits/el96-src@standard-suite1.sh b/test/scenarios-bootc/presubmits/el96-src@standard-suite1.sh index d30951a6ce..273b443229 100644 --- a/test/scenarios-bootc/presubmits/el96-src@standard-suite1.sh +++ b/test/scenarios-bootc/presubmits/el96-src@standard-suite1.sh @@ -12,7 +12,10 @@ scenario_remove_vms() { } scenario_run_tests() { + # The SYNC_FREQUENCY is set to a shorter-than-default value to speed up + # pre-submit scenario completion time in DNS tests. run_tests host1 \ --variable "EXPECTED_OS_VERSION:9.6" \ + --variable "SYNC_FREQUENCY:5s" \ suites/standard1/ suites/selinux/validate-selinux-policy.robot } diff --git a/test/scenarios/presubmits/el96-src@standard-suite1.sh b/test/scenarios/presubmits/el96-src@standard-suite1.sh index c460d45899..60724e71d2 100644 --- a/test/scenarios/presubmits/el96-src@standard-suite1.sh +++ b/test/scenarios/presubmits/el96-src@standard-suite1.sh @@ -12,7 +12,10 @@ scenario_remove_vms() { } scenario_run_tests() { + # The SYNC_FREQUENCY is set to a shorter-than-default value to speed up + # pre-submit scenario completion time in DNS tests. run_tests host1 \ --variable "EXPECTED_OS_VERSION:9.6" \ + --variable "SYNC_FREQUENCY:5s" \ suites/standard1/ suites/selinux/validate-selinux-policy.robot } diff --git a/test/suites/standard1/dns.robot b/test/suites/standard1/dns.robot index 75ddb2234a..84a690ccac 100644 --- a/test/suites/standard1/dns.robot +++ b/test/suites/standard1/dns.robot @@ -21,17 +21,12 @@ ${FAKE_LISTEN_IP} 99.99.99.99 ${CUSTOM_HOSTS_FILE} /tmp/hosts23 ${PODS_HOSTS_FILE} /tmp/hosts/hosts ${HOSTNAME} ${EMPTY} +${SYNC_FREQUENCY} ${EMPTY} ${HOSTSFILE_ENABLED} SEPARATOR=\n ... --- ... dns: ... \ \ hosts: ... \ \ \ status: Enabled -${HOSTS_CONFIG_CUSTOM} SEPARATOR=\n -... --- -... dns: -... \ \ hosts: -... \ \ \ status: Enabled -... \ \ \ file: ${CUSTOM_HOSTS_FILE} ${HOSTSFILE_DISABLED} SEPARATOR=\n ... --- ... dns: @@ -48,13 +43,13 @@ Resolve Host from Default Hosts File Resolve Host from Non-Default Hosts File [Documentation] Resolve host from default hosts file - [Setup] Setup With Custom Config ${HOSTS_CONFIG_CUSTOM} ${CUSTOM_HOSTS_FILE} + [Setup] Setup With Custom Hosts File Resolve Host From Pod ${HOSTNAME} [Teardown] Teardown Hosts File ${HOSTNAME} Dynamic Hosts File Update Without Restart [Documentation] Verify hosts file changes are reflected without MicroShift or pod restarts - [Setup] Setup With Custom Config ${HOSTS_CONFIG_CUSTOM} ${CUSTOM_HOSTS_FILE} + [Setup] Setup With Custom Hosts File Resolve Host From Pod ${HOSTNAME} ${updated_hostname}= Generate Random HostName Add Entry To Hosts ${FAKE_LISTEN_IP} ${updated_hostname} ${CUSTOM_HOSTS_FILE} @@ -73,10 +68,33 @@ Disable CoreDNS Hosts And Verify ConfigMap Removed *** Keywords *** +Get Hosts Config Custom + [Documentation] Build hosts config with optional syncFrequency + ... syncFrequency is configurable in order to speed up the ConfigMap synchronization time + ... for the pods that mount it. + IF "${SYNC_FREQUENCY}" != "${EMPTY}" + ${config}= Catenate SEPARATOR=\n + ... --- + ... kubelet: + ... \ \ syncFrequency: ${SYNC_FREQUENCY} + ... dns: + ... \ \ hosts: + ... \ \ \ status: Enabled + ... \ \ \ file: ${CUSTOM_HOSTS_FILE} + ELSE + ${config}= Catenate SEPARATOR=\n + ... --- + ... dns: + ... \ \ hosts: + ... \ \ \ status: Enabled + ... \ \ \ file: ${CUSTOM_HOSTS_FILE} + END + RETURN ${config} + Resolve Host From Pod [Documentation] Resolve host from pod [Arguments] ${hostname} - Wait Until Keyword Succeeds 40x 2s + Wait Until Keyword Succeeds 40x 5s ... Router Should Resolve Hostname ${hostname} Router Should Resolve Hostname @@ -95,6 +113,11 @@ Setup With Custom Config Drop In MicroShift Config ${config_content} 20-dns Restart MicroShift +Setup With Custom Hosts File + [Documentation] Get custom hosts config and setup with it + ${config}= Get Hosts Config Custom + Setup With Custom Config ${config} ${CUSTOM_HOSTS_FILE} + Teardown Hosts File [Documentation] Teardown the hosts file [Arguments] ${hostname}