Remove old tests rpm before instalation the new one
authorOskar Chodowicz <o.chodowicz@partner.samsung.com>
Thu, 21 Nov 2019 18:13:59 +0000 (19:13 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Sat, 11 Jan 2020 08:59:19 +0000 (17:59 +0900)
Change-Id: Ia089080fd75d072aa9bd41deb9860336a2f59e75

project-tool

index 7775b88..eee6db3 100755 (executable)
@@ -2,6 +2,8 @@
 
 TEXT_ERROR='\033[0;31mError: \033[0m'
 TEXT_INFO='\033[0;32mInfo: \033[0m'
+ACCESSIBILITY_SETTING_NAME="org.tizen.accessibility-setting"
+ACCESSIBILITY_SETTING_TESTS_NAME="org.tizen.accessibility-setting-tests"
 
 print_help()
 {
@@ -50,6 +52,15 @@ rpm_install()
        sdb -d shell rpm -Uvh --force "$TMP"/*
 }
 
+rpm_erase()
+{
+       for RPM in $@
+       do
+               sdb -d shell rpm -e "$RPM"
+       done
+}
+
+
 exit_on_error()
 {
        if [ $? -eq 1 ]; then
@@ -166,14 +177,15 @@ fi
 
 if [ "$INSTALL_PACKAGE" != "" ]; then
        GBS_PATH="$HOME/GBS-ROOT/local/repos/public_mobile/armv7l/RPMS"
-       BASE_PACKAGE_NAME="$GBS_PATH/org.tizen.accessibility-setting-$VERSION-$RELEASE.armv7l.rpm"
-       TEST_PACKAGE_NAME="$GBS_PATH/org.tizen.accessibility-setting-tests-$VERSION-$RELEASE.armv7l.rpm"
+       BASE_PACKAGE_NAME="$GBS_PATH/$ACCESSIBILITY_SETTING_NAME-$VERSION-$RELEASE.armv7l.rpm"
+       TEST_PACKAGE_NAME="$GBS_PATH/$ACCESSIBILITY_SETTING_TESTS_NAME-$VERSION-$RELEASE.armv7l.rpm"
        TEST_LIB_PACKAGE_NAME="$HOME/GBS-ROOT/local/cache/*/gtest-[0-9]*"
 
        case "$INSTALL_PACKAGE" in
                'base')
                if [ -f "$BASE_PACKAGE_NAME" ]; then
                        BASE_FILE="$BASE_PACKAGE_NAME"
+                       BASE_RPM_NAME="$ACCESSIBILITY_SETTING_NAME"
                else
                        echo $TEXT_ERROR"Base package not found, check if it was built."
                        exit 1
@@ -184,6 +196,7 @@ if [ "$INSTALL_PACKAGE" != "" ]; then
                if [ -f "$TEST_PACKAGE_NAME" ]; then
                        TEST_FILE="$TEST_PACKAGE_NAME"
                        LIB_FILE="$TEST_LIB_PACKAGE_NAME"
+                       TEST_RPM_NAME="$ACCESSIBILITY_SETTING_TESTS_NAME"
                else
                        echo $TEXT_ERROR"Test package not found, check if it was built."
                        exit 1
@@ -195,6 +208,8 @@ if [ "$INSTALL_PACKAGE" != "" ]; then
                        BASE_FILE="$BASE_PACKAGE_NAME"
                        TEST_FILE="$TEST_PACKAGE_NAME"
                        LIB_FILE="$TEST_LIB_PACKAGE_NAME"
+                       BASE_RPM_NAME="$ACCESSIBILITY_SETTING_NAME"
+                       TEST_RPM_NAME="$ACCESSIBILITY_SETTING_TESTS_NAME"
                else
                        echo $TEXT_ERROR"Not all packages exist, check if they were built."
                        exit 1
@@ -210,7 +225,9 @@ if [ "$INSTALL_PACKAGE" != "" ]; then
        check_if_target_connected
 
        echo $TEXT_INFO"Following packages will be installed: $BASE_FILE $TEST_FILE $LIB_FILE"
+       rpm_erase $BASE_RPM_NAME $TEST_RPM_NAME
        rpm_install "$BASE_FILE" "$TEST_FILE" $LIB_FILE
+
 fi
 
 if [ $CLEAN_JOURNAL -eq 1 ]; then
@@ -228,7 +245,6 @@ if [ $RUN_TESTS -eq 1 ]; then
 
        sdb root on
        sdb shell '
-               set -e
                DATE=`date "+%F %X"`
                for i in /usr/apps/org.tizen.accessibility-setting-tests/no-ui-scenarios/*
                do