From a2943894031e5b1c7662512d54ffb75a3cd3ca9d Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Tue, 25 Apr 2023 21:50:31 +0200 Subject: [PATCH] Set dhcp_client based on cirros version This change allows us to bump the default cirros version in devstack. Since cirros version 0.6.0 dhcpcd is the default dhcp client. The older cirros images used udhcpc client (the only available client at that time) which is also the default client in Tempest. This patch makes devstack configure dhcpcd client in tempest.conf if cirros >= 0.6.0 is going to be used in scenario tests. The commit also introduces a new SCENARIO_IMAGE_TYPE option. It is now a trigger for cirros specific settings, later it might be used for any other image's settings. Closes-Bug: #2007973 Change-Id: I2738c3b1d302c6656ce2c209671ea954fbc1b05b --- lib/tempest | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/tempest b/lib/tempest index 7da9f17052..9fa989a2f6 100644 --- a/lib/tempest +++ b/lib/tempest @@ -517,8 +517,19 @@ function configure_tempest { # Scenario SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES} SCENARIO_IMAGE_FILE=$DEFAULT_IMAGE_FILE_NAME + SCENARIO_IMAGE_TYPE=${SCENARIO_IMAGE_TYPE:-cirros} iniset $TEMPEST_CONFIG scenario img_file $SCENARIO_IMAGE_DIR/$SCENARIO_IMAGE_FILE + # since version 0.6.0 cirros uses dhcpcd dhcp client by default, however, cirros, prior to the + # version 0.6.0, used udhcpc (the only available client at that time) which is also tempest's default + if [[ "$SCENARIO_IMAGE_TYPE" == "cirros" ]]; then + # the image is a cirros image + # use dhcpcd client when version greater or equal 0.6.0 + if [[ $(echo $CIRROS_VERSION | tr -d '.') -ge 060 ]]; then + iniset $TEMPEST_CONFIG scenario dhcp_client dhcpcd + fi + fi + # If using provider networking, use the physical network for validation rather than private TEMPEST_SSH_NETWORK_NAME=$PRIVATE_NETWORK_NAME if is_provider_network; then