summaryrefslogtreecommitdiff
path: root/automated/linux
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2016-11-23 19:22:52 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-11-23 12:48:22 +0000
commit3250835f73ee8494bc08ac558959d948f2a5ad25 (patch)
tree14a2c08beae5a75cbb07f79ac61e5458081dfdd5 /automated/linux
parent6f758960c382385949c06c05255b867192641502 (diff)
automated: linux: lamp: bug fixes
* During the second run, mysql root password cannot be changed as it was already changed in the first run, so throw the error to /dev/null. * Delete the database table created by test case for a clean exit. Change-Id: I383370e5a01bb0457699c5a3db5bd5ea85f0a458 Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/linux')
-rwxr-xr-xautomated/linux/lamp/lamp.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/automated/linux/lamp/lamp.sh b/automated/linux/lamp/lamp.sh
index 02ffc63..fc995c0 100755
--- a/automated/linux/lamp/lamp.sh
+++ b/automated/linux/lamp/lamp.sh
@@ -1,8 +1,10 @@
#!/bin/sh
+# shellcheck disable=SC1091
. ../../lib/sh-test-lib
OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
usage() {
echo "Usage: $0 [-s <true|false>]" 1>&2
@@ -27,6 +29,7 @@ if [ "${SKIP_INSTALL}" = "True" ] || [ "${SKIP_INSTALL}" = "true" ]; then
warn_msg "LAMP package installation skipped"
else
dist_name
+ # shellcheck disable=SC2154
case "${dist}" in
Debian|Ubuntu)
if [ "${dist}" = "Debian" ]; then
@@ -58,7 +61,7 @@ grep "Test Page for the Apache HTTP Server" "${OUTPUT}/index.html"
check_return "apache2-test-page"
# Test MySQL.
-mysqladmin -u root password lamptest
+mysqladmin -u root password lamptest > /dev/null 2>&1 || true
mysql --user="root" --password="lamptest" -e "show databases"
check_return "mysql-show-databases"
@@ -96,3 +99,6 @@ check_return "php-select-record"
curl -o "${OUTPUT}/delete-record" "http://localhost/delete-record.php"
grep "Record deleted successfully" "${OUTPUT}/delete-record"
check_return "php-delete-record"
+
+# Delete myDB for the next run.
+mysql --user='root' --password='lamptest' -e 'DROP DATABASE myDB'