Add testplan functions to tct/run/run.sh
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Thu, 17 Dec 2015 11:10:55 +0000 (12:10 +0100)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Fri, 13 May 2016 12:09:43 +0000 (14:09 +0200)
Syntax is:
    create_testplan $TEST_PLAN $TEST_REPO
    run_testplan $TEST_PLAN $ID

Change-Id: I96b31754cc237da66ba9e6dbbaed112e8c346ea7
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tct/run/run.sh [new file with mode: 0755]

diff --git a/tct/run/run.sh b/tct/run/run.sh
new file mode 100755 (executable)
index 0000000..1b7509b
--- /dev/null
@@ -0,0 +1,43 @@
+# 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.
+
+# Syntax is:
+#   * create_testplan $TEST_PLAN $TEST_REPO
+#   * run_testplan $TEST_PLAN $ID
+#
+# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
+
+export NATIVE_TCT_HOST_PATH="/opt/tct/tizen_native_3.0"
+
+create_testplan() {
+    TEST_PLAN="$1"
+    TEST_REPO="$2"
+    test -n "${TEST_PLAN}" || die "Missing argument: testplan!"
+    test -n "${TEST_REPO}" || die "Missing argument: testrepo!"
+
+    cd "${NATIVE_TCT_HOST_PATH}/shell"
+    ./tct-plan-generator --output "${TEST_PLAN}" --match "*" --repository "${TEST_REPO}"
+    cd "${OLDPWD}"
+}
+
+run_testplan() {
+    TEST_PLAN="$1"
+    ID="$2"
+    test -n "${TEST_PLAN}" || die "Missing argument: testplan!"
+    test -n "${ID}" || die "Missing argument: id!"
+
+    cd "${NATIVE_TCT_HOST_PATH}/shell"
+    yes | ./tct-shell --testplan "${TEST_PLAN}" --deviceid "${ID}"
+    cd "${OLDPWD}"
+}