]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fixed some bugs and verification to tests
authorrakesh <rakesh@dhcp35-53.lab.eng.blr.redhat.com>
Mon, 20 Nov 2017 09:45:01 +0000 (15:15 +0530)
committerrakesh <rakesh@dhcp35-53.lab.eng.blr.redhat.com>
Mon, 20 Nov 2017 09:45:01 +0000 (15:15 +0530)
qa/tasks/multisite_rgw_system_test.py

index 4e0e3fa94f936ed26e1fc968fea710a92f29c757..fa0e02571eb8c504fa84342021f490cfbe4823a7 100644 (file)
@@ -22,7 +22,9 @@ class Test(object):
 
         log.info('Create user on master client')
 
-        temp_yaml_file = 'user_create.yaml'
+        temp_yaml_file = 'user_create_' + str(os.getpid()) + pwd.getpwuid(os.getuid()).pw_name
+
+#        temp_yaml_file = 'user_create.yaml'
 
         if self.user_data is None:
             assert isinstance(self.user_data, dict), "configuration not given"
@@ -43,7 +45,7 @@ class Test(object):
         mclient.run(args=['cat',
                              'rgw-tests/ceph-qe-scripts/rgw/tests/multisite/yamls/' + temp_yaml_file])
 
-        mclient.run(args=['sudo', 'rm', '-f', run.Raw('%s' % local_file)], check_status=False)
+#        mclient.run(args=['sudo', 'rm', '-f', run.Raw('%s' % local_file)], check_status=False)
 
         mclient.run(
             args=[
@@ -55,6 +57,8 @@ class Test(object):
 
         self.user_file = mclient.get_file('user_details', '/tmp')
 
+#        os.unlink(local_file)
+
     def target_execution(self, mclient, tclient):
 
         log.info('test: %s' % self.script_fname)
@@ -94,6 +98,15 @@ class Test(object):
                     '-c rgw-tests/ceph-qe-scripts/rgw/tests/multisite/yamls/%s ' % (self.script_fname, self.yaml_fname))])
 
 
+def copy_file_from(src_node, dest_node, file_name = 'io_info.yaml'):
+
+    # copies to /tmp dir and then puts it in destination machines
+
+    io_info_file = src_node.get_file(file_name, '/tmp')
+
+    dest_node.put_file(io_info_file, file_name)
+
+
 def test_exec(ctx, config, user_data, data, tclient, mclient):
 
     assert data is not None, "Got no test in configuration"
@@ -109,6 +122,24 @@ def test_exec(ctx, config, user_data, data, tclient, mclient):
     time.sleep(20)
     test.target_execution(mclient, tclient)
 
+    # copy the io_yaml from from target node to master node.
+
+    time.sleep(60)
+    # wait for sync
+
+    if not 'acls' in script_name:
+
+        # no verification is being done for acls test cases right now.
+
+        copy_file_from(tclient, mclient)
+
+        # start verify of io on master node.
+
+        mclient.run(
+            args=[
+                run.Raw(
+                    'sudo venv/bin/python2.7 rgw-tests/ceph-qe-scripts/rgw/lib/read_io_info.py')])
+
 
 @contextlib.contextmanager
 def task(ctx, config):
@@ -314,6 +345,8 @@ def task(ctx, config):
                 'git',
                 'clone',
                 'http://gitlab.osas.lab.eng.rdu2.redhat.com/ceph/ceph-qe-scripts.git',
+                '-b',
+                'multisite-debugging'
                 ])
 
         remote.run(args=['virtualenv', 'venv'])
@@ -359,6 +392,7 @@ def task(ctx, config):
             )
         )
 
+
     if config['test-name'] == 'test_Mbuckets_with_Nobjects':
 
         data = dict(
@@ -532,6 +566,7 @@ def task(ctx, config):
 
         data = dict(
             config=dict(
+                bucket_count=test_config['bucket_count'],
                 objects_count=test_config['objects_count'],
                 objects_size_range=dict(
                     min=test_config['min_file_size'],
@@ -559,7 +594,6 @@ def task(ctx, config):
         data = dict(
             config=dict(
                 bucket_count=test_config['bucket_count'],
-                user_count=test_config['user_count'],
                 objects_size_range=dict(
                     min=test_config['min_file_size'],
                     max=test_config['max_file_size']
@@ -574,18 +608,25 @@ def task(ctx, config):
         yield
     finally:
 
-        remote.run(
-            args=[
-                'source',
-                'venv/bin/activate',
-                run.Raw(';'),
-                run.Raw('pip uninstall boto names PyYaml -y'),
-                run.Raw(';'),
-                'deactivate'])
+        remotes = ctx.cluster.only(teuthology.is_type('client'))
+        for remote, roles_for_host in remotes.remotes.iteritems():
+
+            remote.run(
+                args=[
+                    'source',
+                    'venv/bin/activate',
+                    run.Raw(';'),
+                    run.Raw('pip uninstall boto names PyYaml -y'),
+                    run.Raw(';'),
+                    'deactivate'])
+
+            log.info('test completed')
+
+            log.info("Deleting repos")
 
-        log.info('test completed')
+            cleanup = lambda x: remote.run(args=[run.Raw('sudo rm -rf %s' % x)])
 
-        log.info("Deleting repos")
+            soot = ['venv', 'rgw-tests', '*.json', 'Download.*', 'Download', '*.mpFile', 'x*', 'key.*', 'Mp.*',
+                    '*.key.*', 'user_details', 'io_info.yaml']
 
-        remote.run(args=[run.Raw(
-            'sudo rm -rf venv rgw-tests *.json Download.* Download *.mpFile  x* key.*  Mp.* *.key.*')])
+            map(cleanup, soot)
\ No newline at end of file