summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorNaresh Kamboju <naresh.kamboju@linaro.org>2016-11-18 15:23:45 +0530
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-11-22 11:26:54 +0000
commit155830def9c5270473aac3123e8ef250941934d5 (patch)
tree534c761f4e76c5e6c52bbdcbc29a67f85d2809ea /automated
parent48fbb8bf1d72cb3a1fd3a92725c4a8020839cf5b (diff)
automated: Linux network basic: improvements
Network basic tests improved, - Install net-tools package - Get default gateway at run time - Removed variables from test_case_id - Rename 'test' to 'test_case' Change-Id: I27347cf2bd0627dbb7708742c507f27b78787ffe Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/linux/network-basic/network-basic.sh26
-rw-r--r--automated/linux/network-basic/network-basic.yaml13
2 files changed, 24 insertions, 15 deletions
diff --git a/automated/linux/network-basic/network-basic.sh b/automated/linux/network-basic/network-basic.sh
index 5d819ff..25b6204 100755
--- a/automated/linux/network-basic/network-basic.sh
+++ b/automated/linux/network-basic/network-basic.sh
@@ -6,34 +6,32 @@ OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"
export RESULT_FILE
INTERFACE="eth0"
-GATEWAY="10.0.0.1"
usage() {
- echo "Usage: $0 [-s <true|false>] [-i <eth0>] [-g <10.0.0.1>]" 1>&2
+ echo "Usage: $0 [-s <true|false>] [-i <interface>]" 1>&2
exit 1
}
-while getopts "s:i:g:" o; do
+while getopts "s:i:" o; do
case "$o" in
s) SKIP_INSTALL="${OPTARG}" ;;
i) INTERFACE="${OPTARG}" ;;
- g) GATEWAY="${OPTARG}" ;;
*) usage ;;
esac
done
install() {
- pkgs="curl"
+ pkgs="curl net-tools"
install_deps "${pkgs}" "${SKIP_INSTALL}"
}
run() {
- test="$1"
+ test_case="$1"
test_case_id="$2"
echo
info_msg "Running ${test_case_id} test..."
- info_msg "Running ${test} test..."
- eval "${test}"
+ info_msg "Running ${test_case} test..."
+ eval "${test_case}"
check_return "${test_case_id}"
}
@@ -42,14 +40,18 @@ run() {
mkdir -p "${OUTPUT}"
install
+
+# Get default Route Gateway IP address of a given interface
+GATEWAY=$(ip route list | grep default | awk '{print $3}')
+
run "netstat -an" "print-network-statistics"
run "ip addr" "list-all-network-interfaces"
run "route" "print-routing-tables"
run "ip link set lo up" "ip-link-loopback-up"
run "route" "route-dump-after-ip-link-loopback-up"
-run "ip link set ${INTERFACE} up" "ip-link-interface-${INTERFACE}-up"
-run "ip link set ${INTERFACE} down" "ip-link-interface-${INTERFACE}-down"
-run "dhclient -v ${INTERFACE}" "Dynamic-Host-Configuration-Protocol-Client-dhclient-v-${INTERFACE}"
+run "ip link set ${INTERFACE} up" "ip-link-interface-up"
+run "ip link set ${INTERFACE} down" "ip-link-interface-down"
+run "dhclient -v ${INTERFACE}" "Dynamic-Host-Configuration-Protocol-Client-dhclient-v"
run "route" "print-routing-tables-after-dhclient-request"
-run "ping -c 5 ${GATEWAY}" "ping-gateway-${GATEWAY}"
+run "ping -c 5 ${GATEWAY}" "ping-gateway"
run "curl http://samplemedia.linaro.org/MPEG4/big_buck_bunny_720p_MPEG4_MP3_25fps_3300K.AVI -o curl_big_video.avi" "download-a-file"
diff --git a/automated/linux/network-basic/network-basic.yaml b/automated/linux/network-basic/network-basic.yaml
index 002d549..c0601d5 100644
--- a/automated/linux/network-basic/network-basic.yaml
+++ b/automated/linux/network-basic/network-basic.yaml
@@ -1,7 +1,7 @@
metadata:
format: Lava-Test Test Definition 1.0
name: network-tests-basic
- description: "Basic network test commands for Linaro Ubuntu images"
+ description: "Basic network test commands"
maintainer:
- milosz.wasilewski@linaro.org
- naresh.kamboju@linaro.org
@@ -17,14 +17,21 @@ metadata:
- panda-es
- vexpress-tc2
- juno
+ - d03
+ - d05
+ - overdrive
+ - mustang
+ - moonshot
+ - thunderX
+ - hi6220-hikey
+ - apq8016-sbc
params:
INTERFACE: eth0
- GATEWAY: 10.0.0.1
SKIP_INSTALL: "False"
run:
steps:
- cd ./automated/linux/network-basic/
- - ./network-basic.sh -s "${SKIP_INSTALL}" -g "${GATEWAY}" -i "${INTERFACE}"
+ - ./network-basic.sh -s "${SKIP_INSTALL}" -i "${INTERFACE}"
- ../../utils/send-to-lava.sh ./output/result.txt