Add a patch to set ha SLA to be 30 seconds 51/41251/2
authorxudan <xudan16@huawei.com>
Thu, 7 Sep 2017 01:49:26 +0000 (21:49 -0400)
committerxudan <xudan16@huawei.com>
Thu, 7 Sep 2017 01:55:25 +0000 (21:55 -0400)
1. According to ha test specification doc, the SLA of process recover time
   is 30 seconds.
2. However, the SLA in Yardstick test cases are all 20 seconds.
3. Add a patch to change the SLA in yardstick test cases.

JIRA: DOVETAIL-496

Change-Id: Ib8f229fdfbb3289bf70d6ee900132b3db3a21b17
Signed-off-by: xudan <xudan16@huawei.com>
dovetail/conf/yardstick_config.yml
dovetail/patch/0001-Adjust-Yardstick-HA-test-cases-SLA.patch [new file with mode: 0644]
dovetail/run.py

index 62a4abf..f49d044 100644 (file)
@@ -6,11 +6,17 @@ yardstick:
   config:
     dir: '/home/opnfv/userconfig'
   pre_condition:
-    - ''
     # - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
     #     source tests/ci/clean_images.sh && cleanup'
     # - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
     #     source tests/ci/load_images.sh'
+    # Copy Yardstick bugfix patches to Yardstick repository
+    - "cp -r /home/opnfv/userconfig/patch/ /home/opnfv/repos/yardstick/"
+    # Config git user info for applying bugfix patches
+    - "cd /home/opnfv/repos/yardstick && git config --global user.email 'you@example.com'"
+    - "cd /home/opnfv/repos/yardstick && git config --global user.name 'Your Name'"
+    # Apply all bugfix patchs on tempest code
+    - "cd /home/opnfv/repos/yardstick && git am ./patch/*.patch"
   cmds:
     - 'mkdir -p /home/opnfv/yardstick/results/'
     - "cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
diff --git a/dovetail/patch/0001-Adjust-Yardstick-HA-test-cases-SLA.patch b/dovetail/patch/0001-Adjust-Yardstick-HA-test-cases-SLA.patch
new file mode 100644 (file)
index 0000000..92c6803
--- /dev/null
@@ -0,0 +1,119 @@
+From 3beb6cdffa830f009d246e6352efa7ccf70463a0 Mon Sep 17 00:00:00 2001
+From: Jing Lu <hanazawarei@icloud.com>
+Date: Sat, 26 Aug 2017 10:07:52 +0800
+Subject: [PATCH] Adjust Yardstick HA test cases SLA
+
+---
+ tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml | 4 ++--
+ tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml | 4 ++--
+ tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml | 4 ++--
+ tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml | 4 ++--
+ tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml | 4 ++--
+ tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml | 4 ++--
+ 6 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml
+index 5d3057d..c1d3645 100644
+--- a/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml
++++ b/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml
+@@ -34,10 +34,10 @@ scenarios:
+     - monitor_type: "process"
+       process_name: "nova-api"
+       host: node1
+-      monitor_time: 20
++      monitor_time: 30
+       monitor_number: 3
+       sla:
+-        max_recover_time: 20
++        max_recover_time: 30
+
+   nodes:
+     node1: node1.LF
+diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
+index d851d5a..8c7348b 100644
+--- a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
++++ b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
+@@ -33,10 +33,10 @@ scenarios:
+     - monitor_type: "process"
+       process_name: "neutron-server"
+       host: node1
+-      monitor_time: 20
++      monitor_time: 30
+       monitor_number: 3
+       sla:
+-        max_recover_time: 20
++        max_recover_time: 30
+
+   nodes:
+     node1: node1.LF
+diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
+index ad81a14..635e4d9 100644
+--- a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
++++ b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
+@@ -33,10 +33,10 @@ scenarios:
+     - monitor_type: "process"
+       process_name: "keystone"
+       host: node1
+-      monitor_time: 20
++      monitor_time: 30
+       monitor_number: 3
+       sla:
+-        max_recover_time: 20
++        max_recover_time: 30
+
+   nodes:
+     node1: node1.LF
+diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
+index cc99036..57fa739 100644
+--- a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
++++ b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
+@@ -33,10 +33,10 @@ scenarios:
+     - monitor_type: "process"
+       process_name: "glance-api"
+       host: node1
+-      monitor_time: 20
++      monitor_time: 30
+       monitor_number: 3
+       sla:
+-        max_recover_time: 20
++        max_recover_time: 30
+
+   nodes:
+     node1: node1.LF
+diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
+index 237f845..06ad641 100644
+--- a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
++++ b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
+@@ -33,10 +33,10 @@ scenarios:
+     - monitor_type: "process"
+       process_name: "cinder-api"
+       host: node1
+-      monitor_time: 20
++      monitor_time: 30
+       monitor_number: 3
+       sla:
+-        max_recover_time: 20
++        max_recover_time: 30
+
+   nodes:
+     node1: node1.LF
+diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml
+index 9e05cc8..e3f0934 100644
+--- a/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml
++++ b/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml
+@@ -32,10 +32,10 @@ scenarios:
+           key: "service-status"
+           process_name: "haproxy"
+           host: node1
+-          monitor_time: 20
++          monitor_time: 30
+           monitor_number: 3
+           sla:
+-            max_recover_time: 20
++            max_recover_time: 30
+
+         -
+           monitor_type: "openstack-cmd"
+--
+2.13.1 (Apple Git-89)
+
index 01111dd..1133b86 100755 (executable)
@@ -203,7 +203,9 @@ def get_result_path():
     result_path = os.path.join(dovetail_home, 'results')
     dt_cfg.dovetail_config['result_dir'] = result_path
     pre_config_path = os.path.join(dovetail_home, 'pre_config')
+    patch_set_path = os.path.join(dovetail_home, 'patch')
     dt_cfg.dovetail_config['config_dir'] = pre_config_path
+    dt_cfg.dovetail_config['patch_dir'] = patch_set_path
     return dovetail_home
 
 
@@ -217,6 +219,16 @@ def copy_userconfig_files(logger):
     dt_utils.exec_cmd(cmd, logger, exit_on_error=False)
 
 
+def copy_patch_files(logger):
+    dovetail_home = os.path.dirname(os.path.abspath(__file__))
+    patch_path = os.path.join(dovetail_home, 'patch')
+    patch_set_path = dt_cfg.dovetail_config['patch_dir']
+    if not os.path.isdir(patch_set_path):
+        os.makedirs(patch_set_path)
+    cmd = 'sudo cp -r %s/* %s' % (patch_path, patch_set_path)
+    dt_utils.exec_cmd(cmd, logger, exit_on_error=False)
+
+
 # env_init can source some env variable used in dovetail, such as
 # when https+credential used, OS_CACERT
 def env_init(logger):
@@ -244,6 +256,7 @@ def main(*args, **kwargs):
     logger.info('Build tag: {}'.format(dt_cfg.dovetail_config['build_tag']))
     env_init(logger)
     copy_userconfig_files(logger)
+    copy_patch_files(logger)
     dt_utils.check_docker_version(logger)
     validate_input(kwargs, dt_cfg.dovetail_config['validate_input'], logger)
     configs = filter_config(kwargs, logger)