Remove "heat-admin" harcoded overcloud username from the code

Recently, the default overcloud username value has changed in the
downstream jobs
After that, some tests using the podman API failed because they
configured the podman sockets service using a hardcoded value that
doesn't apply anymore

This patch removes the harcoded value from the podman code and also from
the cloud_disruptions module

The proper overcloud ssh username needs to be configured in the
tobiko.conf file (its default configurable value is still heat-admin)

Change-Id: I38af9de21caf4eb2a8b222bb8f849da0cea5a323
This commit is contained in:
Eduardo Olivares
2022-09-09 16:13:55 +02:00
parent 28f826a471
commit b5f09cd70e
2 changed files with 5 additions and 4 deletions

View File

@@ -97,12 +97,13 @@ class PodmanClientFixture(tobiko.SharedFixture):
podman_service = 'io.podman.socket'
podman_socket_file = '/run/podman/io.podman'
username = self.ssh_client.get_connect_parameters()['username']
podman_client_setup_cmds = \
f"""sudo test -f /var/podman_client_access_setup || \
(sudo groupadd -f podman && \
sudo usermod -a -G podman heat-admin && \
sudo usermod -a -G podman {username} && \
sudo chmod -R o=wxr /etc/tmpfiles.d && \
sudo echo 'd /run/podman 0770 root heat-admin' > \
sudo echo 'd /run/podman 0770 root {username}' > \
/etc/tmpfiles.d/podman.conf && \
sudo cp /lib/systemd/system/{podman_service} \
/etc/systemd/system/{podman_service} && \

View File

@@ -42,7 +42,7 @@ from tobiko.tripleo import topology as tripleo_topology
LOG = log.getLogger(__name__)
network_disruption = """
sudo iptables-save > /home/heat-admin/working.iptables.rules &&
sudo iptables-save > ~/working.iptables.rules &&
sudo iptables -I INPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT &&
sudo iptables -I INPUT 2 -p tcp -m state --state NEW -m tcp --dport 22 -j \
ACCEPT &&
@@ -52,7 +52,7 @@ network_disruption = """
"""
undisrupt_network = """
sudo iptables-restore /home/heat-admin/working.iptables.rules
sudo iptables-restore ~/working.iptables.rules
"""
ovn_db_pcs_resource_restart = "sudo pcs resource restart ovn-dbs-bundle"
kill_rabbit = "sudo pkill -9 beam.smp"