diff options
Diffstat (limited to 'functest/opnfv_tests/openstack/shaker/shaker.py')
-rw-r--r-- | functest/opnfv_tests/openstack/shaker/shaker.py | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/functest/opnfv_tests/openstack/shaker/shaker.py b/functest/opnfv_tests/openstack/shaker/shaker.py index ba93ba5b5..70eb8a75b 100644 --- a/functest/opnfv_tests/openstack/shaker/shaker.py +++ b/functest/opnfv_tests/openstack/shaker/shaker.py @@ -50,16 +50,40 @@ class Shaker(singlevm.SingleVm2): - 1 on operation error """ assert self.ssh + keystone_id = self.orig_cloud.search_services('keystone')[0].id + self.__logger.debug("keystone id: %s", keystone_id) + endpoint = self.orig_cloud.search_endpoints( + filters={'interface': os.environ.get('OS_INTERFACE', 'public'), + 'service_id': keystone_id})[0].url + self.__logger.debug("keystone endpoint: %s", endpoint) + self.orig_cloud.grant_role( + "admin", user=self.project.user.id, + project=self.project.project.id, + domain=self.project.domain.id) + self.orig_cloud.grant_role( + "heat_stack_owner", user=self.project.user.id, + project=self.project.project.id, + domain=self.project.domain.id) scpc = scp.SCPClient(self.ssh.get_transport()) - scpc.put('/home/opnfv/functest/conf/env_file', '~/env_file') + scpc.put('/home/opnfv/functest/conf/env_file', remote_path='~/') (_, stdout, stderr) = self.ssh.exec_command( - 'source ~/env_file && export OS_INTERFACE=public &&' - 'shaker --server-endpoint {}:9000 --scenario ' - 'openstack/full_l2,openstack/full_l3_east_west,' - 'openstack/full_l3_north_south,openstack/perf_l2,' - 'openstack/perf_l3_east_west,openstack/perf_l3_north_south ' + 'source ~/env_file && ' + 'export OS_INTERFACE=public && ' + 'export OS_AUTH_URL={} && ' + 'export OS_USERNAME={} && ' + 'export OS_PROJECT_NAME={} && ' + 'export OS_PASSWORD={} && ' + 'env && ' + 'shaker --image-name {} --flavor-name {} ' + '--server-endpoint {}:9000 --scenario ' + 'openstack/full_l2,' + 'openstack/full_l3_east_west,' + 'openstack/full_l3_north_south,' + 'openstack/perf_l3_north_south ' '--report report.html --output report.json'.format( - self.sshvm.public_v4)) + endpoint, self.project.user.name, self.project.project.name, + self.project.password, self.image.name, self.flavor.name, + self.fip.floating_ip_address)) self.__logger.info("output:\n%s", stdout.read()) self.__logger.info("error:\n%s", stderr.read()) if not os.path.exists(self.res_dir): |