Bugfix: fix query job status in TC074 45/33045/1
authorJingLu5 <lvjing5@huawei.com>
Wed, 5 Apr 2017 06:11:16 +0000 (06:11 +0000)
committerJing Lu <lvjing5@huawei.com>
Thu, 6 Apr 2017 07:19:35 +0000 (07:19 +0000)
JIRA: YARDSTICK-621
The storperf job status query in TC074 didn' work properly. The cause is the
"type: status" is not passed in the URL. This patch also update storperf VM
image to xenial.

Change-Id: Idd9f501416b24612f6045a57ba2a95e2ed3a9572
Signed-off-by: JingLu5 <lvjing5@huawei.com>
(cherry picked from commit b2fb23ca8ccc1acedaa9156552af4ba347f24103)

docker/Dockerfile
docs/testing/user/userguide/04-installation.rst
samples/storperf.yaml
tests/ci/clean_images.sh
tests/ci/load_images.sh
tests/opnfv/test_cases/opnfv_yardstick_tc074.yaml
tests/unit/benchmark/scenarios/storage/test_storperf.py
yardstick/benchmark/scenarios/storage/storperf.py

index 3be28e4..52a15df 100644 (file)
@@ -38,7 +38,7 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf
 EXPOSE 5000
 
 ADD http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img ${IMAGE_DIR}
-ADD http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img ${IMAGE_DIR}
+ADD http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img ${IMAGE_DIR}
 
 COPY ./exec_tests.sh /usr/local/bin/
 
index 7ea40ed..c1325ca 100644 (file)
@@ -212,9 +212,9 @@ The created image can be added to OpenStack using the ``glance image-create`` or
   --file /tmp/workspace/yardstick/yardstick-image.img
 
 .. _`Cirros 0.3.5`: http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
-.. _`Ubuntu 14.04`: https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
+.. _`Ubuntu 16.04`: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img
 
-Some Yardstick test cases use a `Cirros 0.3.5`_ image and/or a `Ubuntu 14.04`_ image. Add Cirros and Ubuntu images to OpenStack::
+Some Yardstick test cases use a `Cirros 0.3.5`_ image and/or a `Ubuntu 16.04`_ image. Add Cirros and Ubuntu images to OpenStack::
 
   openstack image create \
       --disk-format qcow2 \
@@ -226,7 +226,7 @@ Some Yardstick test cases use a `Cirros 0.3.5`_ image and/or a `Ubuntu 14.04`_ i
       --disk-format qcow2 \
       --container-format bare \
       --file $ubuntu_image_file \
-      Ubuntu-14.04
+      Ubuntu-16.04
 
 
 The third way
index d8641fc..5000759 100644 (file)
@@ -17,7 +17,7 @@ scenarios:
   type: StorPerf
   options:
     agent_count: 1
-    agent_image: "Ubuntu-14.04"
+    agent_image: "Ubuntu-16.04"
     public_network: "ext-net"
     volume_size: 2
     # target:
index 9e5e61e..27da9e2 100755 (executable)
@@ -19,7 +19,7 @@ cleanup()
         return
     fi
 
-    for image in $(openstack image list | grep -e cirros-0.3.5 -e yardstick-image -e Ubuntu-14.04 \
+    for image in $(openstack image list | grep -e cirros-0.3.5 -e yardstick-image -e Ubuntu-16.04 \
         | awk '{print $2}'); do
         echo "Deleting image $image..."
         openstack image delete $image || true
index 8521441..b9a9eea 100755 (executable)
@@ -193,7 +193,7 @@ load_ubuntu_image()
     echo
     echo "========== Loading ubuntu cloud image =========="
 
-    local ubuntu_image_file=/home/opnfv/images/trusty-server-cloudimg-amd64-disk1.img
+    local ubuntu_image_file=/home/opnfv/images/xenial-server-cloudimg-amd64-disk1.img
 
     EXTRA_PARAMS=""
     # VPP requires guest memory to be backed by large pages
index 14604f8..326fdf5 100644 (file)
@@ -20,7 +20,7 @@ scenarios:
   type: StorPerf
   options:
     agent_count: 1
-    agent_image: "Ubuntu-14.04"
+    agent_image: "Ubuntu-16.04"
     public_network: {{public_network}}
     volume_size: 4
     block_sizes: "4096"
index adc9d47..00054d5 100644 (file)
@@ -55,7 +55,7 @@ def mocked_requests_job_get(*args, **kwargs):
             self.status_code = status_code
 
     return MockResponseJobGet(
-        '{"status": "completed",\
+        '{"Status": "Completed",\
          "_ssd_preconditioning.queue-depth.8.block-size.16384.duration": 6}',
         200)
 
@@ -171,7 +171,7 @@ class StorPerfTestCase(unittest.TestCase):
         s = storperf.StorPerf(args, self.ctx)
         s.setup_done = True
 
-        sample_output = '{"status": "completed",\
+        sample_output = '{"Status": "Completed",\
          "_ssd_preconditioning.queue-depth.8.block-size.16384.duration": 6}'
 
         expected_result = jsonutils.loads(sample_output)
index 6ea0351..672cfab 100644 (file)
@@ -117,7 +117,8 @@ class StorPerf(base.Scenario):
         """Query the status of the supplied job_id and report on metrics"""
         LOG.info("Fetching report for %s...", job_id)
         report_res = requests.get('http://{}:5000/api/v1.0/jobs'.format
-                                  (self.target), params={'id': job_id})
+                                  (self.target),
+                                  params={'id': job_id, 'type': 'status'})
 
         report_res_content = jsonutils.loads(
             report_res.content)
@@ -126,10 +127,10 @@ class StorPerf(base.Scenario):
             raise RuntimeError("Failed to fetch report, error message:",
                                report_res_content["message"])
         else:
-            job_status = report_res_content["status"]
+            job_status = report_res_content["Status"]
 
         LOG.debug("Job is: %s...", job_status)
-        self.job_completed = job_status == "completed"
+        self.job_completed = job_status == "Completed"
 
         # TODO: Support using StorPerf ReST API to read Job ETA.