cloudpulse support for podman
Change-Id: I3023dbd5a0070bff67562a717638202f2a3fd07a
This commit is contained in:
@@ -34,6 +34,10 @@ TESTS_OPTS = [
|
|||||||
cfg.BoolOpt('containerized',
|
cfg.BoolOpt('containerized',
|
||||||
default=True,
|
default=True,
|
||||||
help='enable if the processes are running as containers'),
|
help='enable if the processes are running as containers'),
|
||||||
|
cfg.StrOpt('container_type',
|
||||||
|
default='docker',
|
||||||
|
choices=['docker', 'podman'],
|
||||||
|
help='container type'),
|
||||||
cfg.StrOpt('rabbit_container',
|
cfg.StrOpt('rabbit_container',
|
||||||
default='rabbitmq',
|
default='rabbitmq',
|
||||||
help='name of the rabitmq container'),
|
help='name of the rabitmq container'),
|
||||||
@@ -102,8 +106,8 @@ def execute(command):
|
|||||||
return {'status': p.returncode, 'output': stdout.decode('utf-8')}
|
return {'status': p.returncode, 'output': stdout.decode('utf-8')}
|
||||||
|
|
||||||
|
|
||||||
def get_container_name(name):
|
def get_container_name(name, container_command='docker'):
|
||||||
cmd = "ansible -o all -i 127.0.0.1, -a 'docker ps' -u root"
|
cmd = "ansible -o all -i 127.0.0.1, -a '%s ps' -u root" % container_command
|
||||||
op = execute(cmd)
|
op = execute(cmd)
|
||||||
if op['status']:
|
if op['status']:
|
||||||
return None
|
return None
|
||||||
@@ -141,6 +145,7 @@ class operator_scenario(base.Scenario):
|
|||||||
def load(self):
|
def load(self):
|
||||||
self.os_node_info_obj = openstack_node_info_reader(
|
self.os_node_info_obj = openstack_node_info_reader(
|
||||||
cfg.CONF.operator_test.operator_setup_file)
|
cfg.CONF.operator_test.operator_setup_file)
|
||||||
|
self.container_command = cfg.CONF.operator_test.container_type
|
||||||
|
|
||||||
@base.scenario(admin_only=False, operator=True)
|
@base.scenario(admin_only=False, operator=True)
|
||||||
def rabbitmq_check(self):
|
def rabbitmq_check(self):
|
||||||
@@ -150,8 +155,8 @@ class operator_scenario(base.Scenario):
|
|||||||
|
|
||||||
is_containerized = cfg.CONF.operator_test.containerized
|
is_containerized = cfg.CONF.operator_test.containerized
|
||||||
if is_containerized:
|
if is_containerized:
|
||||||
rabbit_container = get_container_name('rabbitmq')
|
rabbit_container = get_container_name('rabbitmq', self.container_command)
|
||||||
cmd = ("'docker exec %s %s'" % (rabbit_container, cmd))
|
cmd = ("'%s exec %s %s'" % (self.container_command, rabbit_container, cmd))
|
||||||
|
|
||||||
cmd = anscmd + cmd + " -u root "
|
cmd = anscmd + cmd + " -u root "
|
||||||
|
|
||||||
@@ -200,9 +205,9 @@ class operator_scenario(base.Scenario):
|
|||||||
|
|
||||||
is_containerized = cfg.CONF.operator_test.containerized
|
is_containerized = cfg.CONF.operator_test.containerized
|
||||||
if is_containerized:
|
if is_containerized:
|
||||||
galera_container = get_container_name('mariadb')
|
galera_container = get_container_name('mariadb', self.container_command)
|
||||||
|
|
||||||
cmd = ("'docker exec %s %s'" % (galera_container, cmd))
|
cmd = ("'%s exec %s %s'" % (self.container_command, galera_container, cmd))
|
||||||
cmd = anscmd + cmd + ' -u root'
|
cmd = anscmd + cmd + ' -u root'
|
||||||
|
|
||||||
res = execute(cmd)
|
res = execute(cmd)
|
||||||
@@ -229,8 +234,8 @@ class operator_scenario(base.Scenario):
|
|||||||
|
|
||||||
nodeip_list = [node.ip for node in node_list]
|
nodeip_list = [node.ip for node in node_list]
|
||||||
anscmd = "ansible -o all -i %s -a " % ','.join(nodeip_list)
|
anscmd = "ansible -o all -i %s -a " % ','.join(nodeip_list)
|
||||||
cmd = "'docker ps -a --format \{\{.Names\}\} --filter %s '" \
|
cmd = ("'%s ps -a --format \{\{.Names\}\} --filter %s '" \
|
||||||
% "status=exited"
|
% (self.container_command, "status=exited"))
|
||||||
cmd = anscmd + cmd + ' -u root'
|
cmd = anscmd + cmd + ' -u root'
|
||||||
|
|
||||||
res = execute(cmd)
|
res = execute(cmd)
|
||||||
@@ -305,8 +310,8 @@ class operator_scenario(base.Scenario):
|
|||||||
cmd = (r"ceph -f json status")
|
cmd = (r"ceph -f json status")
|
||||||
is_containerized = cfg.CONF.operator_test.containerized
|
is_containerized = cfg.CONF.operator_test.containerized
|
||||||
if is_containerized:
|
if is_containerized:
|
||||||
ceph_container = get_container_name("cephmon")
|
ceph_container = get_container_name("cephmon", self.container_command)
|
||||||
cmd = ("'docker exec %s %s'" % (ceph_container, cmd))
|
cmd = ("'%s exec %s %s'" % (self.container_command, ceph_container, cmd))
|
||||||
anscmd = "ansible -o all -i 127.0.0.1, -a "
|
anscmd = "ansible -o all -i 127.0.0.1, -a "
|
||||||
cmd = anscmd + cmd + ' -u root'
|
cmd = anscmd + cmd + ' -u root'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user