From d469c92394a1a95ae7a45b8b80dc4c2918e0e9a6 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 19 Sep 2013 13:18:06 +0100 Subject: classes/imagetest-qemu: remove old image testing class This has now been superseded by testimage. Signed-off-by: Paul Eggleton --- scripts/qemuimage-tests/tools/bash.sh | 17 --- scripts/qemuimage-tests/tools/compiler_test.sh | 137 ------------------------- scripts/qemuimage-tests/tools/connman_test.sh | 75 -------------- scripts/qemuimage-tests/tools/df.sh | 25 ----- scripts/qemuimage-tests/tools/dmesg.sh | 28 ----- scripts/qemuimage-tests/tools/rpm_test.sh | 45 -------- scripts/qemuimage-tests/tools/smart_test.sh | 45 -------- scripts/qemuimage-tests/tools/syslog.sh | 17 --- 8 files changed, 389 deletions(-) delete mode 100644 scripts/qemuimage-tests/tools/bash.sh delete mode 100644 scripts/qemuimage-tests/tools/compiler_test.sh delete mode 100644 scripts/qemuimage-tests/tools/connman_test.sh delete mode 100644 scripts/qemuimage-tests/tools/df.sh delete mode 100644 scripts/qemuimage-tests/tools/dmesg.sh delete mode 100644 scripts/qemuimage-tests/tools/rpm_test.sh delete mode 100644 scripts/qemuimage-tests/tools/smart_test.sh delete mode 100644 scripts/qemuimage-tests/tools/syslog.sh (limited to 'scripts/qemuimage-tests/tools') diff --git a/scripts/qemuimage-tests/tools/bash.sh b/scripts/qemuimage-tests/tools/bash.sh deleted file mode 100644 index f6958f0e7e..0000000000 --- a/scripts/qemuimage-tests/tools/bash.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# bash test script running in qemu -# -# Author: veera -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -which bash -if [ $? -eq 0 ]; then - echo "QEMU: bash is exist in the target by default" - exit 0 -else - echo "QEMU: No bash command in the qemu target" - exit 1 -fi diff --git a/scripts/qemuimage-tests/tools/compiler_test.sh b/scripts/qemuimage-tests/tools/compiler_test.sh deleted file mode 100644 index 9c30d6d78b..0000000000 --- a/scripts/qemuimage-tests/tools/compiler_test.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash -# compiler test script running in target -# -# Author: Jiajun Xu -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -# Prepare test folder for compiler test -COMPILE_FOLDER="/opt/test/compile_test" -TEST_FILE="$COMPILE_FOLDER/compile_test.c" -EXECUTE_FILE="$COMPILE_FOLDER/compile_test" -TEST_MAKEFILE="$COMPILE_FOLDER/makefile" -TEST_LIST="gcc g++ make" - -if [ ! -d $COMPILE_FOLDER ]; then - mkdir -p $COMPILE_FOLDER -fi - -Target_Info() -{ - echo -e "\tTARGET: $*" -} - -Target_Err() -{ - echo -e "\tTARGET: ##### Error Log #####" - $@ - echo -e "\tTARGET: ##### End #####" -} - -# Function to generate a c test file for compiler testing -Gen_File() -{ - temp=`mktemp` - - # Generate c/c++ test file for compiler testing - echo "#include " >> $temp - echo "#include " >> $temp - echo "" >> $temp - echo "double" >> $temp - echo "convert(long long l)" >> $temp - echo "{" >> $temp - echo " return (double)l; // or double(l)" >> $temp - echo "}" >> $temp - echo "" >> $temp - echo "int" >> $temp - echo "main(int argc, char * argv[])" >> $temp - echo "{" >> $temp - echo " long long l = 10;" >> $temp - echo " double f;" >> $temp - echo "" >> $temp - echo " f = convert(l);" >> $temp - echo " printf(\"convert: %lld => %f\n\", l, f);" >> $temp - echo "" >> $temp - echo " f = 1234.67;" >> $temp - echo " printf(\"floorf(%f) = %f\n\", f, floorf(f));" >> $temp - echo " return 0;" >> $temp - echo "}" >> $temp - echo $temp -} - -# Function to generate a makefile for compiler testing -Gen_Makefile() -{ - temp=`mktemp` - basename=`basename $EXECUTE_FILE` - - echo -e "$basename: $basename.o" >> $temp - echo -e "\tgcc -o $basename $basename.o -lm" >> $temp - echo -e "$basename.o: $basename.c" >> $temp - echo -e "\tgcc -c $basename.c" >> $temp - - echo $temp -} - -# Generate a c test file for compiler testing -test_file=`Gen_File` - -MOVE=`which mv` -$MOVE $test_file $TEST_FILE - -# Begin compiler test in target -for cmd in $TEST_LIST -do - which $cmd - if [ $? -ne 0 ]; then - Target_Info "No $cmd command found" - exit 1 - fi - - if [ "$cmd" == "make" ]; then - rm -rf $EXECUTE_FILE - - # For makefile test, we need to generate a makefile and run with a c file - makefile=`Gen_Makefile` - $MOVE $makefile $TEST_MAKEFILE - - cd `dirname $TEST_MAKEFILE` - make - - if [ $? -ne 0 ]; then - Target_Info "$cmd running with error, Pls. check error in following" - Target_Err make - exit 1 - fi - else - rm -rf $EXECUTE_FILE - - # For gcc/g++, we compile a c test file and check the output - $cmd $TEST_FILE -o $EXECUTE_FILE -lm - - if [ $? -ne 0 ]; then - Target_Info "$cmd running with error, Pls. check error in following" - Target_Err $cmd $TEST_FILE -o $EXECUTE_FILE -lm - exit 1 - fi - fi - - # Check if the binary file generated by $cmd can work without error - if [ -f $EXECUTE_FILE ]; then - $EXECUTE_FILE - if [ $? -ne 0 ]; then - Target_Info "$EXECUTE_FILE running with error, Pls. check error in following" - Target_Err $EXECUTE_FILE - exit 1 - else - Target_Info "$cmd can work without problem in target" - fi - else - Target_Info "No executalbe file $EXECUTE_FILE found, Pls. check the error log" - exit 1 - fi -done - -exit 0 diff --git a/scripts/qemuimage-tests/tools/connman_test.sh b/scripts/qemuimage-tests/tools/connman_test.sh deleted file mode 100644 index 4c1e2f558e..0000000000 --- a/scripts/qemuimage-tests/tools/connman_test.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# connman test script running in target -# -# Author: Jiajun Xu -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -Target_Info() -{ - echo -e "\tTARGET: $*" -} - -Target_Err() -{ - echo -e "\tTARGET: connman has issue when running, Pls. check the error log" - echo -e "\tTARGET: ##### Error Log #####" - $1 - echo -e "\tTARGET: ##### End #####" -} - -# Check if ps comes from Procps or busybox first -ls -l `which ps` | grep -q "busybox" -RET=$? - -if [ $RET -eq 0 ]; then - PS="ps" -else - PS="ps -ef" -fi - -# Check if connmand is in target -if [ ! -f /usr/sbin/connmand ]; then - Target_Info "No connmand command found" - exit 1 -fi - -# Check if connmand is running in background -if [ $RET -eq 0 ]; then - count=`ps | awk '{print $5}' | grep -c connmand` -else - count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand` -fi - -if [ $count -ne 1 ]; then - Target_Info "connmand has issue when running in background, Pls, check the output of ps" - ${PS} - exit 1 -fi - -# Check if there is always only one connmand running in background -if [ connmand > /dev/null 2>&1 ]; then - Target_Info "connmand command run without problem" - - if [ $RET -eq 0 ]; then - count=`ps | awk '{print $5}' | grep -c connmand` - else - count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand` - fi - - if [ $count -ne 1 ]; then - Target_Info "There are more than one connmand running in background, Pls, check the output of ps" - ${PS} | grep connmand - exit 1 - else - Target_Info "There is always one connmand running in background, test pass" - exit 0 - fi -else - Target_Err connmand - exit 1 -fi - -exit 0 diff --git a/scripts/qemuimage-tests/tools/df.sh b/scripts/qemuimage-tests/tools/df.sh deleted file mode 100644 index 280c08e031..0000000000 --- a/scripts/qemuimage-tests/tools/df.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# df test script to check enough disk space for qemu target -# -# Author: veera -# -# This file is licensed under the GNU General Public License, -# Version 2. -#taking the size of the each partition -array_list=(`df -P | tr -s " " | cut -d " " -f4`) -#Total size of the array -array_size=`echo ${#array_list[@]}` -loop_val=1 -#while loop to check the size of partitions are less than 5MB -while [ $loop_val -lt $array_size ] -do - #taking each value from the array to check the size - value=`echo ${array_list[$loop_val]}` - if [[ $value -gt 5120 ]];then - loop_val=`expr $loop_val + 1` - else - echo "QEMU: df : disk space is not enough" - exit 1 - fi -done -exit 0 diff --git a/scripts/qemuimage-tests/tools/dmesg.sh b/scripts/qemuimage-tests/tools/dmesg.sh deleted file mode 100644 index f0c93181bd..0000000000 --- a/scripts/qemuimage-tests/tools/dmesg.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Dmesg test script running in QEMU -# -# Author: Jiajun Xu -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -which dmesg -if [ $? -ne 0 ]; then - echo "QEMU: No dmesg command found" - exit 1 -fi - -# For now, ignore mmci-pl18x errors on qemuarm which appeared -# from the 3.8 kernel and are harmless -dmesg | grep -v mmci-pl18x | grep -iq "error" -if [ $? -eq 0 ]; then - echo "QEMU: There is some error log in dmesg:" - echo "QEMU: ##### Error Log ######" - dmesg | grep -i "error" - echo "QEMU: ##### End ######" - exit 1 -else - echo "QEMU: No error log in dmesg" - exit 0 -fi diff --git a/scripts/qemuimage-tests/tools/rpm_test.sh b/scripts/qemuimage-tests/tools/rpm_test.sh deleted file mode 100644 index 6e6f9112ca..0000000000 --- a/scripts/qemuimage-tests/tools/rpm_test.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# rpm test script running in target -# -# Author: Jiajun Xu -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -Target_Info() -{ - echo -e "\tTARGET: $*" -} - -Target_Err() -{ - echo -e "\tTARGET: rpm command has issue when running, Pls. check the error log" - echo -e "\tTARGET: ##### Error Log #####" - $1 - echo -e "\tTARGET: ##### End #####" -} - -which rpm -if [ $? -ne 0 ]; then - Target_Info "No rpm command found" - exit 1 -fi - -if [ rpm > /dev/null 2>&1 ]; then - Target_Info "rpm command run without problem" -else - Target_Err rpm - exit 1 -fi - -# run rpm with specific command parsed to rpm_test.sh -rpm $* > /dev/null 2>&1 - -if [ $? -eq 0 ]; then - Target_Info "rpm $* work without problem" - exit 0 -else - Target_Err rpm $* - exit 1 -fi diff --git a/scripts/qemuimage-tests/tools/smart_test.sh b/scripts/qemuimage-tests/tools/smart_test.sh deleted file mode 100644 index f278a25e2b..0000000000 --- a/scripts/qemuimage-tests/tools/smart_test.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# smart test script running in target -# -# Author: Jiajun Xu -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -Target_Info() -{ - echo -e "\tTARGET: $*" -} - -Target_Err() -{ - echo -e "\tTARGET: smart command has issue when running, Pls. check the error log" - echo -e "\tTARGET: ##### Error Log #####" - $1 - echo -e "\tTARGET: ##### End #####" -} - -which smart -if [ $? -ne 0 ]; then - Target_Info "No smart command found" - exit 1 -fi - -if [ smart > /dev/null 2>&1 ]; then - Target_Info "smart command run without problem" -else - Target_Err smart - exit 1 -fi - -# run smart with specific command parsed to smart_test.sh -smart $* > /dev/null 2>&1 - -if [ $? -eq 0 ]; then - Target_Info "smart $* work without problem" - exit 0 -else - Target_Err "smart $*" - exit 1 -fi diff --git a/scripts/qemuimage-tests/tools/syslog.sh b/scripts/qemuimage-tests/tools/syslog.sh deleted file mode 100644 index 9154da3b85..0000000000 --- a/scripts/qemuimage-tests/tools/syslog.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# syslog test script running in qemu -# -# Author: veera -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -ps aux | grep -w syslogd | grep -v grep -if [ $? -eq 0 ]; then - echo "QEMU: syslogd is running by default" - exit 0 -else - echo "QEMU: syslogd is not running" - exit 1 -fi -- cgit v1.2.3