summaryrefslogtreecommitdiff
diff options
-rw-r--r--.bumpversion.cfg2
-rwxr-xr-xbin/cpuid.py5
-rwxr-xr-xbin/disk_read_performance_test2
-rwxr-xr-xbin/ipmi_test61
-rwxr-xr-xbin/snap_tests.py15
-rwxr-xr-xbin/storage_test.py2
-rwxr-xr-xbin/wwan_tests.py4
-rwxr-xr-xmanage.py2
-rw-r--r--units/wwan/resource.pxu2
9 files changed, 65 insertions, 30 deletions
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 57cb806..9567a8e 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 0.51.0.dev0
+current_version = 0.52.0.dev0
files = manage.py
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?((?P<release>\.?[a-z]+)(?P<N>\d+))?
serialize =
diff --git a/bin/cpuid.py b/bin/cpuid.py
index fcb6e0c..d0cdea9 100755
--- a/bin/cpuid.py
+++ b/bin/cpuid.py
@@ -78,12 +78,13 @@ is_64bit = ctypes.sizeof(ctypes.c_voidp) == 8
CPUIDS = {
"Amber Lake": ['0x806e9'],
"AMD EPYC": ['0x800f12'],
- "AMD Opteron 6100": ['0x100f91'],
+ "AMD Lisbon": ['0x100f81'],
+ "AMD Magny-Cours": ['0x100f91'],
"AMD ROME": ['0x830f10'],
"Broadwell": ['0x4067', '0x306d4', '0x5066', '0x406f'],
"Canon Lake": ['0x6066'],
"Cascade Lake": ['0x50655', '0x50656', '0x50657'],
- "Coffee Lake": ['0x806ea', '0x906e'],
+ "Coffee Lake": ['0x806ea', '0x906ea', '0x906eb', '0x906ec', '0x906ed'],
"Haswell": ['0x306c', '0x4065', '0x4066', '0x306f'],
"Ice Lake": ['0x706e'],
"Ivy Bridge": ['0x306a', '0x306e'],
diff --git a/bin/disk_read_performance_test b/bin/disk_read_performance_test
index fec27c2..8d6d6a0 100755
--- a/bin/disk_read_performance_test
+++ b/bin/disk_read_performance_test
@@ -49,7 +49,7 @@ for disk in $@; do
"ide" ) MIN_BUF_READ=40;;
"mmc" ) MIN_BUF_READ=$DEFAULT_BUF_READ;;
"nvme" ) MIN_BUF_READ=200;;
- "mdadm" ) MIN_BUF_READ=500;;
+ "mdadm" ) MIN_BUF_READ=80;;
* ) MIN_BUF_READ=$DEFAULT_BUF_READ;;
esac
echo "INFO: $disk_type: Using $MIN_BUF_READ MB/sec as the minimum throughput speed"
diff --git a/bin/ipmi_test b/bin/ipmi_test
index 12ca42c..74a320b 100755
--- a/bin/ipmi_test
+++ b/bin/ipmi_test
@@ -1,6 +1,8 @@
#!/bin/bash
# Now make sure the modules are loaded
+
+echo '---------------------------------' && echo 'Verifying kernel modules:' && echo
for module in ipmi_si ipmi_devintf ipmi_powernv ipmi_ssif ipmi_msghandler; do
if lsmod |grep -q $module; then
echo "$module already loaded"
@@ -23,37 +25,60 @@ for module in ipmi_si ipmi_devintf ipmi_powernv ipmi_ssif ipmi_msghandler; do
fi
done
-# Now get our info from ipmitool to make sure communication works
-# First lest check chassis status
-echo
-echo "Checking for chassis status"
-ipmitool chassis status && echo "Successfully got chassis status" && chassis=0 || chassis=1
-echo "Checking to see if we can get power status"
-ipmitool power status && echo "Successfully got power status" && power=0 || power=1
+# Now get our info from FreeIPMI to make sure communication works
+# First lets check chassis status
+
+echo '---------------------------------' && echo "Fetching chassis status:" && echo
+(ipmi-chassis --get-status) && echo && echo "Successfully fetched chassis status..." && chassis=0 \
+ || chassis=1
+
+
+echo '---------------------------------' && echo "Fetching power status:" && echo
+(ipmi-chassis --get-status | grep 'System Power') && echo \
+ && echo "Successfully fetched power status.." && power=0 || power=1
-echo "Checking to see if we can get user data"
+
+echo '---------------------------------' && echo "Fetching IPMI channel user data:" && echo
# LP:1794926 Find the active channel. blindly calling user list sometimes
# fails.
channel=99
for x in 0 1 2 3 4 5 6 7 8 9 10 11 14 15; do
- if ipmitool channel getaccess $x 2>1 >/dev/null; then
+ if !(ipmi-config --checkout --lan-channel-number $x 2>&1 >/dev/null | grep -q '^Unable to get Number of Users$'); then
channel=$x
- echo "Channel in use appears to be $channel"
+ echo "IPMI channel: $channel" && echo
break
fi
done
-if [ $channel -lt 99 ]; then
- ipmitool user list $channel && echo "Successfully got user data" && user=0 || user=1
-else
- user=1
-fi
-echo "Checking to see if we can get info on the BMC"
-ipmitool bmc info && echo "Successfully got BMC information" && bmc=0 || bmc=1
+# Extrapolate user list from general IPMI function
+(ipmi-config --checkout --category=core | grep -A 19 "User[0-9]*.$" | sed '/#/d' | grep -v "Section$" | sed 's/Section //') \
+ && echo && echo "Successfully fetched IPMI channel & user data..." && user=0 || user=1
+
+
+echo '---------------------------------' && echo "Fetching BMC information and checking IPMI version:" && echo
+bmc-info && echo && echo "Successfully called BMC-info..." && echo && bmc=0 || bmc=1
+
+version=$(bmc-info | awk '/IPMI Version/ {print $4}')
+echo "IPMI Version: $version" && echo
+# parse major from ipmi version
+version=$(echo $version| cut -d'.' -f1)
+# can refactor to evaluate in final check function
+if [ $version -lt 2 ]; then
+ ipmiV=1 && echo "IPMI version below 2.0..."
+ else
+ ipmiV=0 && echo "IPMI version OK..."
+ fi
+
+
+echo '---------------------------------' && echo "Calling IPMI-locate" && echo
+(ipmi-locate) && echo "Successfully called ipmi-locate..." && ipmiL=0 || ipmiL=1
+
# if everything passes, exit 0
-[ $chassis -eq 0 ] && [ $power -eq 0 ] && [ $user -eq 0 ] && [ $bmc -eq 0 ] && exit 0 || echo "FAILURE: chassis: $chassis power: $power user: $user bmc: $bmc"
+[ $chassis -eq 0 ] && [ $power -eq 0 ] && [ $user -eq 0 ] && [ $bmc -eq 0 ] && [ $ipmiV -eq 0 ] && [ $ipmiL -eq 0 ] \
+ && echo "## IPMI checks succeeded. ##" && echo && exit 0 \
+ || echo "## FAILURE: chassis: $chassis power: $power user: $user bmc: $bmc ipmi_version: $ipmiV ipmi_locate: $ipmiL ##"
# otherwise exit 1
exit 1
diff --git a/bin/snap_tests.py b/bin/snap_tests.py
index f548db8..fe80288 100755
--- a/bin/snap_tests.py
+++ b/bin/snap_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# Copyright 2015-2019 Canonical Ltd.
+# Copyright 2015-2020 Canonical Ltd.
# All rights reserved.
#
# Written by:
@@ -15,7 +15,16 @@ from checkbox_support.snap_utils.snapd import Snapd
# - the snap must not be installed at the start of the nested test plan
# - the snap must be strictly confined (no classic or devmode flags)
# - there must be different revisions on the stable & edge channels
-TEST_SNAP = os.getenv('TEST_SNAP', 'test-snapd-tools')
+try:
+ TEST_SNAP = os.environ['TEST_SNAP']
+except KeyError:
+ runtime = os.getenv('CHECKBOX_RUNTIME', '/snap/checkbox/current')
+ if 'checkbox18' in runtime:
+ TEST_SNAP = 'test-snapd-tools-core18'
+ elif 'checkbox20' in runtime:
+ TEST_SNAP = 'test-snapd-tools-core20'
+ else:
+ TEST_SNAP = 'test-snapd-tools'
SNAPD_TASK_TIMEOUT = int(os.getenv('SNAPD_TASK_TIMEOUT', 30))
SNAPD_POLL_INTERVAL = int(os.getenv('SNAPD_POLL_INTERVAL', 1))
@@ -60,7 +69,7 @@ class SnapInstall():
parser.add_argument('channel', help='channel to install from')
args = parser.parse_args(sys.argv[2:])
print('Install {}...'.format(TEST_SNAP))
- s = Snapd(SNAPD_TASK_TIMEOUT, SNAPD_POLL_INTERVAL)
+ s = Snapd(SNAPD_TASK_TIMEOUT, SNAPD_POLL_INTERVAL, verbose=True)
s.install(TEST_SNAP, args.channel)
print('Confirm in snap list...')
data = s.list()
diff --git a/bin/storage_test.py b/bin/storage_test.py
index 4f363bc..1481a0d 100755
--- a/bin/storage_test.py
+++ b/bin/storage_test.py
@@ -30,7 +30,7 @@ def find_largest_partition(device):
out = sp.check_output(cmd, shell=True)
blk_devs = [BlkDev(*p.strip().split())
for p in out.decode(sys.stdout.encoding).splitlines()]
- blk_devs[:] = [bd for bd in blk_devs if bd.type == 'part']
+ blk_devs[:] = [bd for bd in blk_devs if bd.type in ('part', 'md')]
if not blk_devs:
raise SystemExit(
'ERROR: No partitions found on device {}'.format(device))
diff --git a/bin/wwan_tests.py b/bin/wwan_tests.py
index c19c547..df44cf6 100755
--- a/bin/wwan_tests.py
+++ b/bin/wwan_tests.py
@@ -261,7 +261,7 @@ def _ping_test(if_name):
class ThreeGppConnection():
- def invoked(self, ctx):
+ def invoked(self):
parser = argparse.ArgumentParser()
parser.add_argument('wwan_control_if', type=str,
help='The control interface for the device')
@@ -274,7 +274,7 @@ class ThreeGppConnection():
args = parser.parse_args(sys.argv[2:])
ret_code = 1
try:
- _create_3gpp_connection(ctx.args.wwan_control_if, args.apn)
+ _create_3gpp_connection(args.wwan_control_if, args.apn)
_wwan_radio_on()
time.sleep(args.wwan_setup_time)
ret_code = _ping_test(args.wwan_net_if)
diff --git a/manage.py b/manage.py
index 3311935..040d24a 100755
--- a/manage.py
+++ b/manage.py
@@ -5,7 +5,7 @@ from plainbox.provider_manager import N_
setup(
name='plainbox-provider-checkbox',
namespace='com.canonical.certification',
- version="0.51.0.dev0",
+ version="0.52.0.dev0",
description=N_("Checkbox provider"),
gettext_domain='plainbox-provider-checkbox',
strict=False, deprecated=False,
diff --git a/units/wwan/resource.pxu b/units/wwan/resource.pxu
index 0197f15..7489583 100644
--- a/units/wwan/resource.pxu
+++ b/units/wwan/resource.pxu
@@ -11,7 +11,7 @@ category_id: wwan
plugin: resource
_summary: Gather device info about WWAN modems
_description: Gather device info about WWAN modems
-command: wwan_tests.py --use-cli resources
+command: wwan_tests.py resources
user: root
estimated_duration: 3s
flags: preserve-locale