From 88601901544c4069c5e0a60189929d08402bfe7d Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Feb 08 2012 14:48:27 +0000 Subject: added test for busybox --- diff --git a/tests/p_busybox/00_install_busybox.sh b/tests/p_busybox/00_install_busybox.sh new file mode 100755 index 0000000..b2cae54 --- /dev/null +++ b/tests/p_busybox/00_install_busybox.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Author: Christoph Galuschka + +t_Log "Running $0 - attempting to install busybox." +t_InstallPackage busybox + diff --git a/tests/p_busybox/10_test_busybox.sh b/tests/p_busybox/10_test_busybox.sh new file mode 100755 index 0000000..6e59516 --- /dev/null +++ b/tests/p_busybox/10_test_busybox.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Author: Christoph Galuschka + +t_Log "Running $0 - busybox test: busybox lists available functions." + +busybox | grep -q 'Currently defined functions' +busy_ok=$? +if [ $busy_ok = 1 ] + then + t_Log 'busybox does not seem to list available functions' +fi +t_CheckExitStatus $busy_ok diff --git a/tests/p_busybox/20_functiontest_busybox.sh b/tests/p_busybox/20_functiontest_busybox.sh new file mode 100755 index 0000000..3a222d4 --- /dev/null +++ b/tests/p_busybox/20_functiontest_busybox.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Author: Christoph Galuschka + +t_Log "Running $0 - busybox functional tests: busybox provided functions are working." + +busybox | grep -q 'ls,' +busy_ls=$? +if [ $busy_ls == 0 ] + then + t_Log "busybox provides 'ls'; testing it" + touch /var/tmp/busybox + busybox ls /var/tmp/ |grep -q busybox + ls_working=$? + if [ $ls_working == 1 ] + then + t_Log "busybox provides 'ls' but it does not seem to work" + else + t_Log "'ls' works" + fi + #cleaning up + /bin/rm /var/tmp/busybox +fi +t_CheckExitStatus $ls_working + +busybox | grep -q 'touch,' +busy_touch=$? +if [ $busy_touch == 0 ] + then + t_Log "busybox provides 'touch'; testing it" + busybox touch /var/tmp/busybox + ls /var/tmp/ |grep -q busybox + touch_working=$? + if [ $touch_working == 1 ] + then + t_Log "busybox provides 'touch' but it does not seem to work" + else + t_Log "'touch' works" + fi + #cleaning up + /bin/rm /var/tmp/busybox +fi +t_CheckExitStatus $touch_working +