summaryrefslogtreecommitdiff
path: root/bin
diff options
authorPMR <pmr@pmr-lander>2020-07-16 09:33:56 +0000
committerPMR <pmr@pmr-lander>2020-07-16 09:33:56 +0000
commitc8fd942af9ac6a1a85a3307581168aad01d28080 (patch)
tree835996e885903d0f2266041fc57e540034733bb4 /bin
parentf210ce4d8305dc63cc9270be536eb90e255638ba (diff)
parentddad2d4c08754f711b627a6cdb044849101bee86 (diff)
Merge #387358 from ~sylvain-pineau/plainbox-provider-checkbox:extensions4all
Diffstat (limited to 'bin')
-rwxr-xr-xbin/accelerometer_test.py (renamed from bin/accelerometer_test)0
-rwxr-xr-xbin/alsa_pcm_info.py (renamed from bin/alsa_pcm_info)0
-rwxr-xr-xbin/alsa_record_playback7
-rwxr-xr-xbin/alsa_record_playback.sh7
-rwxr-xr-xbin/ansi_parser.py (renamed from bin/ansi_parser)0
-rwxr-xr-xbin/audio_bluetooth_loopback_test.sh (renamed from bin/audio_bluetooth_loopback_test)0
-rwxr-xr-xbin/audio_driver_info.py (renamed from bin/audio_driver_info)0
-rwxr-xr-xbin/audio_settings.py (renamed from bin/audio_settings)0
-rwxr-xr-xbin/audio_test.py (renamed from bin/audio_test)0
-rwxr-xr-xbin/battery_test.py (renamed from bin/battery_test)0
-rwxr-xr-xbin/bluetooth_scan7
-rwxr-xr-xbin/bluetooth_test.py (renamed from bin/bluetooth_test)0
-rwxr-xr-xbin/bluetooth_transfer_stress.sh (renamed from bin/bluetooth_transfer_stress)4
-rwxr-xr-xbin/bmc_info.py (renamed from bin/bmc_info)0
-rwxr-xr-xbin/boot_mode_test.py (renamed from bin/boot_mode_test)0
-rwxr-xr-xbin/brightness_test.py (renamed from bin/brightness_test)2
-rwxr-xr-xbin/broadband_info.sh (renamed from bin/broadband_info)0
-rwxr-xr-xbin/bt_connect.py (renamed from bin/bt_connect)0
-rwxr-xr-xbin/camera_test.py (renamed from bin/camera_test)0
-rwxr-xr-xbin/check-prerelease.py (renamed from bin/check-prerelease)2
-rwxr-xr-xbin/check_is_laptop.sh (renamed from bin/check_is_laptop)0
-rwxr-xr-xbin/cking_suite105
-rwxr-xr-xbin/color_depth_info.py (renamed from bin/color_depth_info)2
-rwxr-xr-xbin/connect_wireless.sh (renamed from bin/connect_wireless)0
-rwxr-xr-xbin/cpu_offlining.py (renamed from bin/cpu_offlining)0
-rwxr-xr-xbin/cpu_topology.py (renamed from bin/cpu_topology)2
-rwxr-xr-xbin/create_connection.py (renamed from bin/create_connection)0
-rwxr-xr-xbin/cycle_vts.sh (renamed from bin/cycle_vts)0
-rwxr-xr-xbin/disk_cpu_load.sh (renamed from bin/disk_cpu_load)4
-rwxr-xr-xbin/disk_info.py (renamed from bin/disk_info)0
-rwxr-xr-xbin/disk_read_performance_test.sh (renamed from bin/disk_read_performance_test)0
-rwxr-xr-xbin/disk_smart.py (renamed from bin/disk_smart)0
-rwxr-xr-xbin/disk_stats_test.sh (renamed from bin/disk_stats_test)0
-rwxr-xr-xbin/dmitest.py (renamed from bin/dmitest)2
-rwxr-xr-xbin/dns_server_test49
-rwxr-xr-xbin/efi-pxeboot.py (renamed from bin/efi-pxeboot)2
-rwxr-xr-xbin/floppy_test105
-rwxr-xr-xbin/frequency_governors_test.py (renamed from bin/frequency_governors_test)0
-rwxr-xr-xbin/fresh_rate_info.py (renamed from bin/fresh_rate_info)4
-rwxr-xr-xbin/fstrim_test.py (renamed from bin/fstrim_test)0
-rwxr-xr-xbin/gcov_tarball.sh (renamed from bin/gcov_tarball)0
-rwxr-xr-xbin/get_make_and_model.py (renamed from bin/get_make_and_model)0
-rwxr-xr-xbin/gpu_test.py (renamed from bin/gpu_test)0
-rwxr-xr-xbin/gputest_benchmark.py (renamed from bin/gputest_benchmark)0
-rwxr-xr-xbin/graphic_memory_info.py (renamed from bin/graphic_memory_info)4
-rwxr-xr-xbin/graphics_driver.py (renamed from bin/graphics_driver)0
-rwxr-xr-xbin/graphics_env.sh (renamed from bin/graphics_env)2
-rwxr-xr-xbin/graphics_modes_info.py (renamed from bin/graphics_modes_info)2
-rwxr-xr-xbin/graphics_stress_test.py (renamed from bin/graphics_stress_test)2
-rwxr-xr-xbin/gst_pipeline_test.py (renamed from bin/gst_pipeline_test)0
-rwxr-xr-xbin/hdd_parking.py (renamed from bin/hdd_parking)0
-rwxr-xr-xbin/kernel_taint_test.py (renamed from bin/kernel_taint_test)0
-rwxr-xr-xbin/key_test.py (renamed from bin/key_test)0
-rwxr-xr-xbin/keyboard_test.py (renamed from bin/keyboard_test)0
-rwxr-xr-xbin/lamp_test31
-rwxr-xr-xbin/led_hdd_test.sh (renamed from bin/led_hdd_test)0
-rwxr-xr-xbin/light_sensor_test.sh (renamed from bin/light_sensor_test)0
-rwxr-xr-xbin/lock_screen_watcher.py (renamed from bin/lock_screen_watcher)0
-rwxr-xr-xbin/lsmod_info.py (renamed from bin/lsmod_info)0
-rwxr-xr-xbin/maas-version-check.sh (renamed from bin/maas-version-check)0
-rwxr-xr-xbin/manage_compiz_plugin.py (renamed from bin/manage_compiz_plugin)4
-rwxr-xr-xbin/max_diskspace_used34
-rwxr-xr-xbin/memory_compare.py (renamed from bin/memory_compare)0
-rwxr-xr-xbin/memory_info35
-rwxr-xr-xbin/memory_test.py (renamed from bin/memory_test)0
-rwxr-xr-xbin/mm-test534
-rwxr-xr-xbin/net_driver_info.py (renamed from bin/net_driver_info)0
-rwxr-xr-xbin/network.py (renamed from bin/network)6
-rwxr-xr-xbin/network_check.py (renamed from bin/network_check)0
-rwxr-xr-xbin/network_configs.sh (renamed from bin/network_configs)0
-rwxr-xr-xbin/network_ntp_test.py (renamed from bin/network_ntp_test)0
-rwxr-xr-xbin/network_predictable_names.sh (renamed from bin/network_predictable_names)2
-rwxr-xr-xbin/network_printer_test.sh (renamed from bin/network_printer_test)0
-rwxr-xr-xbin/network_reconnect_resume_test.py (renamed from bin/network_reconnect_resume_test)0
-rwxr-xr-xbin/network_restart.py (renamed from bin/network_restart)5
-rwxr-xr-xbin/network_wait.sh (renamed from bin/network_wait)0
-rwxr-xr-xbin/nvidia_nvlink_check.sh (renamed from bin/nvidia_nvlink_check)0
-rwxr-xr-xbin/optical_detect29
-rwxr-xr-xbin/optical_read_test.py (renamed from bin/optical_read_test)0
-rwxr-xr-xbin/optical_write_test.sh (renamed from bin/optical_write_test)0
-rwxr-xr-xbin/pm_log_check.py (renamed from bin/pm_log_check)0
-rwxr-xr-xbin/pm_test.py (renamed from bin/pm_test)21
-rwxr-xr-xbin/process_wait.py (renamed from bin/process_wait)0
-rwxr-xr-xbin/pts_run38
-rwxr-xr-xbin/pulse-active-port-change.py (renamed from bin/pulse-active-port-change)2
-rwxr-xr-xbin/removable_storage_test.py (renamed from bin/removable_storage_test)0
-rwxr-xr-xbin/removable_storage_watcher.py (renamed from bin/removable_storage_watcher)0
-rwxr-xr-xbin/rendercheck_test263
-rwxr-xr-xbin/resolution_test.py (renamed from bin/resolution_test)0
-rwxr-xr-xbin/rotation_test.py (renamed from bin/rotation_test)0
-rwxr-xr-xbin/rotation_test_using_dbus47
-rwxr-xr-xbin/samba_test38
-rwxr-xr-xbin/sleep_test.py (renamed from bin/sleep_test)0
-rwxr-xr-xbin/sleep_test_log_check.py (renamed from bin/sleep_test_log_check)0
-rwxr-xr-xbin/sleep_time_check.py (renamed from bin/sleep_time_check)0
-rwxr-xr-xbin/sources_test.sh (renamed from bin/sources_test)0
-rwxr-xr-xbin/spindown.sh (renamed from bin/spindown)0
-rwxr-xr-xbin/stress_ng_test.py (renamed from bin/stress_ng_test)0
-rwxr-xr-xbin/system_info.py3
-rwxr-xr-xbin/test_bt_keyboard.py (renamed from bin/test_bt_keyboard)0
-rwxr-xr-xbin/tomcat_test24
-rwxr-xr-xbin/touchpad_driver_info.py (renamed from bin/touchpad_driver_info)0
-rwxr-xr-xbin/touchpad_test.py (renamed from bin/touchpad_test)0
-rwxr-xr-xbin/udisks2_monitor154
-rwxr-xr-xbin/virtualization.py (renamed from bin/virtualization)0
-rwxr-xr-xbin/volume_test.py (renamed from bin/volume_test)0
-rwxr-xr-xbin/wifi_client_test.py (renamed from bin/wifi_client_test)2
-rwxr-xr-xbin/wifi_time2reconnect.py (renamed from bin/wifi_time2reconnect)0
-rwxr-xr-xbin/window_test.py (renamed from bin/window_test)2
-rwxr-xr-xbin/xen_test74
-rwxr-xr-xbin/xrandr_cycle.py (renamed from bin/xrandr_cycle)0
111 files changed, 49 insertions, 1613 deletions
diff --git a/bin/accelerometer_test b/bin/accelerometer_test.py
index 2d95ca8..2d95ca8 100755
--- a/bin/accelerometer_test
+++ b/bin/accelerometer_test.py
diff --git a/bin/alsa_pcm_info b/bin/alsa_pcm_info.py
index abb870f..abb870f 100755
--- a/bin/alsa_pcm_info
+++ b/bin/alsa_pcm_info.py
diff --git a/bin/alsa_record_playback b/bin/alsa_record_playback
deleted file mode 100755
index cf5142b..0000000
--- a/bin/alsa_record_playback
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-OUTPUT=`mktemp -d`
-gst_pipeline_test -t 5 "autoaudiosrc ! audioconvert ! level name=recordlevel interval=10000000 ! audioconvert ! wavenc ! filesink location=$OUTPUT/test.wav"
-aplay $OUTPUT/test.wav
-rm $OUTPUT/test.wav
-rmdir $OUTPUT
diff --git a/bin/alsa_record_playback.sh b/bin/alsa_record_playback.sh
new file mode 100755
index 0000000..e86d7d1
--- /dev/null
+++ b/bin/alsa_record_playback.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+OUTPUT=`mktemp -d`
+gst_pipeline_test.py -t 5 "autoaudiosrc ! audioconvert ! level name=recordlevel interval=10000000 ! audioconvert ! wavenc ! filesink location=$OUTPUT/test.wav"
+aplay $OUTPUT/test.wav
+rm $OUTPUT/test.wav
+rmdir $OUTPUT
diff --git a/bin/ansi_parser b/bin/ansi_parser.py
index c7cf26c..c7cf26c 100755
--- a/bin/ansi_parser
+++ b/bin/ansi_parser.py
diff --git a/bin/audio_bluetooth_loopback_test b/bin/audio_bluetooth_loopback_test.sh
index 9661ec4..9661ec4 100755
--- a/bin/audio_bluetooth_loopback_test
+++ b/bin/audio_bluetooth_loopback_test.sh
diff --git a/bin/audio_driver_info b/bin/audio_driver_info.py
index b9bfaf8..b9bfaf8 100755
--- a/bin/audio_driver_info
+++ b/bin/audio_driver_info.py
diff --git a/bin/audio_settings b/bin/audio_settings.py
index 91978be..91978be 100755
--- a/bin/audio_settings
+++ b/bin/audio_settings.py
diff --git a/bin/audio_test b/bin/audio_test.py
index 7bd6c44..7bd6c44 100755
--- a/bin/audio_test
+++ b/bin/audio_test.py
diff --git a/bin/battery_test b/bin/battery_test.py
index b2682c7..b2682c7 100755
--- a/bin/battery_test
+++ b/bin/battery_test.py
diff --git a/bin/bluetooth_scan b/bin/bluetooth_scan
deleted file mode 100755
index 495ebdd..0000000
--- a/bin/bluetooth_scan
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-hciconfig hci0 reset
-
-name=`zenity --title="Bluetooth Send" --entry --text="Bluetooth Send"`
-address=`hcitool scan | grep "$name" | awk '{print $1}'`
-echo $address
diff --git a/bin/bluetooth_test b/bin/bluetooth_test.py
index 8fafad6..8fafad6 100755
--- a/bin/bluetooth_test
+++ b/bin/bluetooth_test.py
diff --git a/bin/bluetooth_transfer_stress b/bin/bluetooth_transfer_stress.sh
index 2add0b1..36e4de7 100755
--- a/bin/bluetooth_transfer_stress
+++ b/bin/bluetooth_transfer_stress.sh
@@ -35,10 +35,10 @@ dd if=/dev/urandom of=$ORIGIN count=$SIZEKB bs=1024
ORIGIN_SUM=$(sha256sum $ORIGIN | cut -f 1 -d ' ')
set -o pipefail
echo "Sending file using Bluetooth"
-time obexftp -v -b $BTDEVADDR -o $REMOTE --put $ORIGIN 2>&1 | ansi_parser
+time obexftp -v -b $BTDEVADDR -o $REMOTE --put $ORIGIN 2>&1 | ansi_parser.py
sleep 5
echo "Receiving file using Bluetooth"
-time obexftp -v -b $BTDEVADDR -o $DESTINATION --get $REMOTE 2>&1 | ansi_parser
+time obexftp -v -b $BTDEVADDR -o $DESTINATION --get $REMOTE 2>&1 | ansi_parser.py
# Now checksum destination and compare
DESTINATION_SUM=$(sha256sum $DESTINATION | cut -f 1 -d ' ')
# Clean up before reporting
diff --git a/bin/bmc_info b/bin/bmc_info.py
index d7aec9b..d7aec9b 100755
--- a/bin/bmc_info
+++ b/bin/bmc_info.py
diff --git a/bin/boot_mode_test b/bin/boot_mode_test.py
index e51a099..e51a099 100755
--- a/bin/boot_mode_test
+++ b/bin/boot_mode_test.py
diff --git a/bin/brightness_test b/bin/brightness_test.py
index af1de1b..52d478a 100755
--- a/bin/brightness_test
+++ b/bin/brightness_test.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
-# brightness_test
+# brightness_test.py
#
# This file is part of Checkbox.
#
diff --git a/bin/broadband_info b/bin/broadband_info.sh
index aec2ccb..aec2ccb 100755
--- a/bin/broadband_info
+++ b/bin/broadband_info.sh
diff --git a/bin/bt_connect b/bin/bt_connect.py
index 1fed30e..1fed30e 100755
--- a/bin/bt_connect
+++ b/bin/bt_connect.py
diff --git a/bin/camera_test b/bin/camera_test.py
index 4ef90d7..4ef90d7 100755
--- a/bin/camera_test
+++ b/bin/camera_test.py
diff --git a/bin/check-prerelease b/bin/check-prerelease.py
index 5e24902..68b1a2e 100755
--- a/bin/check-prerelease
+++ b/bin/check-prerelease.py
@@ -25,7 +25,7 @@ system booted from the network (test passes) or from a local disk
(test fails).
Usage:
- check-prerelease
+ check-prerelease.py
"""
import platform
diff --git a/bin/check_is_laptop b/bin/check_is_laptop.sh
index 5820a37..5820a37 100755
--- a/bin/check_is_laptop
+++ b/bin/check_is_laptop.sh
diff --git a/bin/cking_suite b/bin/cking_suite
deleted file mode 100755
index 8c6f462..0000000
--- a/bin/cking_suite
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import sys
-import posixpath
-import subprocess
-
-from optparse import OptionParser
-
-
-DEFAULT_DIRECTORY = "/tmp/checkbox.cking-scripts"
-DEFAULT_LOCATION = "git://kernel.ubuntu.com/cking/scripts"
-
-COMMAND_TEMPLATE = "cd %(scripts)s; ./%(script)s"
-
-
-def print_line(key, value):
- if type(value) is list:
- print("%s:" % key)
- for v in value:
- print(" %s" % v)
- else:
- print("%s: %s" % (key, value))
-
-
-def print_element(element):
- for key, value in element.items():
- print_line(key, value)
-
- print()
-
-
-def clone_cking_scripts(location, directory):
- if posixpath.exists(directory):
- return
-
- dirname = posixpath.dirname(directory)
- if not posixpath.exists(dirname):
- os.makedirs(dirname)
-
- process = subprocess.Popen(["git", "clone", location, directory],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = process.communicate()
- if process.wait():
- raise Exception("Failed to clone cking scripts from %s" % location)
-
-
-def run_cking_scripts(scripts, location, directory, dry_run):
- if not dry_run:
- clone_cking_scripts(location, directory)
-
- for script in scripts:
- path = posixpath.join(directory, script)
-
- # Initialize test structure
- test = {}
- test["plugin"] = "shell"
- test["name"] = posixpath.splitext(posixpath.basename(path))[0]
- test["command"] = COMMAND_TEMPLATE % {
- "scripts": posixpath.dirname(path),
- "script": posixpath.basename(path)}
-
- # Get description from first line of the README file
- readme_path = posixpath.join(posixpath.dirname(path), "README")
- if os.path.exists(readme_path):
- file = open(readme_path)
- test["description"] = file.readline().strip()
- file.close
- else:
- test["description"] = "No description found"
-
- yield test
-
-
-def main(args):
- usage = "Usage: %prog [OPTIONS] [SCRIPTS]"
- parser = OptionParser(usage=usage)
- parser.add_option("--dry-run",
- default=False,
- action="store_true",
- help="Dry run to avoid branching from the given location.")
- parser.add_option("-d", "--directory",
- default=DEFAULT_DIRECTORY,
- help="Directory where to branch qa-regression-testing")
- parser.add_option("-l", "--location",
- default=DEFAULT_LOCATION,
- help="Location from where to branch qa-regression-testing")
-
- (options, scripts) = parser.parse_args(args)
-
- if not scripts:
- parser.error("Must specify a script")
-
- tests = run_cking_scripts(scripts, options.location, options.directory,
- options.dry_run)
- if not tests:
- return 1
-
- for test in tests:
- print_element(test)
-
- return 0
-
-if __name__ == "__main__":
- sys.exit(main(sys.argv[1:]))
diff --git a/bin/color_depth_info b/bin/color_depth_info.py
index 4137193..129f051 100755
--- a/bin/color_depth_info
+++ b/bin/color_depth_info.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
-# color_depth_info
+# color_depth_info.py
#
# This file is part of Checkbox.
#
diff --git a/bin/connect_wireless b/bin/connect_wireless.sh
index e39f52c..e39f52c 100755
--- a/bin/connect_wireless
+++ b/bin/connect_wireless.sh
diff --git a/bin/cpu_offlining b/bin/cpu_offlining.py
index 5616e30..5616e30 100755
--- a/bin/cpu_offlining
+++ b/bin/cpu_offlining.py
diff --git a/bin/cpu_topology b/bin/cpu_topology.py
index 78317b7..0ce68c5 100755
--- a/bin/cpu_topology
+++ b/bin/cpu_topology.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
'''
-cpu_topology
+cpu_topology.py
Written by Jeffrey Lane <jeffrey.lane@canonical.com>
'''
import sys
diff --git a/bin/create_connection b/bin/create_connection.py
index 71e9572..71e9572 100755
--- a/bin/create_connection
+++ b/bin/create_connection.py
diff --git a/bin/cycle_vts b/bin/cycle_vts.sh
index c5e1677..c5e1677 100755
--- a/bin/cycle_vts
+++ b/bin/cycle_vts.sh
diff --git a/bin/disk_cpu_load b/bin/disk_cpu_load.sh
index 93b1569..adad55f 100755
--- a/bin/disk_cpu_load
+++ b/bin/disk_cpu_load.sh
@@ -23,8 +23,8 @@
# stress-ng program.
#
# Usage:
-# disk_cpu_load [ --max-load <load> ] [ --xfer <mebibytes> ]
-# [ --verbose ] [ <device-filename> ]
+# disk_cpu_load.sh [ --max-load <load> ] [ --xfer <mebibytes> ]
+# [ --verbose ] [ <device-filename> ]
#
# Parameters:
# --max-load <load> -- The maximum acceptable CPU load, as a percentage.
diff --git a/bin/disk_info b/bin/disk_info.py
index 0b45443..0b45443 100755
--- a/bin/disk_info
+++ b/bin/disk_info.py
diff --git a/bin/disk_read_performance_test b/bin/disk_read_performance_test.sh
index 7734543..7734543 100755
--- a/bin/disk_read_performance_test
+++ b/bin/disk_read_performance_test.sh
diff --git a/bin/disk_smart b/bin/disk_smart.py
index a9b294e..a9b294e 100755
--- a/bin/disk_smart
+++ b/bin/disk_smart.py
diff --git a/bin/disk_stats_test b/bin/disk_stats_test.sh
index 60b48f5..60b48f5 100755
--- a/bin/disk_stats_test
+++ b/bin/disk_stats_test.sh
diff --git a/bin/dmitest b/bin/dmitest.py
index ef416ca..642af3a 100755
--- a/bin/dmitest
+++ b/bin/dmitest.py
@@ -248,7 +248,7 @@ def serial_tests(args, stream, dmi_data):
def main():
"""Main function."""
- parser = ArgumentParser("dmitest")
+ parser = ArgumentParser()
parser.add_argument('test_type',
help="Test type ('server', 'desktop' or 'cpu-check').",
choices=['server', 'desktop', 'cpu-check'])
diff --git a/bin/dns_server_test b/bin/dns_server_test
deleted file mode 100755
index 1b29595..0000000
--- a/bin/dns_server_test
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-#
-# Verify dns server setup
-# Packages and ports can be verified offline but external connections
-# require a network connection. The script will check for this.
-#
-
-# Verify process is running. Expected output 'pgrep named' is a $pid
-check=`pgrep named`
-if [ -z "$check" ]; then
- echo "FAIL: DNS bind is not running."
- exit 1
-fi
-
-# Check ports
-result1=`host www.ubuntu.com localhost | grep "#53"`
-result2=`host -T -6 www.ubuntu.com ip6-localhost | grep "#53"`
-if [ -z "$result1" ]; then
- echo "FAIL: DNS is not using port 53."
- exit 1
-elif [ -z "$result2" ]; then
- echo "FAIL: DNS is not using port 53 on IPv6."
- exit 1
-fi
-
-# Check if udp is established
-udpCheck=`netstat -auvpn | egrep '(:53)' |egrep 'udp'`
-if [ -z "$udpCheck" ]; then
- echo "FAIL: DNS udp setup is not established."
- exit 1
-fi
-
-# Check if external dns queries work but first verify the network
-# is up and running
-check=`ping -c 2 www.ubuntu.com |grep "2 received"`
-if [ -n "$check" ]; then
- failure="2(SERVFAIL)"
- result1=`host www.ubuntu.com localhost | grep "SERVFAIL" |awk '{print $5}'`
- result2=`host -T -6 www.ubuntu.com ip6-localhost | grep "SERVFAIL" |awk '{print $5}'`
- if [ "$result1" = $failure ]; then
- echo "FAIL: DNS external connection fails."
- exit 1
- elif [ "$result2" = $failure ]; then
- echo "FAIL: DNS external connection via IPv6 fails."
- exit 1
- fi
-fi
-
-exit 0
diff --git a/bin/efi-pxeboot b/bin/efi-pxeboot.py
index 24ac231..52eace9 100755
--- a/bin/efi-pxeboot
+++ b/bin/efi-pxeboot.py
@@ -25,7 +25,7 @@ system booted from the network (test passes) or from a local disk
(test fails).
Usage:
- efi-pxeboot
+ efi-pxeboot.py
"""
import os
diff --git a/bin/floppy_test b/bin/floppy_test
deleted file mode 100755
index 4675948..0000000
--- a/bin/floppy_test
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import sys
-import filecmp
-import subprocess
-import posixpath
-
-DEFAULT_DIR = "/tmp/checkbox.floppy"
-DEFAULT_DEVICE_DIR = "floppy_device"
-DEFAULT_IMAGE_DIR = "floppy_image"
-DEFAULT_IMAGE = "floppy.img"
-
-
-class FloppyTest(object):
-
- def __init__(self, device):
- self.device = device
- self.device_dir = os.path.join(DEFAULT_DIR, DEFAULT_DEVICE_DIR)
- self.image_dir = os.path.join(DEFAULT_DIR, DEFAULT_IMAGE_DIR)
- self.image = os.path.join(DEFAULT_DIR, DEFAULT_IMAGE)
- self.interactive = True
-
- for dir in (self.device_dir, self.image_dir):
- if not posixpath.exists(dir):
- os.makedirs(dir)
-
- def run(self):
- floppyDevice = self.device
- if floppyDevice:
- print(" Testing on floppy drive %s " % floppyDevice)
- else:
- print(" Error ! No floppy drive found !")
- return 1
- # remove temp files if they exist
- os.system("umount /media/floppy 2>/dev/null")
- if (os.path.exists(self.device_dir)
- or os.path.exists(self.image_dir)
- or os.path.exists(self.image)):
- os.system("umount %s %s 2>/dev/null"
- % (self.device_dir, self.image_dir))
- os.system("rm -rf %s %s %s 2>/dev/null"
- % (self.device_dir, self.image_dir, self.image))
- # Create the test images
- os.mkdir(self.device_dir)
- os.mkdir(self.image_dir)
- os.system("dd if=/dev/zero of=%s bs=1k count=1440" % self.image)
- os.system("mkdosfs %s" % self.image)
- os.system("mount -o loop %s %s" % (self.image, self.image_dir))
- os.system("cp -a /etc/*.conf %s 2> /dev/null" % self.image_dir)
- os.system("umount %s" % self.image_dir)
- # start testing
- (noFloppyDisk, junkOutput1) = \
- subprocess.getstatusoutput("dd bs=1c if=%s count=0 2>/dev/null"
- % floppyDevice)
- if noFloppyDisk != 0:
- print("Error ! No floppy disc or bad media in %s !" % floppyDevice)
- return 1
- else:
- # writing files
- print(" Writing data to floppy disc ... ")
- (ddStatus, ddOutput) = \
- subprocess.getstatusoutput("dd if=%s of=%s bs=1k count=1440"
- % (self.image, floppyDevice))
- if ddStatus == 0:
- print(" Write data to floppy disc done ! ")
- else:
- print(" Error ! Write data to floppy disc error ! ")
- print(" Please check if your floppy disc is write-protected !")
- return 1
- # comparing files
- os.system("mount %s %s" % (floppyDevice, self.device_dir))
- os.system("mount -o loop %s %s" % (self.image, self.image_dir))
- print(" Comparing files ... ")
- fileList = os.listdir(self.image_dir)
- returnValue = 0
- for textFile in fileList:
- file1 = os.path.join(self.device_dir, textFile)
- file2 = os.path.join(self.image_dir, textFile)
- if filecmp.cmp(file1, file2):
- print(" comparing file %s" % textFile)
- else:
- print(" -- Error ! File %s comparison failed ! -- "
- % textFile)
- returnValue = 1
- print(" File comparison done ! ")
- # remove temp files
- os.system("umount /media/floppy 2>/dev/null")
- os.system("umount %s %s " % (self.image_dir, self.device_dir))
- os.system("rm -rf %s %s %s"
- % (self.device_dir, self.image_dir, self.image))
- print("Done !")
- return returnValue
-
-
-def main(args):
- return_values = []
- for device in args:
- test = FloppyTest(device)
- return_values.append(test.run())
-
- return 1 in return_values
-
-if __name__ == "__main__":
- sys.exit(main(sys.argv[1:]))
diff --git a/bin/frequency_governors_test b/bin/frequency_governors_test.py
index 6072ded..6072ded 100755
--- a/bin/frequency_governors_test
+++ b/bin/frequency_governors_test.py
diff --git a/bin/fresh_rate_info b/bin/fresh_rate_info.py
index 838e5a6..43a8f2a 100755
--- a/bin/fresh_rate_info
+++ b/bin/fresh_rate_info.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
-# fresh_rate_info
+# fresh_rate_info.py
#
# This file is part of Checkbox.
#
@@ -23,7 +23,7 @@
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
"""
- The fresh_rate_info got information from xrandr
+ The fresh_rate_info.py got information from xrandr
"""
import re
diff --git a/bin/fstrim_test b/bin/fstrim_test.py
index c6f1881..c6f1881 100755
--- a/bin/fstrim_test
+++ b/bin/fstrim_test.py
diff --git a/bin/gcov_tarball b/bin/gcov_tarball.sh
index 2b05cf6..2b05cf6 100755
--- a/bin/gcov_tarball
+++ b/bin/gcov_tarball.sh
diff --git a/bin/get_make_and_model b/bin/get_make_and_model.py
index 496a949..496a949 100755
--- a/bin/get_make_and_model
+++ b/bin/get_make_and_model.py
diff --git a/bin/gpu_test b/bin/gpu_test.py
index 49ea31a..49ea31a 100755
--- a/bin/gpu_test
+++ b/bin/gpu_test.py
diff --git a/bin/gputest_benchmark b/bin/gputest_benchmark.py
index 4748e71..4748e71 100755
--- a/bin/gputest_benchmark
+++ b/bin/gputest_benchmark.py
diff --git a/bin/graphic_memory_info b/bin/graphic_memory_info.py
index f9f8f64..ba7eece 100755
--- a/bin/graphic_memory_info
+++ b/bin/graphic_memory_info.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
-# graphic_memory_info
+# graphic_memory_info.py
#
# This file is part of Checkbox.
#
@@ -23,7 +23,7 @@
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
"""
- The graphic_memory_info got information from lspci
+ The graphic_memory_info.py got information from lspci
"""
import re
diff --git a/bin/graphics_driver b/bin/graphics_driver.py
index 6d28f5a..6d28f5a 100755
--- a/bin/graphics_driver
+++ b/bin/graphics_driver.py
diff --git a/bin/graphics_env b/bin/graphics_env.sh
index 19385a5..5160ae6 100755
--- a/bin/graphics_env
+++ b/bin/graphics_env.sh
@@ -12,7 +12,7 @@ INDEX=$2
# We only want to set the DRI_PRIME env variable on systems with more than
# 1 GPU running the amdgpu/radeon drivers.
if [[ $DRIVER == "amdgpu" || $DRIVER == "radeon" ]]; then
- NB_GPU=`udev_resource -l VIDEO | grep -oP -m1 '\d+'`
+ NB_GPU=`udev_resource.py -l VIDEO | grep -oP -m1 '\d+'`
if [ $NB_GPU -gt 1 ]; then
if [ $INDEX -gt 1 ]; then
# See https://wiki.archlinux.org/index.php/PRIME
diff --git a/bin/graphics_modes_info b/bin/graphics_modes_info.py
index c585324..f3c962a 100755
--- a/bin/graphics_modes_info
+++ b/bin/graphics_modes_info.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
-# graphics_modes_info
+# graphics_modes_info.py
#
# This file is part of Checkbox.
#
diff --git a/bin/graphics_stress_test b/bin/graphics_stress_test.py
index bab2221..d467b3f 100755
--- a/bin/graphics_stress_test
+++ b/bin/graphics_stress_test.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
-# graphics_stress_test
+# graphics_stress_test.py
#
# This file is part of Checkbox.
#
diff --git a/bin/gst_pipeline_test b/bin/gst_pipeline_test.py
index c7a9af5..c7a9af5 100755
--- a/bin/gst_pipeline_test
+++ b/bin/gst_pipeline_test.py
diff --git a/bin/hdd_parking b/bin/hdd_parking.py
index 6d34904..6d34904 100755
--- a/bin/hdd_parking
+++ b/bin/hdd_parking.py
diff --git a/bin/kernel_taint_test b/bin/kernel_taint_test.py
index cbceaf6..cbceaf6 100755
--- a/bin/kernel_taint_test
+++ b/bin/kernel_taint_test.py
diff --git a/bin/key_test b/bin/key_test.py
index 2bd95f9..2bd95f9 100755
--- a/bin/key_test
+++ b/bin/key_test.py
diff --git a/bin/keyboard_test b/bin/keyboard_test.py
index 1615106..1615106 100755
--- a/bin/keyboard_test
+++ b/bin/keyboard_test.py
diff --git a/bin/lamp_test b/bin/lamp_test
deleted file mode 100755
index f8a641b..0000000
--- a/bin/lamp_test
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-#
-# Test LAMP by checking Apache, MySQL, and PHP
-# Requires: apache2, php5-mysql, libapache2-mod-php5, mysql-server
-#
-
-# Check Apache is running; requires network connection so verify that
-check=`ping -c 2 www.ubuntu.com |grep "2 received"`
-if [ -n "$check" ]; then
- run1=`w3m http://127.0.0.1/ | grep "404"`
- if [ -n "$run1" ]; then
- echo "FAIL: apache is not running."
- exit 1
- fi
-fi
-
-# Check if MySQL server is running
-run2=`netstat -tap | grep mysql`
-if [ -z "$run2" ]; then
- echo "FAIL: mysql is not running."
- exit 1
-fi
-
-# Check PHP
-run3=`php -r 'phpinfo();' | grep 'PHP License'`
-if [ -z "$run3" ]; then
- echo "FAIL: php is not running."
- exit 1
-fi
-
-exit 0
diff --git a/bin/led_hdd_test b/bin/led_hdd_test.sh
index eac6ae2..eac6ae2 100755
--- a/bin/led_hdd_test
+++ b/bin/led_hdd_test.sh
diff --git a/bin/light_sensor_test b/bin/light_sensor_test.sh
index f413396..f413396 100755
--- a/bin/light_sensor_test
+++ b/bin/light_sensor_test.sh
diff --git a/bin/lock_screen_watcher b/bin/lock_screen_watcher.py
index 1c30270..1c30270 100755
--- a/bin/lock_screen_watcher
+++ b/bin/lock_screen_watcher.py
diff --git a/bin/lsmod_info b/bin/lsmod_info.py
index 3b81542..3b81542 100755
--- a/bin/lsmod_info
+++ b/bin/lsmod_info.py
diff --git a/bin/maas-version-check b/bin/maas-version-check.sh
index 678088a..678088a 100755
--- a/bin/maas-version-check
+++ b/bin/maas-version-check.sh
diff --git a/bin/manage_compiz_plugin b/bin/manage_compiz_plugin.py
index 9650a9d..03c0ed8 100755
--- a/bin/manage_compiz_plugin
+++ b/bin/manage_compiz_plugin.py
@@ -18,8 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
"""
-manage_compiz_plugin
-====================
+manage_compiz_plugin.py
+=======================
This script allows enabling or disabling compiz plugins using
gsettings. Changes take effect on the fly.
diff --git a/bin/max_diskspace_used b/bin/max_diskspace_used
deleted file mode 100755
index cc30d85..0000000
--- a/bin/max_diskspace_used
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-# Verify default partitioning has used the entire local hard disk.
-# Please remove any non-local attached storage prior to running this
-# test.
-
-for disk in $@; do
- echo "Checking maximum disk space available on : $disk"
-
- psize=`parted -l | grep $disk | awk '{print $3}'`
-
- if [ -n "$psize" ]
- then
- echo "Disk space available : $psize"
-
- fsizes=`df -B ${psize:(-2)} | grep $disk | awk '{print $2}'`
-
- if [ -n "$fsizes" ]
- then
- echo "Disk space used : $fsizes"
-
- fsize=0
- for i in $fsizes; do
- i=`echo $i | grep -oe '[0-9\.]*'`
- fsize=$(($fsize + $i))
- done
-
- psize=`echo $psize | grep -oe '[0-9\.]*'`
- pct_difference=`awk "BEGIN{print(($psize - $fsize) / $fsize)}"`
- echo "Difference ( > 0.15 fails ) : $pct_difference"
- awk "BEGIN{exit($pct_difference > 0.15)}" || exit 1
- fi
- fi
-done
diff --git a/bin/memory_compare b/bin/memory_compare.py
index 02e2def..02e2def 100755
--- a/bin/memory_compare
+++ b/bin/memory_compare.py
diff --git a/bin/memory_info b/bin/memory_info
deleted file mode 100755
index 708c22d..0000000
--- a/bin/memory_info
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python3
-
-import re
-import sys
-
-
-def get_meminfo():
- meminfo = {}
- for line in open("/proc/meminfo").readlines():
- match = re.match(r"(.*):\s+(.*)", line)
- if match:
- key = match.group(1)
- value = match.group(2)
- meminfo[key] = value
-
- return meminfo
-
-
-def main(args):
- meminfo = get_meminfo()
- amount, units = meminfo["MemTotal"].split()
-
- amount = float(amount)
- next_units = {'kB': 'MB',
- 'MB': 'GB'}
-
- while amount > 1024:
- amount = amount / 1024
- units = next_units[units]
-
- print("%.1f %s" % (amount, units))
- return 0
-
-if __name__ == "__main__":
- sys.exit(main(sys.argv[1:]))
diff --git a/bin/memory_test b/bin/memory_test.py
index 4cd6008..4cd6008 100755
--- a/bin/memory_test
+++ b/bin/memory_test.py
diff --git a/bin/mm-test b/bin/mm-test
deleted file mode 100755
index 236504a..0000000
--- a/bin/mm-test
+++ /dev/null
@@ -1,534 +0,0 @@
-#!/usr/bin/env python3
-# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details:
-#
-# Copyright (C) 2008 Novell, Inc.
-# Copyright (C) 2009 Red Hat, Inc.
-#
-
-import sys, dbus, time, os, string, subprocess, socket
-
-DBUS_INTERFACE_PROPERTIES='org.freedesktop.DBus.Properties'
-MM_DBUS_SERVICE='org.freedesktop.ModemManager'
-MM_DBUS_PATH='/org/freedesktop/ModemManager'
-MM_DBUS_INTERFACE='org.freedesktop.ModemManager'
-MM_DBUS_INTERFACE_MODEM='org.freedesktop.ModemManager.Modem'
-MM_DBUS_INTERFACE_MODEM_CDMA='org.freedesktop.ModemManager.Modem.Cdma'
-MM_DBUS_INTERFACE_MODEM_GSM_CARD='org.freedesktop.ModemManager.Modem.Gsm.Card'
-MM_DBUS_INTERFACE_MODEM_GSM_NETWORK='org.freedesktop.ModemManager.Modem.Gsm.Network'
-MM_DBUS_INTERFACE_MODEM_SIMPLE='org.freedesktop.ModemManager.Modem.Simple'
-
-def get_cdma_band_class(band_class):
- if band_class == 1:
- return "800MHz"
- elif band_class == 2:
- return "1900MHz"
- else:
- return "Unknown"
-
-def get_reg_state(state):
- if state == 1:
- return "registered (roaming unknown)"
- elif state == 2:
- return "registered on home network"
- elif state == 3:
- return "registered on roaming network"
- else:
- return "unknown"
-
-def cdma_inspect(proxy, dump_private):
- cdma = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_CDMA)
-
- esn = "<private>"
- if dump_private:
- try:
- esn = cdma.GetEsn()
- except dbus.exceptions.DBusException:
- esn = "<unavailable>"
-
- print("")
- print("ESN: %s" % esn)
-
- try:
- (cdma_1x_state, evdo_state) = cdma.GetRegistrationState()
- print("1x State: %s" % get_reg_state (cdma_1x_state))
- print("EVDO State: %s" % get_reg_state (evdo_state))
- except dbus.exceptions.DBusException as e:
- print("Error reading registration state: %s" % e)
-
- try:
- quality = cdma.GetSignalQuality()
- print("Signal quality: %d" % quality)
- except dbus.exceptions.DBusException as e:
- print("Error reading signal quality: %s" % e)
-
- try:
- info = cdma.GetServingSystem()
- print("Class: %s" % get_cdma_band_class(info[0]))
- print("Band: %s" % info[1])
- print("SID: %d" % info[2])
- except dbus.exceptions.DBusException as e:
- print("Error reading serving system: %s" % e)
-
-def cdma_connect(proxy, user, password):
- # Modem.Simple interface
- simple = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_SIMPLE)
- try:
- simple.Connect({'number':"#777"}, timeout=92)
- print("\nConnected!")
- return True
- except Exception as e:
- print("Error connecting: %s" % e)
- return False
-
-
-def get_gsm_network_mode(modem):
- mode = modem.GetNetworkMode()
- if mode == 0x0:
- mode = "Unknown"
- elif mode == 0x1:
- mode = "Any"
- elif mode == 0x2:
- mode = "GPRS"
- elif mode == 0x4:
- mode = "EDGE"
- elif mode == 0x8:
- mode = "UMTS"
- elif mode == 0x10:
- mode = "HSDPA"
- elif mode == 0x20:
- mode = "2G Preferred"
- elif mode == 0x40:
- mode = "3G Preferred"
- elif mode == 0x80:
- mode = "2G Only"
- elif mode == 0x100:
- mode = "3G Only"
- elif mode == 0x200:
- mode = "HSUPA"
- elif mode == 0x400:
- mode = "HSPA"
- else:
- mode = "(Unknown)"
-
- print("Mode: %s" % mode)
-
-def get_gsm_band(modem):
- band = modem.GetBand()
- if band == 0x0:
- band = "Unknown"
- elif band == 0x1:
- band = "Any"
- elif band == 0x2:
- band = "EGSM (900 MHz)"
- elif band == 0x4:
- band = "DCS (1800 MHz)"
- elif band == 0x8:
- band = "PCS (1900 MHz)"
- elif band == 0x10:
- band = "G850 (850 MHz)"
- elif band == 0x20:
- band = "U2100 (WCSMA 2100 MHZ, Class I)"
- elif band == 0x40:
- band = "U1700 (WCDMA 3GPP UMTS1800 MHz, Class III)"
- elif band == 0x80:
- band = "17IV (WCDMA 3GPP AWS 1700/2100 MHz, Class IV)"
- elif band == 0x100:
- band = "U800 (WCDMA 3GPP UMTS800 MHz, Class VI)"
- elif band == 0x200:
- band = "U850 (WCDMA 3GPP UMT850 MHz, Class V)"
- elif band == 0x400:
- band = "U900 (WCDMA 3GPP UMTS900 MHz, Class VIII)"
- elif band == 0x800:
- band = "U17IX (WCDMA 3GPP UMTS MHz, Class IX)"
- else:
- band = "(invalid)"
-
- print("Band: %s" % band)
-
-
-def gsm_inspect(proxy, dump_private, do_scan):
- # Gsm.Card interface
- card = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_GSM_CARD)
-
- imei = "<private>"
- imsi = "<private>"
- if dump_private:
- try:
- imei = card.GetImei()
- except dbus.exceptions.DBusException:
- imei = "<unavailable>"
- try:
- imsi = card.GetImsi()
- except dbus.exceptions.DBusException:
- imsi = "<unavailable>"
-
- print("IMEI: %s" % imei)
- print("IMSI: %s" % imsi)
-
- # Gsm.Network interface
- net = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_GSM_NETWORK)
- try:
- quality = net.GetSignalQuality()
- print("Signal quality: %d" % quality)
- except dbus.exceptions.DBusException as e:
- print("Error reading signal quality: %s" % e)
-
- if not do_scan:
- return
-
- print("Scanning...")
- try:
- results = net.Scan(timeout=120)
- except dbus.exceptions.DBusException as e:
- print("Error scanning: %s" % e)
- results = {}
-
- for r in results:
- status = r['status']
- if status == "1":
- status = "available"
- elif status == "2":
- status = "current"
- elif status == "3":
- status = "forbidden"
- else:
- status = "(Unknown)"
-
- access_tech = ""
- try:
- access_tech_num = r['access-tech']
- if access_tech_num == "0":
- access_tech = "(GSM)"
- elif access_tech_num == "1":
- access_tech = "(Compact GSM)"
- elif access_tech_num == "2":
- access_tech = "(UMTS)"
- elif access_tech_num == "3":
- access_tech = "(EDGE)"
- elif access_tech_num == "4":
- access_tech = "(HSDPA)"
- elif access_tech_num == "5":
- access_tech = "(HSUPA)"
- elif access_tech_num == "6":
- access_tech = "(HSPA)"
- except KeyError:
- pass
-
- if 'operator-long' in r and len(r['operator-long']):
- print("%s: %s %s" % (r['operator-long'], status, access_tech))
- elif 'operator-short' in r and len(r['operator-short']):
- print("%s: %s %s" % (r['operator-short'], status, access_tech))
- else:
- print("%s: %s %s" % (r['operator-num'], status, access_tech))
-
-def gsm_connect(proxy, apn, user, password):
- # Modem.Simple interface
- simple = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_SIMPLE)
- try:
- opts = {'number':"*99#"}
- if apn is not None:
- opts['apn'] = apn
- if user is not None:
- opts['username'] = user
- if password is not None:
- opts['password'] = password
- simple.Connect(opts, timeout=120)
- print("\nConnected!")
- return True
- except Exception as e:
- print("Error connecting: %s" % e)
- return False
-
-def pppd_find():
- paths = ["/usr/local/sbin/pppd", "/usr/sbin/pppd", "/sbin/pppd"]
- for p in paths:
- if os.path.exists(p):
- return p
- return None
-
-def ppp_start(device, user, password, tmpfile):
- path = pppd_find()
- if not path:
- return None
-
- args = [path]
- args += ["nodetach"]
- args += ["lock"]
- args += ["nodefaultroute"]
- args += ["debug"]
- if user:
- args += ["user"]
- args += [user]
- args += ["noipdefault"]
- args += ["115200"]
- args += ["noauth"]
- args += ["crtscts"]
- args += ["modem"]
- args += ["usepeerdns"]
- args += ["ipparam"]
-
- ipparam = ""
- if user:
- ipparam += user
- ipparam += "+"
- if password:
- ipparam += password
- ipparam += "+"
- ipparam += tmpfile
- args += [ipparam]
-
- args += ["plugin"]
- args += ["mm-test-pppd-plugin.so"]
-
- args += [device]
-
- return subprocess.Popen(args, close_fds=True, cwd="/", env={})
-
-def ppp_wait(p, tmpfile):
- i = 0
- while p.poll() == None and i < 30:
- time.sleep(1)
- if os.path.exists(tmpfile):
- f = open(tmpfile, 'r')
- stuff = f.read(500)
- idx = string.find(stuff, "DONE")
- f.close()
- if idx >= 0:
- return True
- i += 1
- return False
-
-def ppp_stop(p):
- import signal
- p.send_signal(signal.SIGTERM)
- p.wait()
-
-def ntop_helper(ip):
- ip = socket.ntohl(ip)
- n1 = ip >> 24 & 0xFF
- n2 = ip >> 16 & 0xFF
- n3 = ip >> 8 & 0xFF
- n4 = ip & 0xFF
- a = "%c%c%c%c" % (n1, n2, n3, n4)
- return socket.inet_ntop(socket.AF_INET, a)
-
-def static_start(iface, modem):
- (addr_num, dns1_num, dns2_num, dns3_num) = modem.GetIP4Config()
- addr = ntop_helper(addr_num)
- dns1 = ntop_helper(dns1_num)
- dns2 = ntop_helper(dns2_num)
- configure_iface(iface, addr, 0, dns1, dns2)
-
-def down_iface(iface):
- ip = ["ip", "addr", "flush", "dev", iface]
- print(" ".join(ip))
- subprocess.call(ip)
- ip = ["ip", "link", "set", iface, "down"]
- print(" ".join(ip))
- subprocess.call(ip)
-
-def configure_iface(iface, addr, gw, dns1, dns2):
- print("\n\n******************************")
- print("iface: %s" % iface)
- print("addr: %s" % addr)
- print("gw: %s" % gw)
- print("dns1: %s" % dns1)
- print("dns2: %s" % dns2)
-
- ifconfig = ["ifconfig", iface, "%s/32" % addr]
- if gw != 0:
- ifconfig += ["pointopoint", gw]
- print(" ".join(ifconfig))
- print("\n******************************\n")
-
- subprocess.call(ifconfig)
-
-def file_configure_iface(tmpfile):
- addr = None
- gw = None
- iface = None
- dns1 = None
- dns2 = None
-
- f = open(tmpfile, 'r')
- lines = f.readlines()
- for l in lines:
- if l.startswith("addr"):
- addr = l[len("addr"):].strip()
- if l.startswith("gateway"):
- gw = l[len("gateway"):].strip()
- if l.startswith("iface"):
- iface = l[len("iface"):].strip()
- if l.startswith("dns1"):
- dns1 = l[len("dns1"):].strip()
- if l.startswith("dns2"):
- dns2 = l[len("dns2"):].strip()
- f.close()
-
- configure_iface(iface, addr, gw, dns1, dns2)
- return iface
-
-def try_ping(iface):
- cmd = ["ping", "-I", iface, "-c", "4", "-i", "3", "-w", "20", "4.2.2.1"]
- print(" ".join(cmd))
- retcode = subprocess.call(cmd)
- if retcode != 0:
- print("PING: failed")
- else:
- print("PING: success")
-
-
-dump_private = False
-connect = False
-apn = None
-user = None
-password = None
-do_ip = False
-do_scan = True
-x = 1
-while x < len(sys.argv):
- if sys.argv[x] == "--private":
- dump_private = True
- elif sys.argv[x] == "--connect":
- connect = True
- elif (sys.argv[x] == "--user" or sys.argv[x] == "--username"):
- x += 1
- user = sys.argv[x]
- elif sys.argv[x] == "--apn":
- x += 1
- apn = sys.argv[x]
- elif sys.argv[x] == "--password":
- x += 1
- password = sys.argv[x]
- elif sys.argv[x] == "--ip":
- do_ip = True
- if os.geteuid() != 0:
- print("You probably want to be root to use --ip")
- sys.exit(1)
- elif sys.argv[x] == "--no-scan":
- do_scan = False
- x += 1
-
-bus = dbus.SystemBus()
-
-# Get available modems:
-try:
- manager_proxy = bus.get_object('org.freedesktop.ModemManager', '/org/freedesktop/ModemManager')
- manager_iface = dbus.Interface(manager_proxy, dbus_interface='org.freedesktop.ModemManager')
- modems = manager_iface.EnumerateDevices()
-except dbus.exceptions.DBusException as excp:
- if (excp.get_dbus_name() == "org.freedesktop.DBus.Error.ServiceUnknown"):
- print("ERROR: mm-test doesn't work on ModemManager 1.0 and newer: {}".format(
- excp.get_dbus_message()))
- else:
- print("ERROR: {}".format(excp.get_dbus_message()))
- sys.exit(1)
-if not modems:
- print("No modems found")
- sys.exit(1)
-
-for m in modems:
- connect_success = False
- data_device = None
-
- proxy = bus.get_object(MM_DBUS_SERVICE, m)
-
- # Properties
- props_iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.DBus.Properties')
-
- type = props_iface.Get(MM_DBUS_INTERFACE_MODEM, 'Type')
- if type == 1:
- print("GSM modem")
- elif type == 2:
- print("CDMA modem")
- else:
- print("Invalid modem type: %d" % type)
-
- print("Driver: '%s'" % (props_iface.Get(MM_DBUS_INTERFACE_MODEM, 'Driver')))
- print("Modem device: '%s'" % (props_iface.Get(MM_DBUS_INTERFACE_MODEM, 'MasterDevice')))
- data_device = props_iface.Get(MM_DBUS_INTERFACE_MODEM, 'Device')
- print("Data device: '%s'" % data_device)
-
- # Modem interface
- modem = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM)
-
- try:
- modem.Enable(True)
- except dbus.exceptions.DBusException as e:
- print("Error enabling modem: %s" % e)
- sys.exit(1)
-
- info = modem.GetInfo()
- print("Vendor: %s" % info[0])
- print("Model: %s" % info[1])
- print("Version: %s" % info[2])
-
- if type == 1:
- gsm_inspect(proxy, dump_private, do_scan)
- if connect == True:
- connect_success = gsm_connect(proxy, apn, user, password)
- elif type == 2:
- cdma_inspect(proxy, dump_private)
- if connect == True:
- connect_success = cdma_connect(proxy, user, password)
- print()
-
- if connect_success and do_ip:
- tmpfile = "/tmp/mm-test-%d.tmp" % os.getpid()
- success = False
- try:
- ip_method = props_iface.Get(MM_DBUS_INTERFACE_MODEM, 'IpMethod')
- if ip_method == 0:
- # ppp
- p = ppp_start(data_device, user, password, tmpfile)
- if ppp_wait(p, tmpfile):
- data_device = file_configure_iface(tmpfile)
- success = True
- elif ip_method == 1:
- # static
- static_start(data_device, modem)
- success = True
- elif ip_method == 2:
- # dhcp
- pass
- except Exception as e:
- print("Error setting up IP: %s" % e)
-
- if success:
- try_ping(data_device)
- print("Waiting for 30s...")
- time.sleep(30)
-
- print("Disconnecting...")
- try:
- if ip_method == 0:
- ppp_stop(p)
- try:
- os.remove(tmpfile)
- except:
- pass
- elif ip_method == 1:
- # static
- down_iface(data_device)
- elif ip_method == 2:
- # dhcp
- down_iface(data_device)
-
- modem.Disconnect()
- except Exception as e:
- print("Error tearing down IP: %s" % e)
-
- time.sleep(5)
-
- modem.Enable(False)
-
diff --git a/bin/net_driver_info b/bin/net_driver_info.py
index 05585ba..05585ba 100755
--- a/bin/net_driver_info
+++ b/bin/net_driver_info.py
diff --git a/bin/network b/bin/network.py
index fea7f72..a646f9c 100755
--- a/bin/network
+++ b/bin/network.py
@@ -710,17 +710,17 @@ This script provides benchmarking and information for a specified network
interface.
Example NIC information usage:
-network info -i eth0 --max-speed
+network.py info -i eth0 --max-speed
For running iperf test:
-network test -i eth0 -t iperf --target 192.168.0.1
+network.py test -i eth0 -t iperf --target 192.168.0.1
NOTE: The iperf test requires an iperf server running on the same network
segment that the test machine is running on.
Also, you can use iperf3 rather than iperf2 by specifying the -3 or --iperf3
option like so:
-network test -i eth0 -t iperf -3 --target 192.168.0.1
+network.py test -i eth0 -t iperf -3 --target 192.168.0.1
Configuration
=============
diff --git a/bin/network_check b/bin/network_check.py
index 82c00d9..82c00d9 100755
--- a/bin/network_check
+++ b/bin/network_check.py
diff --git a/bin/network_configs b/bin/network_configs.sh
index b2fcc99..b2fcc99 100755
--- a/bin/network_configs
+++ b/bin/network_configs.sh
diff --git a/bin/network_ntp_test b/bin/network_ntp_test.py
index 6e2ccf8..6e2ccf8 100755
--- a/bin/network_ntp_test
+++ b/bin/network_ntp_test.py
diff --git a/bin/network_predictable_names b/bin/network_predictable_names.sh
index 20c52df..31cf49f 100755
--- a/bin/network_predictable_names
+++ b/bin/network_predictable_names.sh
@@ -26,7 +26,7 @@ set -e
# https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
#
# Usage:
-# network_predictable_names
+# network_predictable_names.sh
#
# Parameters:
# None
diff --git a/bin/network_printer_test b/bin/network_printer_test.sh
index 19d98d2..19d98d2 100755
--- a/bin/network_printer_test
+++ b/bin/network_printer_test.sh
diff --git a/bin/network_reconnect_resume_test b/bin/network_reconnect_resume_test.py
index 8861eb6..8861eb6 100755
--- a/bin/network_reconnect_resume_test
+++ b/bin/network_reconnect_resume_test.py
diff --git a/bin/network_restart b/bin/network_restart.py
index d01e983..14c7357 100755
--- a/bin/network_restart
+++ b/bin/network_restart.py
@@ -327,8 +327,9 @@ def configure_logging(log_level, output):
logger.addHandler(log_handler)
# Log to rotating file using DEBUG log level
- log_filename = os.path.join(output,
- '{0}.log'.format(os.path.basename(__file__)))
+ log_filename = os.path.join(
+ output,
+ '{0}.log'.format(os.path.splitext(os.path.basename(__file__))[0]))
rollover = os.path.exists(log_filename)
log_handler = logging.handlers.RotatingFileHandler(log_filename, mode='a+',
backupCount=3)
diff --git a/bin/network_wait b/bin/network_wait.sh
index f0637d0..f0637d0 100755
--- a/bin/network_wait
+++ b/bin/network_wait.sh
diff --git a/bin/nvidia_nvlink_check b/bin/nvidia_nvlink_check.sh
index cb58079..cb58079 100755
--- a/bin/nvidia_nvlink_check
+++ b/bin/nvidia_nvlink_check.sh
diff --git a/bin/optical_detect b/bin/optical_detect
deleted file mode 100755
index f1fe94b..0000000
--- a/bin/optical_detect
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import re
-import sys
-
-
-def main(args):
- line_pattern = r"\s*(\d+)\s+dev='([^']+)'" \
- "\s+([wr-]{6})\s:\s'([^']+)'\s'([^']+)'"
- line_regex = re.compile(line_pattern)
-
- count = 0
- command = "wodim --devices"
- for line in os.popen(command).readlines():
- match = re.match(line_regex, line)
- if match:
- count += 1
- print(match.group(4), match.group(5))
-
- if not count:
- print("No optical devices detected.", file=sys.stderr)
- return 1
-
- return 0
-
-
-if __name__ == "__main__":
- sys.exit(main(sys.argv[1:]))
diff --git a/bin/optical_read_test b/bin/optical_read_test.py
index b3cf23d..b3cf23d 100755
--- a/bin/optical_read_test
+++ b/bin/optical_read_test.py
diff --git a/bin/optical_write_test b/bin/optical_write_test.sh
index b127667..b127667 100755
--- a/bin/optical_write_test
+++ b/bin/optical_write_test.sh
diff --git a/bin/pm_log_check b/bin/pm_log_check.py
index cb75685..cb75685 100755
--- a/bin/pm_log_check
+++ b/bin/pm_log_check.py
diff --git a/bin/pm_test b/bin/pm_test.py
index 066f757..18cf97c 100755
--- a/bin/pm_test
+++ b/bin/pm_test.py
@@ -194,7 +194,7 @@ class PowerManagementOperation():
self.args.log_dir) + command_tpl
command_tpl = '{} ' + command_tpl
else:
- script_name = 'sleep_test'
+ script_name = 'sleep_test.py'
command_tpl = '{} -s mem -p -i {} -w 10'
script_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)), script_name)
@@ -208,9 +208,9 @@ class PowerManagementOperation():
input()
else:
try:
- # We call sleep_test or fwts_test script and log its output as
- # it contains average times we need to compute global average
- # times later.
+ # We call sleep_test.py or fwts_test script and log its output
+ # as it contains average times we need to compute global
+ # average times later.
logging.info(subprocess.check_output(
command_str, universal_newlines=True, shell=True))
except subprocess.CalledProcessError as e:
@@ -611,7 +611,7 @@ class CountdownDialog(Gtk.Dialog):
command = Command('fwts -r stdout klog oops').run()
if command.process.returncode != 0:
# Don't abort the test loop,
- # errors can be retrieved by pm_log_check
+ # errors can be retrieved by pm_log_check.py
logging.error('Problem found in logs by fwts')
def on_system_info_timeout_cb(self):
@@ -1007,11 +1007,12 @@ class MyArgumentParser():
# Log filename shows clearly the type of test (pm_operation)
# and the times it was repeated (repetitions)
- args.log_filename = os.path.join(args.log_dir,
- ('{0}.{1}.{2}.log'
- .format(os.path.basename(__file__),
- args.pm_operation,
- args.total)))
+ args.log_filename = os.path.join(
+ args.log_dir,
+ '{0}.{1}.{2}.log'.format(
+ os.path.splitext(os.path.basename(__file__))[0],
+ args.pm_operation,
+ args.total)))
return args, extra_args
diff --git a/bin/process_wait b/bin/process_wait.py
index 6107d1b..6107d1b 100755
--- a/bin/process_wait
+++ b/bin/process_wait.py
diff --git a/bin/pts_run b/bin/pts_run
deleted file mode 100755
index 76921e8..0000000
--- a/bin/pts_run
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-# Exit on any error
-set -o errexit
-
-# Accept Terms & Conditions, disable anonymous reporting
-echo -e "Y\nn\nn" | phoronix-test-suite > /dev/null
-
-# Disable batch result saving and all test options selection
-echo -e "n\nn" | phoronix-test-suite batch-setup > /dev/null
-
-# Don't show the browser after each test.
-# The implementation is a bit hacky but works.
-phoronix-test-suite user-config-set DefaultBrowser=/bin/true
-
-# Run each test only one time
-export FORCE_TIMES_TO_RUN=1
-
-# Run only the following resolution
-export OVERRIDE_VIDEO_MODES=800x600
-
-set +o errexit
-rv=0
-output=$(phoronix-test-suite batch-benchmark $@ 2>&1)
-#The output does NOT report success. It may contain, if it fails:
-# The test did not produce a result
-# The test failed to run properly
-# Failed to Fetch
-
-if (echo "$output" | grep -q -i "Failed to fetch" ); then
- rv=1
-fi
-if ( echo "$output" | grep -q -i 'This test failed to run properly'); then
- rv=1
-fi
-echo "$output"
-exit $rv
-
diff --git a/bin/pulse-active-port-change b/bin/pulse-active-port-change.py
index f2d9527..90abed8 100755
--- a/bin/pulse-active-port-change
+++ b/bin/pulse-active-port-change.py
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
"""
-pulse-active-port-change
+pulse-active-port-change.py
========================
This script checks if the active port on either sinks (speakers or headphones)
diff --git a/bin/removable_storage_test b/bin/removable_storage_test.py
index 82f1595..82f1595 100755
--- a/bin/removable_storage_test
+++ b/bin/removable_storage_test.py
diff --git a/bin/removable_storage_watcher b/bin/removable_storage_watcher.py
index d5a0722..d5a0722 100755
--- a/bin/removable_storage_watcher
+++ b/bin/removable_storage_watcher.py
diff --git a/bin/rendercheck_test b/bin/rendercheck_test
deleted file mode 100755
index 89e07e9..0000000
--- a/bin/rendercheck_test
+++ /dev/null
@@ -1,263 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#
-# rendercheck_test
-#
-# This file is part of Checkbox.
-#
-# Copyright 2012 Canonical Ltd.
-#
-# Authors: Alberto Milone <alberto.milone@canonical.com>
-#
-# Checkbox is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 3,
-# as published by the Free Software Foundation.
-
-#
-# Checkbox is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
-
-from subprocess import Popen, PIPE
-from argparse import ArgumentParser
-
-import logging
-import os
-import re
-import tempfile
-import errno
-
-
-class RenderCheck(object):
- """A simple class to run the rendercheck suites"""
-
- def __init__(self, temp_dir=None):
- self._temp_dir = temp_dir
-
- def _print_test_info(self, suites='all', iteration=1, show_errors=False):
- '''Print the output of the test suite'''
-
- main_command = 'rendercheck'
- passed = 0
- total = 0
-
- if self._temp_dir:
- # Use the specified path
- temp_file = tempfile.NamedTemporaryFile(dir=self._temp_dir,
- delete=False)
- else:
- # Use /tmp
- temp_file = tempfile.NamedTemporaryFile(delete=False)
-
- if suites == all:
- full_command = [main_command, '-f', 'a8r8g8b8']
- else:
- full_command = [main_command, '-t', suites, '-f', 'a8r8g8b8']
-
- try:
- # Let's dump the output into file as it can be very large
- # and we don't want to store it in memory
- process = Popen(full_command, stdout=temp_file,
- universal_newlines=True)
- except OSError as exc:
- if exc.errno == errno.ENOENT:
- logging.error('Error: please make sure that rendercheck '
- 'is installed.')
- exit(1)
- else:
- raise
-
- exit_code = process.wait()
-
- temp_file.close()
-
- # Read values from the file
- errors = re.compile('.*test error.*')
- results = re.compile('(.+) tests passed of (.+) total.*')
-
- first_error = True
- with open(temp_file.name) as temp_handle:
- for line in temp_handle:
- match_output = results.match(line)
- match_errors = errors.match(line)
- if match_output:
- passed = int(match_output.group(1).strip())
- total = int(match_output.group(2).strip())
- logging.info('Results:')
- logging.info(' %d tests passed out of %d.'
- % (passed, total))
- if show_errors and match_errors:
- error = match_errors.group(0).strip()
- if first_error:
- logging.debug('Rendercheck %s suite errors '
- 'from iteration %d:'
- % (suites, iteration))
- first_error = False
- logging.debug(' %s' % error)
-
- # Remove the file
- os.unlink(temp_file.name)
-
- return (exit_code, passed, total)
-
- def run_test(self, suites=[], iterations=1, show_errors=False):
- exit_status = 0
- for suite in suites:
- for it in range(iterations):
- logging.info('Iteration %d of Rendercheck %s suite...'
- % (it + 1, suite))
- (status, passed, total) = \
- self._print_test_info(suites=suite,
- iteration=it + 1,
- show_errors=show_errors)
- if status != 0:
- # Make sure to catch a non-zero exit status
- logging.info('Iteration %d of Rendercheck %s suite '
- 'exited with status %d.'
- % (it + 1, suite, status))
- exit_status = status
- it += 1
-
- # exit with 1 if passed < total
- if passed < total:
- if exit_status == 0:
- exit_status = 1
- return exit_status
-
- def get_suites_list(self):
- '''Return a list of the available test suites'''
- try:
- process = Popen(['rendercheck', '--help'], stdout=PIPE,
- stderr=PIPE, universal_newlines=True)
- except OSError as exc:
- if exc.errno == errno.ENOENT:
- logging.error('Error: please make sure that rendercheck '
- 'is installed.')
- exit(1)
- else:
- raise
-
- proc = process.communicate()[1].split('\n')
- found = False
- tests_pattern = re.compile('.*Available tests: *(.+).*')
- temp_line = ''
- tests = []
- for line in proc:
- if found:
- temp_line += line
- match = tests_pattern.match(line)
- if match:
- first_line = match.group(1).strip().lower()
- found = True
- temp_line += first_line
- for elem in temp_line.split(','):
- test = elem.strip()
- if elem:
- tests.append(test)
- return tests
-
-
-def main():
- usage = 'Usage: %prog [OPTIONS]'
- all_tests = RenderCheck().get_suites_list()
-
- parser = ArgumentParser(usage)
- parser.add_argument('-i', '--iterations',
- type=int,
- default=1,
- help='The number of times to run the test. \
- Default is 1')
- parser.add_argument('-t', '--test',
- default='all',
- help='The name of the test suit to run. \
- Available tests: \
- %s. \
- Default is all' % (', '.join(all_tests)))
- parser.add_argument('-b', '--blacklist',
- action='append',
- help='The name of a test which should not be run.')
- parser.add_argument('-d', '--debug',
- action='store_true',
- help='Choose this to add verbose output \
- for debug purposes')
- parser.add_argument('-o', '--output',
- default='',
- help='The path to the log which will be dumped. \
- Default is stdout')
- parser.add_argument('-tp', '--temp',
- default='',
- help='The path where to store temporary files. \
- Default is /tmp')
- args = parser.parse_args()
-
- # Set up logging to console
- format = '%(message)s'
-
- console_handler = logging.StreamHandler()
- console_handler.setFormatter(logging.Formatter(format))
-
- # Set up the overall logger
- logger = logging.getLogger()
- # This is necessary to ensure debug messages are passed through the logger
- # to the handler
- logger.setLevel(logging.DEBUG)
-
- # This is what happens when -d and/or -o are passed:
- # -o -> stdout (info) - log (info)
- # -d -> only stdout (info and debug) - no log
- # -d -o -> stdout (info) - log (info and debug)
-
- # Write to a log
- if args.output:
- # Write INFO to stdout
- console_handler.setLevel(logging.INFO)
- logger.addHandler(console_handler)
- # Specify a log file
- logfile = args.output
- logfile_handler = logging.FileHandler(logfile)
- if args.debug:
- # Write INFO and DEBUG to a log
- logfile_handler.setLevel(logging.DEBUG)
- else:
- # Write INFO to a log
- logfile_handler.setLevel(logging.INFO)
-
- logfile_handler.setFormatter(logging.Formatter(format))
- logger.addHandler(logfile_handler)
- log_path = os.path.abspath(logfile)
- logging.info("The log can be found at %s" % log_path)
-
- # Write only to stdout
- else:
- if args.debug:
- # Write INFO and DEBUG to stdout
- console_handler.setLevel(logging.DEBUG)
- logger.addHandler(console_handler)
- else:
- # Write INFO to stdout
- console_handler.setLevel(logging.INFO)
- logger.addHandler(console_handler)
-
- exit_status = 0
-
- if args.test == 'all':
- tests = all_tests
- else:
- tests = args.test.split(',')
-
- for test in args.blacklist:
- if test in tests:
- tests.remove(test)
-
- rendercheck = RenderCheck(args.temp)
- exit_status = rendercheck.run_test(tests, args.iterations,
- args.debug)
-
- exit(exit_status)
-
-if __name__ == '__main__':
- main()
diff --git a/bin/resolution_test b/bin/resolution_test.py
index 55a7828..55a7828 100755
--- a/bin/resolution_test
+++ b/bin/resolution_test.py
diff --git a/bin/rotation_test b/bin/rotation_test.py
index 6bf90fd..6bf90fd 100755
--- a/bin/rotation_test
+++ b/bin/rotation_test.py
diff --git a/bin/rotation_test_using_dbus b/bin/rotation_test_using_dbus
deleted file mode 100755
index 9e62daa..0000000
--- a/bin/rotation_test_using_dbus
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-#
-# rotation_test_using_dbus
-#
-# This script is used to trigger a main screen rotation directly from DBUS to
-# simulate the way screen rotation is done when using System Settings screen.
-# Indeed, when using xrandr command or Python lib, we sometimes have weird
-# behaviours, specifically when used with NVidia cards with proprietary drivers.
-#
-# This file is part of Checkbox.
-#
-# Copyright 2015 Canonical Ltd.
-#
-# Authors: Pierre Equoy <pierre.equoy@canonical.com>
-#
-# Checkbox is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 3,
-# as published by the Free Software Foundation.
-#
-# Checkbox is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
-
-
-rotate() {
- dbus-send --session --print-reply --dest=org.gnome.SettingsDaemon /org/gnome/SettingsDaemon/XRANDR org.gnome.SettingsDaemon.XRANDR_2.RotateTo int32:$1 int64:0 > /dev/null 2>&1
-}
-
-# Rotate the screen in-between the following modes and the normal mode:
-# 2 - left
-# 4 - inverted
-# 8 - right
-# 1 - normal
-for i in 2 1 4 1 8 1
-do
- rotate $i
- sleep 4
-done
-
-# Rotate one more time to "normal" so next time we logout/login,
-# the screen will be set in normal mode.
-rotate 1
-
diff --git a/bin/samba_test b/bin/samba_test
deleted file mode 100755
index a9a0bfe..0000000
--- a/bin/samba_test
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# Confirm Samba service is running
-# Requires: samba winbind
-#
-
-#Verify Samba processes are running
-smbd=`pgrep smbd`
-if [ -z "$smbd" ]; then
- echo "FAIL: smbd is not running."
- exit 1
-fi
-
-nmbd=`pgrep nmbd`
-if [ -z "$nmbd" ]; then
- echo "FAIL: nmbd is not running."
- exit 1
-fi
-
-winbindd=`pgrep winbindd`
-if [ -z "$winbindd" ]; then
- echo "FAIL: winbindd is not running."
- exit 1
-fi
-
-sid=`net getlocalsid | grep "S-1-5"` #req. root
-if [ -z "$sid" ]; then
- echo "FAIL: Default samba workgroup is not set."
- exit 1
-fi
-
-users=`net usersidlist | grep "UBUNTU"`
-if [ -z "$sid" ]; then
- echo "FAIL: samba userId is not set."
- exit 1
-fi
-
-exit 0
diff --git a/bin/sleep_test b/bin/sleep_test.py
index 423fd6c..423fd6c 100755
--- a/bin/sleep_test
+++ b/bin/sleep_test.py
diff --git a/bin/sleep_test_log_check b/bin/sleep_test_log_check.py
index aae7556..aae7556 100755
--- a/bin/sleep_test_log_check
+++ b/bin/sleep_test_log_check.py
diff --git a/bin/sleep_time_check b/bin/sleep_time_check.py
index f9513fa..f9513fa 100755
--- a/bin/sleep_time_check
+++ b/bin/sleep_time_check.py
diff --git a/bin/sources_test b/bin/sources_test.sh
index a63c5b9..a63c5b9 100755
--- a/bin/sources_test
+++ b/bin/sources_test.sh
diff --git a/bin/spindown b/bin/spindown.sh
index bb8e0f4..bb8e0f4 100755
--- a/bin/spindown
+++ b/bin/spindown.sh
diff --git a/bin/stress_ng_test b/bin/stress_ng_test.py
index b8c2586..b8c2586 100755
--- a/bin/stress_ng_test
+++ b/bin/stress_ng_test.py
diff --git a/bin/system_info.py b/bin/system_info.py
index d03ae4a..95af6d4 100755
--- a/bin/system_info.py
+++ b/bin/system_info.py
@@ -224,7 +224,8 @@ def main():
'Touchpad': 'TOUCHPAD'
}
for section, udev_category in extra_sections.items():
- section_info = _run_cmd('udev_resource -l {} -s'.format(udev_category))
+ section_info = _run_cmd(
+ 'udev_resource.py -l {} -s'.format(udev_category))
if section_info:
sys_info[section] = section_info.splitlines()
print(json.dumps(sys_info, indent=4))
diff --git a/bin/test_bt_keyboard b/bin/test_bt_keyboard.py
index 1457a1d..1457a1d 100755
--- a/bin/test_bt_keyboard
+++ b/bin/test_bt_keyboard.py
diff --git a/bin/tomcat_test b/bin/tomcat_test
deleted file mode 100755
index 70cdb8c..0000000
--- a/bin/tomcat_test
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Confirm Tomcat server is running and working properly
-# Requires: tomcat6
-#
-
-# Check tomcat is running
-run1=`netstat -ltnp | grep '8080' | grep 'java'`
-if [ -z "$run1" ]; then
- echo "FAIL: Tomcat is not running."
- exit 1
-fi
-
-# Check if Tomcat is working; requires network connection so check it
-check=`ping -c 2 www.ubuntu.com |grep "2 received"`
-if [ -n "$check" ]; then
- work1=`w3m http://127.0.0.1:8080 | grep "works"`
- if [ -z "$work1" ]; then
- echo "FAIL: Tomcat is not working properly."
- exit 1
- fi
-fi
-
-exit 0
diff --git a/bin/touchpad_driver_info b/bin/touchpad_driver_info.py
index 431b874..431b874 100755
--- a/bin/touchpad_driver_info
+++ b/bin/touchpad_driver_info.py
diff --git a/bin/touchpad_test b/bin/touchpad_test.py
index bc6a474..bc6a474 100755
--- a/bin/touchpad_test
+++ b/bin/touchpad_test.py
diff --git a/bin/udisks2_monitor b/bin/udisks2_monitor
deleted file mode 100755
index 5b58a68..0000000
--- a/bin/udisks2_monitor
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/usr/bin/env python3
-# Copyright 2012 Canonical Ltd.
-# Written by:
-# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 3,
-# as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""
-Script that observes changes to various devices, as published by
-UDisks2. Note: this script has no UDisks (one) equivalent.
-"""
-
-import errno
-import logging
-import sys
-
-from checkbox_support.dbus import connect_to_system_bus, drop_dbus_type
-from checkbox_support.dbus.udisks2 import UDisks2Observer
-
-from dbus.exceptions import DBusException
-
-
-def _print_interfaces_and_properties(interfaces_and_properties):
- """
- Print a collection of interfaces and properties exported by some object
-
- The argument is the value of the dictionary _values_, as returned from
- GetManagedObjects() for example. See this for details:
- http://dbus.freedesktop.org/doc/dbus-specification.html#
- standard-interfaces-objectmanager
- """
- for interface_name, properties in interfaces_and_properties.items():
- print(" - Interface {}".format(interface_name))
- for prop_name, prop_value in properties.items():
- prop_value = drop_dbus_type(prop_value)
- print(" * Property {}: {}".format(prop_name, prop_value))
-
-
-def main():
- # Connect to the system bus, we also get the event
- # loop as we need it to start listening for signals.
- system_bus, loop = connect_to_system_bus()
-
- # Create an instance of the observer that we'll need for the model
- observer = UDisks2Observer()
-
- # Define all our callbacks in advance, there are three callbacks that we
- # need, for interface insertion/removal (which roughly corresponds to
- # objects/devices coming and going) and one extra signal that is only fired
- # once, when we get the initial list of objects.
-
- # Let's print everything we know about initially for the users to see
- def print_initial_objects(managed_objects):
- print("UDisks2 knows about the following objects:")
- for object_path, interfaces_and_properties in managed_objects.items():
- print(" * {}".format(object_path))
- _print_interfaces_and_properties(interfaces_and_properties)
- sys.stdout.flush()
- observer.on_initial_objects.connect(print_initial_objects)
-
- # Setup a callback for the InterfacesAdded signal. This way we will get
- # notified of any interface changes in this collection. In practice this
- # means that all objects that are added/removed will be advertised through
- # this mechanism
- def print_interfaces_added(object_path, interfaces_and_properties):
- print("The object:")
- print(" {}".format(object_path))
- print("has gained the following interfaces and properties:")
- _print_interfaces_and_properties(interfaces_and_properties)
- sys.stdout.flush()
- observer.on_interfaces_added.connect(print_interfaces_added)
-
- # Setup a callback on PropertiesChanged signal. This way we will get
- # notified on any changes to the values of properties exported by various
- # objects on the bus.
- def print_properties_changed(object_path, interface_name,
- changed_properties, invalidated_properties):
- print("The object")
- print(" {}".format(object_path))
- print("has changed the following properties")
- print(" - Interface {}".format(interface_name))
- for prop_name, prop_value in changed_properties.items():
- prop_value = drop_dbus_type(prop_value)
- print(" * Property {}: {}".format(prop_name, prop_value))
- for prop_name in invalidated_properties:
- print(" * Property {} (invalidated)".format(prop_name))
- observer.on_properties_changed.connect(print_properties_changed)
-
- # Again, a similar callback for interfaces that go away. It's not spelled
- # out explicitly but it seems that objects with no interfaces left are
- # simply gone. We'll treat them as such
- def print_interfaces_removed(object_path, interfaces):
- print("The object:")
- print(" {}".format(object_path))
- print("has lost the following interfaces:")
- for interface in interfaces:
- print(" * {}".format(interface))
- sys.stdout.flush()
- observer.on_interfaces_removed.connect(print_interfaces_removed)
-
- # Now that all signal handlers are set, connect the observer to the system
- # bus
- try:
- logging.debug("Connecting UDisks2 observer to DBus")
- observer.connect_to_bus(system_bus)
- except DBusException as exc:
- # Manage the missing service error if needed to give sensible error
- # message on precise where UDisks2 is not available
- if exc.get_dbus_name() == "org.freedesktop.DBus.Error.ServiceUnknown":
- print("You need to have udisks2 installed to run this program")
- print("It is only applicable to Ubuntu 12.10, or later")
- raise SystemExit(1)
- else:
- raise # main_shield() will catch this one
-
- # Now start the event loop and just display any device changes
- print("=" * 80)
- print("Waiting for device changes (press ctlr+c to exit)")
- print("=" * 80)
- logging.debug("Entering event loop")
- sys.stdout.flush() # Explicitly flush to allow tee users to see things
- try:
- loop.run()
- except KeyboardInterrupt:
- loop.quit()
- print("Exiting")
-
-
-def main_shield():
- """
- Helper for real main that manages exceptions we don't recover from
- """
- try:
- main()
- except DBusException as exc:
- logging.exception("Caught fatal DBus exception, aborting")
- except IOError as exc:
- # Ignore pipe errors as they are harmless
- if exc.errno != errno.EPIPE:
- raise
-
-
-if __name__ == "__main__":
- main_shield()
diff --git a/bin/virtualization b/bin/virtualization.py
index 2b7cd54..2b7cd54 100755
--- a/bin/virtualization
+++ b/bin/virtualization.py
diff --git a/bin/volume_test b/bin/volume_test.py
index a949f93..a949f93 100755
--- a/bin/volume_test
+++ b/bin/volume_test.py
diff --git a/bin/wifi_client_test b/bin/wifi_client_test.py
index 6868847..2f17974 100755
--- a/bin/wifi_client_test
+++ b/bin/wifi_client_test.py
@@ -8,7 +8,7 @@
"""
This script will run wireless network test automatically.
-To see how to use, please run "./wifi_client_test --help"
+To see how to use, please run "./wifi_client_test.py --help"
"""
import argparse
import os
diff --git a/bin/wifi_time2reconnect b/bin/wifi_time2reconnect.py
index d4ae2c0..d4ae2c0 100755
--- a/bin/wifi_time2reconnect
+++ b/bin/wifi_time2reconnect.py
diff --git a/bin/window_test b/bin/window_test.py
index 23b6f3b..ee79a89 100755
--- a/bin/window_test
+++ b/bin/window_test.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
-# window_test
+# window_test.py
#
# This file is part of Checkbox.
#
diff --git a/bin/xen_test b/bin/xen_test
deleted file mode 100755
index ed237c5..0000000
--- a/bin/xen_test
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-## Xen Testing
-## Script to make and fire off some pre-made VMs to test the hypervisor
-## under a bit of simulated load
-##
-## USAGE: xentest.sh /path/to/ORIGINAL_IMAGE /path/to/ORIGINAL_CONFIG
-##
-## this is a kludge and a dirty, dirty hack and shoud die an ignomious
-## death soon. A more elegant solution would be to modify the script
-## /usr/share/checkbox/scripts/virtualization and add the missing Xen
-## functionality. But this will do as a first pass.
-
-ORIGINAL_VM=$1
-ORIGINAL_VM_TEMPLATE=$2
-VIRSH_CMD='virsh -c xen:///'
-CLONE_CMD='virt-clone'
-VM_NAME_BASE='xentest-vm'
-
-# First, figure out how many CPUs we have:
-#CPU_CORES=`xm dmesg | grep -c "(XEN) Processor #"`
-CPU_CORES=1
-
-# Verify our image and config file are present
-if [ ! -e $ORIGINAL_VM ]; then
- echo "Xen VM Image not found!" >&2
- exit 1
-fi
-if [ ! -e $ORIGINAL_VM_TEMPLATE ]; then
- echo "Xen VM Config File not found!" >&2
- exit 1
-fi
-
-#Clone those suckers enough that we have 2 VMs per core and LAUNCH!
-VM_TOTAL=$((CPU_CORES*2))
-
-#Set up an assoticative array (this would translate much better into
-#a simple python list later on, hint hint)
-declare -A VM_NAMES
-
-echo "Starting $VM_TOTAL VM clones" >&2
-for vm in `seq 1 $VM_TOTAL`; do
- VM_NAME="$VM_NAME_BASE$vm"
- VM_NAMES[$vm]=$VM_NAME
- echo "Cloning vm $vm" >&2
- $CLONE_CMD --original-xml=$ORIGINAL_VM_TEMPLATE -n $VM_NAME -f /vms/$VM_NAME.img --force >&2
- echo "Starting vm $vm" >&2
- $VIRSH_CMD start $VM_NAME
-done
-
-#Lets wait a few minutes to let them do some work
-echo "Sleeping for 5 miunutes to let VMs boot and start working" >&2
-sleep 5m
-echo "" >&2
-#Now verify the VMs are still running
-fail=false
-echo "Checking domU state..." >&2
-for vm in `seq 1 $VM_TOTAL`; do
- state=`$VIRSH_CMD domstate ${VM_NAMES[$vm]}`
- echo "${VM_NAMES[$vm]}: $state" >&2
- if [ "$state" != "running" ]; then
- fail=true
- echo "VM $vm is not in running state!" >&2
- fi
-done
-
-if $fail; then
- echo "One or more guests is not in the running state after 5 minutes." >&2
- echo "Test Fails" >&2
- exit 1
-else
- echo "All guests seem to be running correctly"
-fi
-
-exit 0
diff --git a/bin/xrandr_cycle b/bin/xrandr_cycle.py
index 6743f6f..6743f6f 100755
--- a/bin/xrandr_cycle
+++ b/bin/xrandr_cycle.py