summaryrefslogtreecommitdiff
path: root/units/wireless
diff options
Diffstat (limited to 'units/wireless')
-rw-r--r--units/wireless/jobs.pxu122
-rw-r--r--units/wireless/nm-hotspot.pxu6
-rw-r--r--units/wireless/wifi-ap.pxu136
-rw-r--r--units/wireless/wireless-connection-manual.pxu7
-rw-r--r--units/wireless/wireless-connection-netplan.pxu32
5 files changed, 155 insertions, 148 deletions
diff --git a/units/wireless/jobs.pxu b/units/wireless/jobs.pxu
index c4ee54c..6d8b27b 100644
--- a/units/wireless/jobs.pxu
+++ b/units/wireless/jobs.pxu
@@ -18,7 +18,7 @@ template-unit: job
id: wireless/wireless_scanning_{{ interface }}
_summary: Test system can discover Wi-Fi networks on {{ interface }}
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py scan {{ interface }}
plugin: shell
category_id: com.canonical.plainbox::wireless
@@ -43,7 +43,7 @@ _purpose:
Check system can connect to 802.11b/g AP with wpa security
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py secured {{ interface }} "$WPA_BG_SSID" "$WPA_BG_PSK"
category_id: com.canonical.plainbox::wireless
estimated_duration: 30.0
@@ -65,7 +65,7 @@ _purpose:
Check system can connect to insecure 802.11b/g AP
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py open {{ interface }} "$OPEN_BG_SSID"
category_id: com.canonical.plainbox::wireless
estimated_duration: 30.0
@@ -87,7 +87,7 @@ _purpose:
Check system can connect to 802.11n AP with wpa security
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py secured {{ interface }} "$WPA_N_SSID" "$WPA_N_PSK"
category_id: com.canonical.plainbox::wireless
estimated_duration: 30.0
@@ -109,7 +109,7 @@ _purpose:
Check system can connect to insecure 802.11n AP
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py open {{ interface }} "$OPEN_N_SSID"
category_id: com.canonical.plainbox::wireless
estimated_duration: 30.0
@@ -131,7 +131,7 @@ _purpose:
Check system can connect to 802.11ac AP with wpa security
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py secured {{ interface }} "$WPA_AC_SSID" "$WPA_AC_PSK"
category_id: com.canonical.plainbox::wireless
estimated_duration: 30.0
@@ -154,7 +154,7 @@ _purpose:
Check system can connect to insecure 802.11ac AP
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py open {{ interface }} "$OPEN_AC_SSID"
category_id: com.canonical.plainbox::wireless
estimated_duration: 30.0
@@ -177,7 +177,7 @@ _purpose:
Check system can connect to 802.11ax AP with wpa security
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py secured {{ interface }} "$WPA_AX_SSID" "$WPA_AX_PSK"
category_id: com.canonical.plainbox::wireless
estimated_duration: 30.0
@@ -200,7 +200,7 @@ _purpose:
Check system can connect to insecure 802.11ax AP
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py open {{ interface }} "$OPEN_AX_SSID"
category_id: com.canonical.plainbox::wireless
estimated_duration: 30.0
@@ -221,17 +221,18 @@ requires:
user: root
environ: ROUTER_SSID ROUTER_PSK
command:
+ # shellcheck disable=SC2064
trap "nmcli con delete id $ROUTER_SSID" EXIT
- if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then
+ if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then
connect_wireless.sh # lp:1471663
- INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
- iw dev $INTERFACE link
- gateway_ping_test --interface=$INTERFACE
+ INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}')
+ iw dev "$INTERFACE" link
+ gateway_ping_test --interface="$INTERFACE"
STATUS=$?
# We reconnect the Ethernet connection if any (lp:1471663)
WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
- if [[ ! -z $WIRED ]]; then
- nmcli c up uuid $WIRED
+ if [[ -n $WIRED ]]; then
+ nmcli c up uuid "$WIRED"
fi
exit $STATUS
else
@@ -260,17 +261,18 @@ requires:
user: root
environ: ROUTER_SSID
command:
+ # shellcheck disable=SC2064
trap "nmcli con delete id $ROUTER_SSID" EXIT
- if create_connection.py wifi $ROUTER_SSID; then
+ if create_connection.py wifi "$ROUTER_SSID"; then
connect_wireless.sh # lp:1471663
- INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
- iw dev $INTERFACE link
- gateway_ping_test --interface=$INTERFACE
+ INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}')
+ iw dev "$INTERFACE" link
+ gateway_ping_test --interface="$INTERFACE"
STATUS=$?
# We reconnect the Ethernet connection if any (lp:1471663)
WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
- if [[ ! -z $WIRED ]]; then
- nmcli c up uuid $WIRED
+ if [[ -n $WIRED ]]; then
+ nmcli c up uuid "$WIRED"
fi
exit $STATUS
else
@@ -300,17 +302,18 @@ requires:
user: root
environ: ROUTER_SSID ROUTER_PSK
command:
+ # shellcheck disable=SC2064
trap "nmcli con delete id $ROUTER_SSID" EXIT
- if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then
+ if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then
connect_wireless.sh # lp:1471663
- INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
- iw dev $INTERFACE link
- gateway_ping_test --interface=$INTERFACE
+ INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}')
+ iw dev "$INTERFACE" link
+ gateway_ping_test --interface="$INTERFACE"
STATUS=$?
# We reconnect the Ethernet connection if any (lp:1471663)
WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
- if [[ ! -z $WIRED ]]; then
- nmcli c up uuid $WIRED
+ if [[ -n $WIRED ]]; then
+ nmcli c up uuid "$WIRED"
fi
exit $STATUS
else
@@ -340,17 +343,18 @@ requires:
user: root
environ: ROUTER_SSID
command:
+ # shellcheck disable=SC2064
trap "nmcli con delete id $ROUTER_SSID" EXIT
- if create_connection.py wifi $ROUTER_SSID; then
+ if create_connection.py wifi "$ROUTER_SSID"; then
connect_wireless.sh # lp:1471663
- INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
- iw dev $INTERFACE link
- gateway_ping_test --interface=$INTERFACE
+ INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}')
+ iw dev "$INTERFACE" link
+ gateway_ping_test --interface="$INTERFACE"
STATUS=$?
# We reconnect the Ethernet connection if any (lp:1471663)
WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
- if [[ ! -z $WIRED ]]; then
- nmcli c up uuid $WIRED
+ if [[ -n $WIRED ]]; then
+ nmcli c up uuid "$WIRED"
fi
exit $STATUS
else
@@ -380,17 +384,18 @@ requires:
user: root
environ: ROUTER_SSID ROUTER_PSK
command:
+ # shellcheck disable=SC2064
trap "nmcli con delete id $ROUTER_SSID" EXIT
- if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then
+ if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then
connect_wireless.sh # lp:1471663
- INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
- iw dev $INTERFACE link
- gateway_ping_test --interface=$INTERFACE
+ INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}')
+ iw dev "$INTERFACE" link
+ gateway_ping_test --interface="$INTERFACE"
STATUS=$?
# We reconnect the Ethernet connection if any (lp:1471663)
WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
- if [[ ! -z $WIRED ]]; then
- nmcli c up uuid $WIRED
+ if [[ -n $WIRED ]]; then
+ nmcli c up uuid "$WIRED"
fi
exit $STATUS
else
@@ -420,17 +425,18 @@ requires:
user: root
environ: ROUTER_SSID
command:
+ # shellcheck disable=SC2064
trap "nmcli con delete id $ROUTER_SSID" EXIT
- if create_connection.py wifi $ROUTER_SSID; then
+ if create_connection.py wifi "$ROUTER_SSID"; then
connect_wireless.sh # lp:1471663
- INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
- iw dev $INTERFACE link
- gateway_ping_test --interface=$INTERFACE
+ INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}')
+ iw dev "$INTERFACE" link
+ gateway_ping_test --interface="$INTERFACE"
STATUS=$?
# We reconnect the Ethernet connection if any (lp:1471663)
WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
- if [[ ! -z $WIRED ]]; then
- nmcli c up uuid $WIRED
+ if [[ -n $WIRED ]]; then
+ nmcli c up uuid "$WIRED"
fi
exit $STATUS
else
@@ -459,17 +465,18 @@ requires:
user: root
environ: WPA_BG_SSID WPA_BG_PSK SERVER_IPERF
command:
+ # shellcheck disable=SC2064
trap "nmcli con delete id $WPA_BG_SSID" EXIT
- if create_connection.py wifi $WPA_BG_SSID --security=wpa --key=$WPA_BG_PSK; then
+ if create_connection.py wifi "$WPA_BG_SSID" --security=wpa --key="$WPA_BG_PSK"; then
connect_wireless.sh # lp:1471663
- INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
- iw dev $INTERFACE link
- iperf -c $SERVER_IPERF -t 300 -i 30
+ INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}')
+ iw dev "$INTERFACE" link
+ iperf -c "$SERVER_IPERF" -t 300 -i 30
STATUS=$?
# We reconnect the Ethernet connection if any (lp:1471663)
WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
- if [[ ! -z $WIRED ]]; then
- nmcli c up uuid $WIRED
+ if [[ -n $WIRED ]]; then
+ nmcli c up uuid "$WIRED"
fi
exit $STATUS
else
@@ -488,17 +495,18 @@ requires:
user: root
environ: WPA_BG_SSID WPA_BG_PSK SERVER_IPERF
command:
+ # shellcheck disable=SC2064
trap "nmcli con delete id $WPA_BG_SSID" EXIT
- if create_connection.py wifi $WPA_BG_SSID --security=wpa --key=$WPA_BG_PSK; then
+ if create_connection.py wifi "$WPA_BG_SSID" --security=wpa --key="$WPA_BG_PSK"; then
connect_wireless.sh # lp:1471663
- INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
- iw dev $INTERFACE link
- iperf -c $SERVER_IPERF -t 300 -i 30 -u -b 100m -p 5050
+ INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}')
+ iw dev "$INTERFACE" link
+ iperf -c "$SERVER_IPERF" -t 300 -i 30 -u -b 100m -p 5050
STATUS=$?
# We reconnect the Ethernet connection if any (lp:1471663)
WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
- if [[ ! -z $WIRED ]]; then
- nmcli c up uuid $WIRED
+ if [[ -n $WIRED ]]; then
+ nmcli c up uuid "$WIRED"
fi
exit $STATUS
else
diff --git a/units/wireless/nm-hotspot.pxu b/units/wireless/nm-hotspot.pxu
index 3baa742..ca62c7a 100644
--- a/units/wireless/nm-hotspot.pxu
+++ b/units/wireless/nm-hotspot.pxu
@@ -7,7 +7,7 @@ template-unit: job
id: wireless/nmcli_wifi_ap_bg_{{ interface }}
_summary: Create 802.11b/g Wi-Fi AP on {{ interface }} using NetworkManager
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py ap {{ interface }} bg
plugin: shell
category_id: com.canonical.plainbox::wireless
@@ -28,7 +28,7 @@ template-unit: job
id: wireless/nmcli_wifi_ap_a_{{ interface }}
_summary: Create 802.11a Wi-Fi AP on {{ interface }} using NetworkManager
command:
- net_driver_info.py $NET_DRIVER_INFO
+ net_driver_info.py "$NET_DRIVER_INFO"
wifi_nmcli_test.py ap {{ interface }} a
plugin: shell
category_id: com.canonical.plainbox::wireless
@@ -39,4 +39,4 @@ requires:
connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager'
{%- else %}
executable.name == 'nmcli'
- {% endif -%} \ No newline at end of file
+ {% endif -%}
diff --git a/units/wireless/wifi-ap.pxu b/units/wireless/wifi-ap.pxu
index 493a2ca..622d70f 100644
--- a/units/wireless/wifi-ap.pxu
+++ b/units/wireless/wifi-ap.pxu
@@ -41,7 +41,7 @@ _description:
then checking status of the interface using `iw` command.
user: root
command:
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=a
@@ -50,10 +50,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_a_open
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_open)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_a_open)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -112,7 +112,7 @@ _description:
then checking status of the interface using `iw` command.
user: root
command:
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=b
@@ -121,10 +121,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_b_open
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_open)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_b_open)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -183,7 +183,7 @@ _description:
then checking status of the interface using `iw` command.
user: root
command:
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=g
@@ -192,10 +192,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_g_open
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_open)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_open)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -254,7 +254,7 @@ _description:
then checking status of the interface using `iw` command.
user: root
command:
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=ad
@@ -263,10 +263,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_ad_open
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_open)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_ad_open)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -326,7 +326,7 @@ _description:
then checking status of the interface using `iw` command.
user: root
command:
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=a
@@ -336,10 +336,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_a_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -399,7 +399,7 @@ _description:
then checking status of the interface using `iw` command.
user: root
command:
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=b
@@ -409,10 +409,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_b_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -472,7 +472,7 @@ _description:
then checking status of the interface using `iw` command.
user: root
command:
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=g
@@ -482,10 +482,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -545,7 +545,7 @@ _description:
then checking status of the interface using `iw` command.
user: root
command:
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=ad
@@ -555,10 +555,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_ad_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -589,7 +589,7 @@ estimated_duration: 120.0
environ: LD_LIBRARY_PATH OPEN_BG_SSID
command:
nmcli dev wifi rescan
- nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
user: root
_purpose:
Check that the system can create a WPA2 802.11a Access Point with an already active STA connection
@@ -629,13 +629,13 @@ command:
echo "Scanning for existing networks"
nmcli dev wifi rescan
echo "Connecting to existing network"
- nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT
if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then
echo "FAILED to connect to STA before setting up AP"
exit 1
fi
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=a
@@ -645,10 +645,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_a_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -672,10 +672,10 @@ requires:
wifi_interface_mode.{interface}_AP == 'supported'
snap.name == 'wifi-ap'
estimated_duration: 120.0
-environ: LD_LIBRARY_PATH $OPEN_BG_SSID
+environ: LD_LIBRARY_PATH OPEN_BG_SSID
command:
nmcli dev wifi rescan
- nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
user: root
_purpose:
Check that the system can create a WPA2 802.11b Access Point with an already active STA connection
@@ -715,13 +715,13 @@ command:
echo "Scanning for existing networks"
nmcli dev wifi rescan
echo "Connecting to existing network"
- nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT
if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then
echo "FAILED to connect to STA before setting up AP"
exit 1
fi
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=b
@@ -731,10 +731,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_b_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -761,7 +761,7 @@ estimated_duration: 120.0
environ: LD_LIBRARY_PATH OPEN_BG_SSID
command:
nmcli dev wifi rescan
- nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
user: root
_purpose:
Check that the system can create a WPA2 802.11g Access Point with an already active STA connection
@@ -801,13 +801,13 @@ command:
echo "Scanning for existing networks"
nmcli dev wifi rescan
echo "Connecting to existing network"
- nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT
if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then
echo "FAILED to connect to STA before setting up AP"
exit 1
fi
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=g
@@ -817,10 +817,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -847,7 +847,7 @@ estimated_duration: 120.0
environ: LD_LIBRARY_PATH OPEN_BG_SSID
command:
nmcli dev wifi rescan
- nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
user: root
_purpose:
Check that the system can create a WPA2 802.11ad Access Point with an already active STA connection
@@ -887,13 +887,13 @@ command:
echo "Scanning for existing networks"
nmcli dev wifi rescan
echo "Connecting to existing network"
- nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX
trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT
if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then
echo "FAILED to connect to STA before setting up AP"
exit 1
fi
- BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'`
+ BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S')
echo "Setting up AP"
wifi-ap.config set wifi.interface={interface}
wifi-ap.config set wifi.operation-mode=ad
@@ -903,10 +903,10 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_ad_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -938,11 +938,11 @@ command:
wifi-ap.config set wifi.ssid=DISABLED
wifi-ap.config set disabled=true
wifi_ap_wizard.py {interface} eth0
- sleep ${{WIFI_AP_SETUPTIME:-10}}
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
echo "Running AP setup wizard"
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_Wizard)" |wc -l`
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_Wizard)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then exit 0; else exit 1; fi
+ if [ "$RES" -eq 2 ]; then exit 0; else exit 1; fi
_description:
Check that the system can create a WPA2 802.11g Access Point using
wifi-ap.setup-wizard command on {interface}.
@@ -971,7 +971,7 @@ command:
wifi-ap.config set disabled=false
wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
echo "Rebooting"
reboot
requires:
@@ -1006,7 +1006,7 @@ command:
unsnap-wifi-ap.sh config set wifi.security-passphrase=Test1234
unsnap-wifi-ap.sh config set disabled=0
unsnap-wifi-ap.sh config set wifi.ssid=Ubuntu_g_wpa2
- sleep ${{WIFI_AP_SETUPTIME:-10}}
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
reboot
requires:
wifi_interface_mode.{interface}_AP == 'supported'
@@ -1029,10 +1029,10 @@ _description:
user: root
command:
echo "Waiting for AP to become available"
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then
+ if [ "$RES" -eq 2 ]; then
echo "Network detected"
exit 0
else
@@ -1060,10 +1060,10 @@ _description:
This job checks if AP still works.
user: root
command:
- sleep ${{WIFI_AP_SETUPTIME:-10}}
- RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l`
+ sleep "${{WIFI_AP_SETUPTIME:-10}}"
+ RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)")
wifi-ap.config set disabled=true
- if [ $RES -eq 2 ]; then exit 0; else exit 1; fi
+ if [ "$RES" -eq 2 ]; then exit 0; else exit 1; fi
requires:
wifi_interface_mode.{interface}_AP == 'supported'
snap.name == 'wifi-ap'
diff --git a/units/wireless/wireless-connection-manual.pxu b/units/wireless/wireless-connection-manual.pxu
index 7eb06cb..d06b260 100644
--- a/units/wireless/wireless-connection-manual.pxu
+++ b/units/wireless/wireless-connection-manual.pxu
@@ -181,16 +181,15 @@ environ:
WPA_BG_PSK
TEST_TARGET_IPERF
command:
- nmcli g > /dev/null
- if [ $? -ne 0 ]; then
+ if ! nmcli g > /dev/null; then
exit 1
fi
trap "nmcli dev disconnect {{ interface }}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT
nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete
nmcli dev wifi rescan
- nmcli dev wifi connect $WPA_BG_SSID password $WPA_BG_PSK ifname {{ interface }} name WIFI_TEST_CREATED_BY_CHECKBOX
+ nmcli dev wifi connect "$WPA_BG_SSID" password "$WPA_BG_PSK" ifname {{ interface }} name WIFI_TEST_CREATED_BY_CHECKBOX
iw dev {{ interface }} link
- iperf3 -c $TEST_TARGET_IPERF -t 300 -i 30 -u -b 100m -p 5050
+ iperf3 -c "$TEST_TARGET_IPERF" -t 300 -i 30 -u -b 100m -p 5050
exit $?
estimated_duration: 330.0
_summary: Wireless connection iperf3 test
diff --git a/units/wireless/wireless-connection-netplan.pxu b/units/wireless/wireless-connection-netplan.pxu
index 2127b8c..8eaf8b2 100644
--- a/units/wireless/wireless-connection-netplan.pxu
+++ b/units/wireless/wireless-connection-netplan.pxu
@@ -10,8 +10,8 @@ _purpose:
Check system can connect to insecure 802.11ax AP using netplan
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
- wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_AX_SSID -d
+ net_driver_info.py "$NET_DRIVER_INFO"
+ wifi_client_test_netplan.py -i {{ interface }} -s "$OPEN_AX_SSID" -d
user: root
environ: LD_LIBRARY_PATH OPEN_AX_SSID NET_DRIVER_INFO
category_id: com.canonical.plainbox::wireless
@@ -34,8 +34,8 @@ _purpose:
Check system can connect to insecure 802.11ac AP using netplan
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
- wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_AC_SSID -d
+ net_driver_info.py "$NET_DRIVER_INFO"
+ wifi_client_test_netplan.py -i {{ interface }} -s "$OPEN_AC_SSID" -d
user: root
environ: LD_LIBRARY_PATH OPEN_AC_SSID NET_DRIVER_INFO
category_id: com.canonical.plainbox::wireless
@@ -59,8 +59,8 @@ _purpose:
Check system can connect to insecure 802.11b/g AP using netplan
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
- wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_BG_SSID -d
+ net_driver_info.py "$NET_DRIVER_INFO"
+ wifi_client_test_netplan.py -i {{ interface }} -s "$OPEN_BG_SSID" -d
user: root
environ: LD_LIBRARY_PATH OPEN_BG_SSID NET_DRIVER_INFO
category_id: com.canonical.plainbox::wireless
@@ -82,8 +82,8 @@ _purpose:
Check system can connect to insecure 802.11n AP using netplan
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
- wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_N_SSID -d
+ net_driver_info.py "$NET_DRIVER_INFO"
+ wifi_client_test_netplan.py -i {{ interface }} -s "$OPEN_N_SSID" -d
user: root
environ: LD_LIBRARY_PATH OPEN_N_SSID NET_DRIVER_INFO
category_id: com.canonical.plainbox::wireless
@@ -105,8 +105,8 @@ _purpose:
Check system can connect to 802.11ax AP with wpa security using netplan
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
- wifi_client_test_netplan.py -i {{ interface }} -s $WPA_AX_SSID -k $WPA_AX_PSK -d
+ net_driver_info.py "$NET_DRIVER_INFO"
+ wifi_client_test_netplan.py -i {{ interface }} -s "$WPA_AX_SSID" -k "$WPA_AX_PSK" -d
user: root
environ: LD_LIBRARY_PATH WPA_AX_SSID WPA_AX_PSK NET_DRIVER_INFO
category_id: com.canonical.plainbox::wireless
@@ -129,8 +129,8 @@ _purpose:
Check system can connect to 802.11ac AP with wpa security using netplan
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
- wifi_client_test_netplan.py -i {{ interface }} -s $WPA_AC_SSID -k $WPA_AC_PSK -d
+ net_driver_info.py "$NET_DRIVER_INFO"
+ wifi_client_test_netplan.py -i {{ interface }} -s "$WPA_AC_SSID" -k "$WPA_AC_PSK" -d
user: root
environ: LD_LIBRARY_PATH WPA_AC_SSID WPA_AC_PSK NET_DRIVER_INFO
category_id: com.canonical.plainbox::wireless
@@ -153,8 +153,8 @@ _purpose:
Check system can connect to 802.11b/g AP with wpa security using netplan
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
- wifi_client_test_netplan.py -i {{ interface }} -s $WPA_BG_SSID -k $WPA_BG_PSK -d
+ net_driver_info.py "$NET_DRIVER_INFO"
+ wifi_client_test_netplan.py -i {{ interface }} -s "$WPA_BG_SSID" -k "$WPA_BG_PSK" -d
user: root
environ: LD_LIBRARY_PATH WPA_BG_SSID WPA_BG_PSK NET_DRIVER_INFO
category_id: com.canonical.plainbox::wireless
@@ -176,8 +176,8 @@ _purpose:
Check system can connect to 802.11n AP with wpa security using netplan
plugin: shell
command:
- net_driver_info.py $NET_DRIVER_INFO
- wifi_client_test_netplan.py -i {{ interface }} -s $WPA_N_SSID -k $WPA_N_PSK -d
+ net_driver_info.py "$NET_DRIVER_INFO"
+ wifi_client_test_netplan.py -i {{ interface }} -s "$WPA_N_SSID" -k "$WPA_N_PSK" -d
user: root
environ: LD_LIBRARY_PATH WPA_N_SSID WPA_N_PSK NET_DRIVER_INFO
category_id: com.canonical.plainbox::wireless