Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/scenarios-bootc/presubmits/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add a comment on why we pass sync frequency in this specific test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

suites/standard1/ suites/selinux/validate-selinux-policy.robot
}
3 changes: 3 additions & 0 deletions test/scenarios/presubmits/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add a comment on why we pass sync frequency in this specific test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

suites/standard1/ suites/selinux/validate-selinux-policy.robot
}
41 changes: 32 additions & 9 deletions test/suites/standard1/dns.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}
Expand All @@ -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
Expand All @@ -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}
Expand Down