~brendan-donegan/checkbox/bug1085219

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
plugin: shell
name: networking/detect
requires:
 device.category == 'NETWORK' or device.category == 'WIRELESS'
 package.name == 'module-init-tools'
 package.name == 'pciutils'
command: network_device_info
_description: Test to detect the available network controllers

plugin: shell 
name: networking/internet
depends: networking/detect
command: internet_test
_description: Tests whether the system has a working Internet connection.

plugin: local
name: networking/info
requires: device.category == 'NETWORK'
_description: Network Information
command:
 cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=NETWORK" | awk "/path: / { print \$2 }" | xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do echo \$0 \$i; done"'
 plugin: manual
 name: networking/info_$2
 requires: device.path == "$1"
 command: network_info $2
 _description:
  PURPOSE:
      This test will check the different NIC
  STEPS:
      1. Please verify the following information for NIC $2
  INFO:
      $output
  VERIFICATION:
      Is this correct?
 EOF

plugin: shell 
name: networking/info_automated
requires: 
 package.name == 'network-manager'
 device.category == 'NETWORK'
command: udev_resource | filter_templates -w "category=WIRELESS" -w "category=NETWORK"| awk "/path: / { print \$2 }"| xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do network_info \$i; done"
_description:
 This is an automated test to gather some info on the current state of your network devices. If no devices are found, the test will exit with an error.

plugin: manual
name: networking/wired_connection
command: network_check
_description:
 PURPOSE:
     This test will check your wired connection
 STEPS:
     1. Click on the Network icon in the top panel
     2. Select a network below the "Wired network" section
     3. Click "Test" to verify that it's possible to establish a HTTP connection
 VERIFICATION:
     Did a notification show and was the connection correctly established?

plugin: manual
name: networking/modem_connection
command: network_check
_description:
 PURPOSE:
     This test will check that a DSL modem can be configured and connected.
 STEPS:
     1. Connect the telephone line to the computer
     2. Click on the Network icon on the top panel.
     3. Select "Edit Connections"
     4. Select the "DSL" tab
     5. Click on "Add" button
     6. Configure the connection parameters properly
     7. Click "Test" to verify that it's possible to establish an HTTP connection
 VERIFICATION:
     Did a notification show and was the connection correctly established?

plugin: shell
name: networking/ping
command: internet_test $CHECKBOX_SERVER
_description:
 Automated test case to verify availability of some system on the network
 using ICMP ECHO packets.

plugin: shell
name: networking/http
command: wget -SO /dev/null http://$TRANSFER_SERVER
_description:
 Automated test case to make sure that it's possible to download files through HTTP

plugin: shell
name: networking/ntp
requires: package.name == 'ntpdate'
user: root
command: network_ntp_test 
_description: Test to see if we can sync local clock to an NTP server

plugin: shell
name: networking/ssh
requires: package.name == 'openssh-client'
command: if [ $CHECKBOX_SERVER ]; then ssh -q -o 'StrictHostKeyChecking=no' -o "UserKnownHostsFile=/tmp/ssh_test_$$" -l ubuntu $CHECKBOX_SERVER "uname -a" && rm /tmp/ssh_test_$$; fi
_description: Verify that an installation of checkbox-server on the network can be reached over SSH.

plugin: shell
name: networking/printer
requires: package.name == 'cups-client'
command: network_printer_test -s $CHECKBOX_SERVER
_description: Try to enable a remote printer on the network and print a test page.

plugin: local
name: networking/multi_nic
requires: device.category == 'NETWORK'
_description: Automated test to walk multiple network cards and test each one in sequence.
command:
 cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=NETWORK" | awk "/path: / { print \$2 }" | xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do echo \$0 \$i; done"'
 plugin: shell
 name: networking/multi_nic_$2
 requires:
  package.name == 'ethtool' and package.name == 'nmap'
  device.path == "$1"
 user: root
 command: ethtool $2 | tail -1 | grep "detected: yes" && network_bandwidth_test --interface=$2 --scan=3 --log-level=debug || ( echo "ERROR: $2 is either not configured or not connected." >&2 && exit 1 )
 description:
  Testing for NIC $2
 EOF