From f39c691b70e3c0f8f058751b77724e4a36780491 Mon Sep 17 00:00:00 2001 From: Jeff Lane Date: Mon, 21 Aug 2017 18:06:46 -0400 Subject: Fix dmesg_attachment job to work on systems that don't have a /var/log/dmesg file present, such as MAAS deployments. lp: #1712103 --- jobs/info.txt.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jobs/info.txt.in b/jobs/info.txt.in index 0b270d87..900d4c74 100644 --- a/jobs/info.txt.in +++ b/jobs/info.txt.in @@ -31,10 +31,16 @@ _summary: Attach a copy of /proc/cpuinfo id: dmesg_attachment plugin: attachment category_id: com.canonical.plainbox::info -command: cat /var/log/dmesg | ansi_parser +user: root +command: + if [ -e /var/log/dmesg ]; then + cat /var/log/dmesg | ansi_parser + else + dmesg | ansi_parser + fi estimated_duration: 0.640 -_description: Attaches a copy of /var/log/dmesg to the test results -_summary: Attach a copy of /var/log/dmesg +_description: Attaches a copy of /var/log/dmesg or the current dmesg buffer to the test results +_summary: Attach a copy of dmesg id: dmi_attachment plugin: attachment -- cgit v1.2.3 From 9dc442cebb90447da1c5969ce6db4786cd32cbdf Mon Sep 17 00:00:00 2001 From: Jeff Lane Date: Thu, 17 Aug 2017 18:43:41 -0400 Subject: Add a quick job to check syslog for call traces to be run at end of testing --- jobs/miscellanea.txt.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jobs/miscellanea.txt.in b/jobs/miscellanea.txt.in index 654ce26c..320ba714 100644 --- a/jobs/miscellanea.txt.in +++ b/jobs/miscellanea.txt.in @@ -358,3 +358,11 @@ user: root command: SOSFILE=`ls -t $PLAINBOX_SESSION_SHARE/sosreport*xz | head -1`; [ -e ${SOSFILE} ] && base64 $SOSFILE _summary: Attach the baseline sosreport file + +plugin: shell +category_id: com.canonical.plainbox::miscellanea +estimated_duration: 0.5 +id: miscellanea/call-trace-check +command: if [ -n "$(grep "Call Trace:" /var/log/syslog)" ]; then echo "Call Trace detected in syslog"; false; else true; fi +_summary: Check syslog for call traces +_description: Checks syslog for call traces after testing is complete. -- cgit v1.2.3 From 5552aa5d6ae8f1136a08d084800daa731956cbd1 Mon Sep 17 00:00:00 2001 From: Jeff Lane Date: Tue, 22 Aug 2017 10:06:55 -0400 Subject: added the preserve-locale field. Added extra job to attach syslog if traces are present for further investigation --- jobs/miscellanea.txt.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jobs/miscellanea.txt.in b/jobs/miscellanea.txt.in index 320ba714..a162dce8 100644 --- a/jobs/miscellanea.txt.in +++ b/jobs/miscellanea.txt.in @@ -366,3 +366,13 @@ id: miscellanea/call-trace-check command: if [ -n "$(grep "Call Trace:" /var/log/syslog)" ]; then echo "Call Trace detected in syslog"; false; else true; fi _summary: Check syslog for call traces _description: Checks syslog for call traces after testing is complete. +flags: preserve-locale + +plugin: attachment +category_id: com.canonical.plainbox::miscellanea +estimated_duration: 0.5 +id: miscellanea/attach-syslog +command: if [ -n "$(grep "Call Trace:" /var/log/syslog)" ]; then cat /var/log/syslog; fi +_summary: Attach syslog if Call Trace appears +_description: Attaches a copy of syslog if call traces are present after testing is complete. +flags: preserve-locale -- cgit v1.2.3 From f3aaa688a6c48b3fe5f7ecb9bf7f2ecc66bc8254 Mon Sep 17 00:00:00 2001 From: Jeff Lane Date: Wed, 23 Aug 2017 12:45:32 -0400 Subject: Modify usb/detect to display all usb devices, rather than just 4, and list the bus info so it's easier to determine what device is on what hub lp: #1712435 --- jobs/usb.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs/usb.txt.in b/jobs/usb.txt.in index 8fa63d72..be805933 100644 --- a/jobs/usb.txt.in +++ b/jobs/usb.txt.in @@ -14,7 +14,7 @@ command: if [[ -v SNAP ]]; then lsusb.py -f $SNAP/var/lib/usbutils/usb.ids 2>/dev/null | sed 's/.*\(ID .*\)/\1/' | head -n 4 || echo "No USB devices were detected" >&2 else - lsusb 2>/dev/null | sed 's/.*\(ID .*\)/\1/' | head -n 4 || echo "No USB devices were detected" >&2 + lsusb 2>/dev/null | sort || echo "No USB devices were detected" >&2 fi _summary: Display USB devices attached to SUT _description: Detects and shows USB devices attached to this system. -- cgit v1.2.3 From fb1f5a88a5978117406d2647a82220f610f4a484 Mon Sep 17 00:00:00 2001 From: Maciej Kisielewski Date: Sun, 27 Aug 2017 13:25:52 +0200 Subject: make xrandr_cycle tool pick only the highest res for each aspect ratio So there are far less resolutions to test. --- bin/xrandr_cycle | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/bin/xrandr_cycle b/bin/xrandr_cycle index 2a5e9158..b9f615b6 100755 --- a/bin/xrandr_cycle +++ b/bin/xrandr_cycle @@ -10,6 +10,9 @@ import sys import tarfile import time +from fractions import Fraction +from collections import OrderedDict + parser = argparse.ArgumentParser() parser.add_argument('--keyword', default='', help=('A keyword to distinguish the screenshots ' @@ -23,6 +26,7 @@ args = parser.parse_args() device_context = '' # track what device's modes we are looking at modes = [] # keep track of all the devices and modes discovered +highest_modes = [] # list of highest-res modes for each aspect ratio current_modes = [] # remember the user's current settings for cleanup later failures = 0 # count the number of failed modesets failure_messages = [] # remember which modes failed @@ -65,6 +69,26 @@ for line in output: # we found them at the end: if foo[1].find('*') != -1: current_modes.append((device_context, foo[0])) +# let's create a dict of aspect_ratio:largest_width for each display +# (width, because it's easier to compare simple ints when looking for the +# highest value). +top_res_per_aspect = OrderedDict() +for adapter, mode in modes: + try: + width, height = [int(x) for x in mode.split('x')] + aspect = Fraction(width, height) + if adapter not in top_res_per_aspect: + top_res_per_aspect[adapter] = OrderedDict() + cur_max = top_res_per_aspect[adapter].get(aspect, 0) + top_res_per_aspect[adapter][aspect] = max(cur_max, width) + except Exception as exc: + print("Error parsing %s: %s" % (mode, exc)) + +highest_modes = [] +for adapter, params in top_res_per_aspect.items(): + for aspect, width in params.items(): + mode = '{}x{}'.format(width, width/aspect) + highest_modes.append((adapter, mode)) # Now we have a list of the modes we need to test. So let's do just that. profile_path = os.environ['HOME'] + '/.shutter/profiles/' @@ -131,7 +155,7 @@ except: raise SystemExit("ERROR: While updating folder name " "in shutter profile: {}".format(sys.exc_info())) -for mode in modes: +for mode in highest_modes: cmd = 'xrandr --output ' + mode[0] + ' --mode ' + mode[1] retval = subprocess.call(cmd, shell=True) if retval != 0: -- cgit v1.2.3