aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/ci/load_images.sh44
-rw-r--r--tests/unit/dispatcher/test_influxdb.py14
2 files changed, 35 insertions, 23 deletions
diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh
index 6f950ec72..e5a7ae034 100755
--- a/tests/ci/load_images.sh
+++ b/tests/ci/load_images.sh
@@ -15,6 +15,12 @@ set -e
YARD_IMG_ARCH=amd64
export YARD_IMG_ARCH
+HW_FW_TYPE=""
+if [ "${YARD_IMG_ARCH}" = "arm64" ]; then
+ HW_FW_TYPE=uefi
+fi
+export HW_FW_TYPE
+
if ! grep -q "Defaults env_keep += \"YARD_IMG_ARCH\"" "/etc/sudoers"; then
sudo echo "Defaults env_keep += \"YARD_IMG_ARCH YARDSTICK_REPO_DIR\"" >> /etc/sudoers
fi
@@ -25,10 +31,10 @@ if [ "$INSTALLER_TYPE" == "fuel" ]; then
fi
UCA_HOST="cloud-images.ubuntu.com"
-if [ $YARD_IMG_ARCH = "arm64" ]; then
- export VIVID_IMG_URL="http://${UCA_HOST}/vivid/current/vivid-server-cloudimg-arm64.tar.gz"
- if ! grep -q "Defaults env_keep += \"VIVID_IMG_URL\"" "/etc/sudoers"; then
- sudo echo "Defaults env_keep += \"VIVID_IMG_URL\"" >> /etc/sudoers
+if [ "${YARD_IMG_ARCH}"= "arm64" ]; then
+ export CLOUD_IMG_URL="http://${UCA_HOST}/${release}/current/${release}-server-cloudimg-${YARD_IMG_ARCH}.tar.gz"
+ if ! grep -q "Defaults env_keep += \"CLOUD_IMG_URL\"" "/etc/sudoers"; then
+ sudo echo "Defaults env_keep += \"CLOUD_IMG_URL\"" >> /etc/sudoers
fi
fi
@@ -65,24 +71,24 @@ load_yardstick_image()
echo
echo "========== Loading yardstick cloud image =========="
EXTRA_PARAMS=""
- if [ $YARD_IMG_ARCH = "arm64" ]; then
- VIVID_IMAGE="/tmp/vivid-server-cloudimg-arm64.tar.gz"
- VIVID_KERNEL="/tmp/vivid-server-cloudimg-arm64-vmlinuz-generic"
+ if [[ "${YARD_IMG_ARCH}" = "arm64" && "${YARD_IMG_AKI}" = "true" ]]; then
+ CLOUD_IMAGE="/tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}.tar.gz"
+ CLOUD_KERNEL="/tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}-vmlinuz-generic"
cd /tmp
- if [ ! -f $VIVID_IMAGE ]; then
- wget $VIVID_IMG_URL
+ if [ ! -f "${CLOUD_IMAGE}" ]; then
+ wget $CLOUD_IMG_URL
fi
- if [ ! -f $VIVID_KERNEL ]; then
- tar zxf $VIVID_IMAGE $(basename $VIVID_KERNEL)
+ if [ ! -f "${CLOUD_KERNEL}" ]; then
+ tar zxf $CLOUD_IMAGE $(basename $CLOUD_KERNEL)
fi
- create_vivid_kernel=$(openstack image create \
+ create_kernel=$(openstack image create \
--public \
--disk-format qcow2 \
--container-format bare \
- --file $VIVID_KERNEL \
- yardstick-vivid-kernel)
+ --file $CLOUD_KERNEL \
+ yardstick-${release}-kernel)
- GLANCE_KERNEL_ID=$(echo "$create_vivid_kernel" | grep " id " | awk '{print $(NF-1)}')
+ GLANCE_KERNEL_ID=$(echo "$create_kernel" | grep " id " | awk '{print $(NF-1)}')
if [ -z "$GLANCE_KERNEL_ID" ]; then
echo 'Failed uploading kernel to cloud'.
exit 1
@@ -92,7 +98,7 @@ load_yardstick_image()
EXTRA_PARAMS="--property kernel_id=$GLANCE_KERNEL_ID --property os_command_line=\"$command_line\""
- rm -f $VIVID_KERNEL $VIVID_IMAGE
+ rm -f $CLOUD_KERNEL $CLOUD_IMAGE
cd $YARDSTICK_REPO_DIR
fi
@@ -101,6 +107,10 @@ load_yardstick_image()
EXTRA_PARAMS=$EXTRA_PARAMS" --property hw_mem_page_size=large"
fi
+ if [[ -n "${HW_FW_TYPE}" ]]; then
+ EXTRA_PARAMS=$EXTRA_PARAMS" --property hw_firmware_type=${HW_FW_TYPE}"
+ fi
+
if [[ "$DEPLOY_SCENARIO" == *"-lxd-"* ]]; then
output=$(eval openstack image create \
--public \
@@ -223,7 +233,7 @@ main()
build_yardstick_image
load_yardstick_image
- if [ $YARD_IMG_ARCH = "arm64" ]; then
+ if [ "${YARD_IMG_ARCH}" = "arm64" ]; then
sed -i 's/image: cirros-0.3.3/image: TestVM/g' tests/opnfv/test_cases/opnfv_yardstick_tc002.yaml \
samples/ping.yaml
#We have overlapping IP with the real network
diff --git a/tests/unit/dispatcher/test_influxdb.py b/tests/unit/dispatcher/test_influxdb.py
index b84389e7e..0c7b58135 100644
--- a/tests/unit/dispatcher/test_influxdb.py
+++ b/tests/unit/dispatcher/test_influxdb.py
@@ -90,19 +90,21 @@ class InfluxdbDispatcherTestCase(unittest.TestCase):
}
}
+ self.yardstick_conf = {'yardstick': {}}
+
def test_record_result_data_no_target(self):
- influxdb = InfluxdbDispatcher(None)
+ influxdb = InfluxdbDispatcher(None, self.yardstick_conf)
influxdb.target = ''
self.assertEqual(influxdb.record_result_data(self.data1), -1)
def test_record_result_data_no_case_name(self):
- influxdb = InfluxdbDispatcher(None)
+ influxdb = InfluxdbDispatcher(None, self.yardstick_conf)
self.assertEqual(influxdb.record_result_data(self.data2), -1)
@mock.patch('yardstick.dispatcher.influxdb.requests')
def test_record_result_data(self, mock_requests):
type(mock_requests.post.return_value).status_code = 204
- influxdb = InfluxdbDispatcher(None)
+ influxdb = InfluxdbDispatcher(None, self.yardstick_conf)
self.assertEqual(influxdb.record_result_data(self.data1), 0)
self.assertEqual(influxdb.record_result_data(self.data2), 0)
self.assertEqual(influxdb.flush_result_data(), 0)
@@ -112,7 +114,7 @@ class InfluxdbDispatcherTestCase(unittest.TestCase):
'mpstat.cpu0.%idle=99.00,mpstat.cpu0.%sys=0.00'
# need to sort for assert to work
line = ",".join(sorted(line.split(',')))
- influxdb = InfluxdbDispatcher(None)
+ influxdb = InfluxdbDispatcher(None, self.yardstick_conf)
flattened_data = influxdb._dict_key_flatten(
self.data3['benchmark']['data'])
result = ",".join(
@@ -120,7 +122,7 @@ class InfluxdbDispatcherTestCase(unittest.TestCase):
self.assertEqual(result, line)
def test__get_nano_timestamp(self):
- influxdb = InfluxdbDispatcher(None)
+ influxdb = InfluxdbDispatcher(None, self.yardstick_conf)
results = {'benchmark': {'timestamp': '1451461248.925574'}}
self.assertEqual(influxdb._get_nano_timestamp(results),
'1451461248925574144')
@@ -128,7 +130,7 @@ class InfluxdbDispatcherTestCase(unittest.TestCase):
@mock.patch('yardstick.dispatcher.influxdb.time')
def test__get_nano_timestamp_except(self, mock_time):
results = {}
- influxdb = InfluxdbDispatcher(None)
+ influxdb = InfluxdbDispatcher(None, self.yardstick_conf)
mock_time.time.return_value = 1451461248.925574
self.assertEqual(influxdb._get_nano_timestamp(results),
'1451461248925574144')