summaryrefslogtreecommitdiff
diff options
-rw-r--r--.bumpversion.cfg2
-rwxr-xr-xbin/disk_stress_ng8
-rwxr-xr-xbin/memory_stress_ng19
-rwxr-xr-xbin/network30
-rwxr-xr-xmanage.py2
5 files changed, 46 insertions, 15 deletions
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index aec6c1a..6339998 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 0.35.0.dev0
+current_version = 0.36.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/disk_stress_ng b/bin/disk_stress_ng
index a47ab79..de96f46 100755
--- a/bin/disk_stress_ng
+++ b/bin/disk_stress_ng
@@ -151,9 +151,15 @@ mount_filesystem() {
fi
find_largest_partition
-
+
if [ -n "$largest_part" ] ; then
echo "Found largest partition: \"$largest_part\""
+ # If largest partition is too small, just abort with a message
+ if [ $largest_size -lt 10000000000 ] ; then
+ echo "Warning: $largest_part is less than 10GiB in size"
+ echo "Disk is too small to test. Aborting test!"
+ exit 1
+ fi
mount_point=$(df | grep "$largest_part " | tr -s " " | cut -d " " -f 6)
if [ "$mount_point" == "" ] && [ "$really_run" == "Y" ] ; then
disk_device=$(echo $disk_device | sed "s/\/dev\/\/dev/\/dev/g")
diff --git a/bin/memory_stress_ng b/bin/memory_stress_ng
index 35c7725..a2b232b 100755
--- a/bin/memory_stress_ng
+++ b/bin/memory_stress_ng
@@ -75,10 +75,27 @@ run_stressor() {
end_time=$((runtime*15/10))
echo "Running stress-ng $1 stressor for $2 seconds...."
# Use "timeout" command to launch stress-ng, to catch it should it go into la-la land
- timeout -s 9 $end_time stress-ng --aggressive --verify --timeout $runtime --$1 0
+ timeout -s 14 $end_time stress-ng -k --aggressive --verify --timeout $runtime --$1 0
return_code="$?"
echo "return_code is $return_code"
if [ "$return_code" != "0" ] ; then
+ #
+ # a small grace period to allow stressors to terminate
+ #
+ sleep 10
+ #
+ # still running? aggressively kill all stressors
+ #
+ pids=$(pidof stress-ng)
+ if [ -n "$pids" ]; then
+ kill -9 $pids
+ sleep 1
+ kill -9 $pids
+ pids=$(pidof stress-ng)
+ if [ -n "$pids" ]; then
+ echo "Note: stress-ng (PIDS $pids) could not be killed"
+ fi
+ fi
had_error=1
echo "*****************************************************************"
if [ $return_code = "137" ] ; then
diff --git a/bin/network b/bin/network
index 88fd931..552c74c 100755
--- a/bin/network
+++ b/bin/network
@@ -260,7 +260,7 @@ class Interface(socket.socket):
nic_data = fcntl.ioctl(self.fileno(), 0x8915, freq)
except IOError:
logging.error("No IP address for %s", self.interface)
- return 1
+ return None
return socket.inet_ntoa(nic_data[20:24])
@property
@@ -271,7 +271,7 @@ class Interface(socket.socket):
mask_data = fcntl.ioctl(self.fileno(), 0x891b, freq)
except IOError:
logging.error("No netmask for %s", self.interface)
- return 1
+ return None
return socket.inet_ntoa(mask_data[20:24])
@property
@@ -433,9 +433,15 @@ def make_target_list(iface, test_targets, log_warnings):
List form of input string, minus invalid values
"""
test_targets_list = test_targets.split(",")
- net = ipaddress.IPv4Network("{}/{}".format(Interface(iface).ipaddress,
- Interface(iface).netmask),
- False)
+ try:
+ net = ipaddress.IPv4Network("{}/{}".format(Interface(iface).ipaddress,
+ Interface(iface).netmask),
+ False)
+ except ipaddress.AddressValueError as e:
+ logging.error("Device {}: Invalid IP Address".format(iface))
+ logging.error(" {}".format(e))
+ logging.error("Aborting test now")
+ sys.exit(1)
first_addr = net.network_address + 1
last_addr = first_addr + net.num_addresses - 2
return_list = list(test_targets_list)
@@ -448,10 +454,9 @@ def make_target_list(iface, test_targets, log_warnings):
target = ipaddress.IPv4Address(test_target_ip)
if (target < first_addr) or (target > last_addr):
if log_warnings:
- logging.warning("test server {} ({}) is NOT ".
- format(test_target, target))
- logging.warning("within {}; skipping".format(net))
- return_list.remove(test_target)
+ logging.warning("Test server {} ({}) is NOT within {}".
+ format(test_target, target, net))
+ logging.warning("This may cause test issues")
except ValueError:
if log_warnings:
logging.warning("Invalid address: {}; skipping".
@@ -471,7 +476,8 @@ def interface_test(args):
if (args.test_type.lower() == "iperf" or
args.test_type.lower() == "stress"):
test_targets = test_parameters["test_target_iperf"]
- test_targets_list = make_target_list(args.interface, test_targets, True)
+ test_targets_list = make_target_list(args.interface, test_targets,
+ True)
# Validate that we got reasonable values
if not test_targets_list or "example.com" in test_targets:
@@ -535,7 +541,9 @@ def interface_test(args):
if not test_targets_list:
logging.info(" Exhausted test target list; trying again "
.center(60, "="))
- test_targets_list = make_target_list(args.interface, test_targets, False)
+ test_targets_list = make_target_list(args.interface,
+ test_targets,
+ False)
time.sleep(30)
first_loop = False
diff --git a/manage.py b/manage.py
index 86fb301..d83829c 100755
--- a/manage.py
+++ b/manage.py
@@ -30,7 +30,7 @@ class InstallPyModules(InstallCommand):
setup(
name='plainbox-provider-checkbox',
namespace='2013.com.canonical.certification',
- version="0.35.0.dev0",
+ version="0.36.0.dev0",
description=N_("Checkbox provider"),
gettext_domain='plainbox-provider-checkbox',
strict=False, deprecated=False,