summaryrefslogtreecommitdiff
path: root/tct
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2017-04-19 10:59:53 +0200
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-08-08 10:17:56 +0200
commite7b8edff5a2a5231cfacfda973f4f7ef280fb088 (patch)
tree0135f706eda9393a94aa3f25d8afdc1f125c933d /tct
parent24ed88794ed1fd82ba7ac9256fc2d75ae66d95d8 (diff)
downloadmajor-e7b8edff5a2a5231cfacfda973f4f7ef280fb088.tar.gz
major-e7b8edff5a2a5231cfacfda973f4f7ef280fb088.tar.bz2
major-e7b8edff5a2a5231cfacfda973f4f7ef280fb088.zip
Add RaspberryPi 3 to TITS
Database update is required. Delete it or run: . tsp/common.sh sqlite3 "${DBPATH}" -batch < tsp/results-values-device.sql Change-Id: I220f060a7186b047a2d55271beab1aafc4398863
Diffstat (limited to 'tct')
-rwxr-xr-xtct/conf/conf.sh14
-rwxr-xr-xtct/flash/flash_dd_rpi3.sh48
-rwxr-xr-xtct/rpi3_prepare_flash_conf.sh63
-rwxr-xr-xtct/rpi3_run.sh65
4 files changed, 185 insertions, 5 deletions
diff --git a/tct/conf/conf.sh b/tct/conf/conf.sh
index 4998ff1..949d05c 100755
--- a/tct/conf/conf.sh
+++ b/tct/conf/conf.sh
@@ -77,12 +77,9 @@ copy_ssh() {
done
}
-wait_ssh() {
- SDMUX="$1"
- test -n "${SDMUX}" || die "Missing argument: sdmux"
+wait_ping() {
test -n "${IP}" || die "Missing env dependency: ip"
- CONNECT_CNT=0
SLEEP=${INIT_SLEEP}
sleep "${SLEEP}"
@@ -101,10 +98,17 @@ wait_ssh() {
fi
sleep "${SLEEP}"
SLEEP=$((SLEEP+INC_SLEEP))
- CONNECT_CNT=$((CONNECT_CNT+1))
done
printf "\n" >&2
+}
+
+wait_ssh() {
+ SDMUX="$1"
+ test -n "${SDMUX}" || die "Missing argument: sdmux"
+ test -n "${IP}" || die "Missing env dependency: ip"
+
+ wait_ping
SLEEP=10
diff --git a/tct/flash/flash_dd_rpi3.sh b/tct/flash/flash_dd_rpi3.sh
new file mode 100755
index 0000000..cc5d6a5
--- /dev/null
+++ b/tct/flash/flash_dd_rpi3.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# script for flashing SD card using dd
+# the layout is:
+# * boot.img -> 1st partition
+# * rootfs.img -> 2nd partition
+# * systemd-data.img -> 3rd partition
+# * modules.img -> 6th partition
+#
+# script always checks for block device availability
+# files are taken from CWD
+# there are no checks if files exist, dd should fail
+#
+# SD card should be prepared using script mkpart.sh available at:
+# https://wiki.tizen.org/wiki/Quick_guide_for_odroid#Fuse_bootloader_image
+#
+# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
+
+TESTLAB_SCRIPTS="$(CDPATH='' cd -- "$(dirname -- "$0")"/.. && pwd -P)"
+
+. "${TESTLAB_SCRIPTS}/common.sh"
+
+test -n "${1}" || die "Too few arguments!"
+
+sdd="sudo dd bs=4096"
+test -b "${1}1" || die "No ${1}1"
+$sdd if=boot.img "of=${1}1"
+test -b "${1}2" || die "No ${1}2"
+$sdd if=rootfs.img "of=${1}2"
+test -b "${1}3" || die "No ${1}3"
+$sdd if=system-data.img "of=${1}3"
+test -b "${1}6" || die "No ${1}6"
+$sdd if=modules.img "of=${1}6"
+sync
diff --git a/tct/rpi3_prepare_flash_conf.sh b/tct/rpi3_prepare_flash_conf.sh
new file mode 100755
index 0000000..63083fc
--- /dev/null
+++ b/tct/rpi3_prepare_flash_conf.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Script used to flash, prepare and configure ODROID U3
+#
+# Syntax is: odroid_prepare_conf_flash.sh $SDMUX $BOOT_IMAGE $IMAGE \
+# [$NATIVE_TCT_REPO]
+#
+# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
+
+export TESTLAB_SCRIPTS="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"
+
+. "${TESTLAB_SCRIPTS}/common.sh"
+
+SDMUX="$1"
+BOOT_IMAGE="$2"
+IMAGE="$3"
+
+test -n "${SDMUX}" || die "Missing argument: sdmux!"
+test -n "${BOOT_IMAGE}" || die "Missing argument: boot image!"
+test -n "${IMAGE}" || die "Missing argument: image!"
+
+. "${TESTLAB_SCRIPTS}/prepare/prepare.sh"
+. "${TESTLAB_SCRIPTS}/flash/flash.sh"
+
+echo "### prepare ###"
+
+IMAGE_UNPACKED="/tmp/image_unpacked_${SDMUX}"
+IMAGE_MOUNTPOINT="/tmp/image_mounted_${SDMUX}"
+
+switch2testserver "${SDMUX}"
+
+unpack_image "${BOOT_IMAGE}" "${IMAGE}" "${IMAGE_UNPACKED}"
+
+echo "### flash ###"
+
+UUID_FILE="/var/tmp/uuid-${SDMUX}"
+DEV_SDCARD=$(uuid2dev "${UUID_FILE}" "${SDMUX}") || die "sdcard not found!"
+
+cd "${IMAGE_UNPACKED}"
+"${TESTLAB_SCRIPTS}/flash/flash_dd_rpi3.sh" "${DEV_SDCARD}"
+RET=$?
+cd "${OLDPWD}"
+
+change_uuid "${UUID_FILE}" "${DEV_SDCARD}"
+if [ $RET -ne 0 ]; then
+ die "flash_dd exited with an error" "$RET"
+fi
+switch2device "${SDMUX}"
+restart_device "${SDMUX}"
diff --git a/tct/rpi3_run.sh b/tct/rpi3_run.sh
new file mode 100755
index 0000000..e095f2f
--- /dev/null
+++ b/tct/rpi3_run.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Script used to run smoke and avocado tests on ODROID U3
+# It preserves CONNECT_CNT information left by odroid_prepare_flash_conf.sh
+# After test SDMUX is switched to testserver in order to increase sdcard
+# longetivity and make next flash faster.
+#
+# Syntax is: odroid_run.sh $SDMUX [$NATIVE_TCT_REPO]
+#
+# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
+export TESTLAB_SCRIPTS="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"
+
+. "${TESTLAB_SCRIPTS}/common.sh"
+. "${TESTLAB_SCRIPTS}/conf/conf.sh"
+. "${TESTLAB_SCRIPTS}/run/run.sh"
+. "${TESTLAB_SCRIPTS}/flash/flash.sh"
+
+SDMUX="$1"
+NATIVE_TCT_REPO="$2"
+
+test -n "${SDMUX}" || die "Missing argument: sdmux!"
+
+IP="$(get_ip "${SDMUX}")" || die "Error: get_ip failed!"
+
+echo "### conf ###"
+
+CONNECT_CNT="$(wait_ping "${SDMUX}")" || die "wait_ping: failed!"
+
+sleep 4
+sdb connect "$IP"
+sleep 4
+sdb -s "${IP}" root on
+
+echo "### run ###"
+
+copy_sdb "${IP}" "${TESTLAB_SCRIPTS}/run/smoke_tests.sh"
+run_smoke_sdb "${IP}"
+
+cat sysctl.result
+
+if [ -f "common_test.yaml" ]
+then
+ run_avocado_sdb "${IP}" "avocado-results" "common_test.yaml"
+else
+ echo "Missing file: common_test.yaml; skipping avocado tests"
+fi
+
+echo "### cleanup ###"
+
+sdb disconnect "$IP"
+switch2testserver "${SDMUX}"