All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
To: fuego@lists.linuxfoundation.org
Subject: [Fuego] [PATCH 10/19] call_if_present: tests do not need to implement dummy functions
Date: Fri, 12 May 2017 17:19:51 +0900	[thread overview]
Message-ID: <1494577200-11597-11-git-send-email-daniel.sangorrin@toshiba.co.jp> (raw)
In-Reply-To: <1494577200-11597-1-git-send-email-daniel.sangorrin@toshiba.co.jp>

Since we use the call_if_present macro, tests do not need
to implement dummy versions of the test_xxx functions.

TODO: add to the documentation a template containing all functions
so that test developers can start with that.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
 engine/scripts/functions.sh                        |  2 +-
 .../Benchmark.fuego_check_plots/fuego_test.sh      |  4 ----
 engine/tests/Benchmark.reboot/fuego_test.sh        |  4 ----
 engine/tests/Functional.aiostress/fuego_test.sh    |  7 -------
 engine/tests/Functional.curl/fuego_test.sh         |  4 ----
 engine/tests/Functional.fuego_abort/fuego_test.sh  |  8 --------
 .../tests/Functional.fuego_transport/fuego_test.sh | 22 ++++++----------------
 engine/tests/Functional.hciattach/fuego_test.sh    | 10 ----------
 engine/tests/Functional.iptables/fuego_test.sh     | 12 ++----------
 engine/tests/Functional.ipv6connect/fuego_test.sh  |  8 +-------
 engine/tests/Functional.linus_stress/fuego_test.sh |  6 ------
 engine/tests/Functional.net-tools/fuego_test.sh    |  8 --------
 engine/tests/Functional.rmaptest/fuego_test.sh     | 18 ++++++------------
 13 files changed, 16 insertions(+), 97 deletions(-)

diff --git a/engine/scripts/functions.sh b/engine/scripts/functions.sh
index 7ff77bc..188408d 100755
--- a/engine/scripts/functions.sh
+++ b/engine/scripts/functions.sh
@@ -219,7 +219,7 @@ function deploy {
   echo "##### doing fuego phase: pre_deploy ########"
   pre_deploy
   echo "##### doing fuego phase: test_deploy ########"
-  test_deploy
+  call_if_present test_deploy
   echo "##### doing fuego phase: post_deploy ########"
   post_deploy
 }
diff --git a/engine/tests/Benchmark.fuego_check_plots/fuego_test.sh b/engine/tests/Benchmark.fuego_check_plots/fuego_test.sh
index 80e4999..14fb3a2 100644
--- a/engine/tests/Benchmark.fuego_check_plots/fuego_test.sh
+++ b/engine/tests/Benchmark.fuego_check_plots/fuego_test.sh
@@ -1,7 +1,3 @@
-function test_deploy {
-    return 0
-}
-
 function test_run {
     RESULT=$(( 1000 + (RANDOM % 600 - 300) ))
     report "echo fuego_check_plots result: $RESULT"
diff --git a/engine/tests/Benchmark.reboot/fuego_test.sh b/engine/tests/Benchmark.reboot/fuego_test.sh
index 603e545..102c1de 100755
--- a/engine/tests/Benchmark.reboot/fuego_test.sh
+++ b/engine/tests/Benchmark.reboot/fuego_test.sh
@@ -1,9 +1,5 @@
 tarball=none
 
-function test_build {
-	true
-}
-
 function test_deploy {
 	put $TEST_HOME/get_reboot_time.sh  $BOARD_TESTDIR/fuego.$TESTDIR/
 }
diff --git a/engine/tests/Functional.aiostress/fuego_test.sh b/engine/tests/Functional.aiostress/fuego_test.sh
index 7418af9..0e48c6b 100755
--- a/engine/tests/Functional.aiostress/fuego_test.sh
+++ b/engine/tests/Functional.aiostress/fuego_test.sh
@@ -18,10 +18,3 @@ function test_run {
     
     hd_test_clean_umount $FUNCTIONAL_AIOSTRESS_MOUNT_BLOCKDEV $FUNCTIONAL_AIOSTRESS_MOUNT_POINT
 }
-
-function test_processing {
-	true
-}
-
-
-
diff --git a/engine/tests/Functional.curl/fuego_test.sh b/engine/tests/Functional.curl/fuego_test.sh
index 81059d8..90d24dd 100755
--- a/engine/tests/Functional.curl/fuego_test.sh
+++ b/engine/tests/Functional.curl/fuego_test.sh
@@ -1,7 +1,3 @@
-function test_deploy {
-   true
-}
-
 function test_run {
     report "if curl -o test.html www.baidu.com > /dev/null; then echo 'TEST-1 OK'; else echo 'TEST-1 FAILED'; fi;\
     if curl -i -r 0-1024 http://www.sina.com.cn -o sina_part1.html > /dev/null; then echo 'TEST-2 OK'; else echo 'TEST-2 FAILED'; fi;\
diff --git a/engine/tests/Functional.fuego_abort/fuego_test.sh b/engine/tests/Functional.fuego_abort/fuego_test.sh
index 84f0a42..1d108cd 100755
--- a/engine/tests/Functional.fuego_abort/fuego_test.sh
+++ b/engine/tests/Functional.fuego_abort/fuego_test.sh
@@ -9,10 +9,6 @@ function test_pre_check {
     echo "This test has pid $$"
 }
 
-function test_deploy {
-    true
-}
-
 function test_run {
     # leave a process running on the target
     cmd "cd $BOARD_TESTDIR/fuego.$TESTDIR; ln -sf /bin/sleep fuegosleep ; $PROGRAM_NOHUP ./fuegosleep 10000 >/dev/null 2>&1 &"
@@ -26,10 +22,6 @@ function test_run {
     abort_job
 }
 
-function test_processing {
-    true
-}
-
 function more_handler1 {
     echo "in more_handler1 - got another SIGTERM"
     echo "in more_handler1 - got another SIGTERM" >>$LOGFILE
diff --git a/engine/tests/Functional.fuego_transport/fuego_test.sh b/engine/tests/Functional.fuego_transport/fuego_test.sh
index bf4667b..c182e61 100644
--- a/engine/tests/Functional.fuego_transport/fuego_test.sh
+++ b/engine/tests/Functional.fuego_transport/fuego_test.sh
@@ -2,48 +2,40 @@
 
 tarball=fuego-transport-1.0.tgz
 
-function test_build {
-	return 0
-}
-
-function test_deploy {
-	return 0
-}
-
 function test_run {
     # copy some files to the target under different conditions
     # get is tested by the system, with log retrieval
     desc="test single file put"
     DESTDIR=$BOARD_TESTDIR/fuego.$TESTDIR
     put bartop $DESTDIR
-    report "if [ -f $DESTDIR/bartop ] ; then echo \"ok 1 $desc\" ; else echo \"not ok 1 $desc\" ; fi" 
+    report "if [ -f $DESTDIR/bartop ] ; then echo \"ok 1 $desc\" ; else echo \"not ok 1 $desc\" ; fi"
     cmd "rm $DESTDIR/bartop"
 
     desc="test multiple file put"
     put footop foo2top $DESTDIR
-    report_append "if [ -f $DESTDIR/footop -a -f $DESTDIR/foo2top ] ; then echo \"ok 2 $desc\" ; else echo \"not ok 2 $desc\" ; fi" 
+    report_append "if [ -f $DESTDIR/footop -a -f $DESTDIR/foo2top ] ; then echo \"ok 2 $desc\" ; else echo \"not ok 2 $desc\" ; fi"
     cmd "rm $DESTDIR/foo*top"
 
     desc="test wildcard file put"
     put foo*top $DESTDIR
-    report_append "if [ -f $DESTDIR/footop -a -f $DESTDIR/foo2top ] ; then echo \"ok 3 $desc\" ; else echo \"not ok 3 $desc\" ; fi" 
+    report_append "if [ -f $DESTDIR/footop -a -f $DESTDIR/foo2top ] ; then echo \"ok 3 $desc\" ; else echo \"not ok 3 $desc\" ; fi"
     cmd "rm $DESTDIR/foo*top"
 
     desc="test recursive directory put"
     put dir1 $DESTDIR
-    report_append "if [ -f $DESTDIR/dir1/d1foo -a -f $DESTDIR/dir1/d1bar ] ; then echo \"ok 4 $desc\" ; else echo \"not ok 4 $desc\" ; fi" 
+    report_append "if [ -f $DESTDIR/dir1/d1foo -a -f $DESTDIR/dir1/d1bar ] ; then echo \"ok 4 $desc\" ; else echo \"not ok 4 $desc\" ; fi"
     cmd "rm $DESTDIR/dir1/*"
     cmd "rmdir $DESTDIR/dir1"
 
     desc="test multiple recursive dir put"
     put dir1 dir2 $DESTDIR
-    report_append "if [ -f $DESTDIR/dir1/d1foo -a -f $DESTDIR/dir1/d1bar -a -f $DESTDIR/dir2/d2foo -a -f $DESTDIR/dir2/d2bar ] ; then echo \"ok 5 $desc\" ; else echo \"not ok 5 $desc\" ; fi" 
+    report_append "if [ -f $DESTDIR/dir1/d1foo -a -f $DESTDIR/dir1/d1bar -a -f $DESTDIR/dir2/d2foo -a -f $DESTDIR/dir2/d2bar ] ; then echo \"ok 5 $desc\" ; else echo \"not ok 5 $desc\" ; fi"
     cmd "rm $DESTDIR/dir1/* $DESTDIR/dir2/*"
     cmd "rmdir $DESTDIR/dir1 $DESTDIR/dir2"
 
     desc="test multiple files, wildcards and recursive dirs put"
     put bartop foo*top dir* $DESTDIR
-    report_append "if [ -f $DESTDIR/bartop -a -f $DESTDIR/footop -a -f $DESTDIR/foo2top -a -f $DESTDIR/dir1/d1foo -a -f $DESTDIR/dir1/d1bar -a -f $DESTDIR/dir2/d2foo -a -f $DESTDIR/dir2/d2bar ] ; then echo \"ok 6 $desc\" ; else echo \"not ok 6 $desc\" ; fi" 
+    report_append "if [ -f $DESTDIR/bartop -a -f $DESTDIR/footop -a -f $DESTDIR/foo2top -a -f $DESTDIR/dir1/d1foo -a -f $DESTDIR/dir1/d1bar -a -f $DESTDIR/dir2/d2foo -a -f $DESTDIR/dir2/d2bar ] ; then echo \"ok 6 $desc\" ; else echo \"not ok 6 $desc\" ; fi"
     cmd "rm $DESTDIR/bartop $DESTDIR/foo*top $DESTDIR/dir1/* $DESTDIR/dir2/*"
     cmd "rmdir $DESTDIR/dir1 $DESTDIR/dir2"
 
@@ -53,5 +45,3 @@ function test_run {
 function test_processing {
     log_compare "$TESTDIR" "6" "^ok" "p"
 }
-
-
diff --git a/engine/tests/Functional.hciattach/fuego_test.sh b/engine/tests/Functional.hciattach/fuego_test.sh
index afe66aa..0082868 100755
--- a/engine/tests/Functional.hciattach/fuego_test.sh
+++ b/engine/tests/Functional.hciattach/fuego_test.sh
@@ -1,11 +1,3 @@
-function test_build {
-    echo True
-}
-
-function test_deploy {
-    echo True
-}
-
 function test_run {
 report "if hciattach -l;then echo 'TEST-1 OK'; else echo 'TEST-1 FAILED'; fi"
 }
@@ -14,5 +6,3 @@ function test_processing {
     log_compare "$TESTDIR" "1" "^TEST.*OK" "p"
     log_compare "$TESTDIR" "0" "^TEST.*FAILED" "n"
 }
-
-
diff --git a/engine/tests/Functional.iptables/fuego_test.sh b/engine/tests/Functional.iptables/fuego_test.sh
index 023c2d9..92a494a 100755
--- a/engine/tests/Functional.iptables/fuego_test.sh
+++ b/engine/tests/Functional.iptables/fuego_test.sh
@@ -1,11 +1,3 @@
-function test_build {
-	echo ' build OK '
-}
-
-function test_deploy {
-	echo ' deploy OK '
-}
-
 function test_run {
 	report " \
 	if	iptables -A INPUT -t filter -p tcp --dport 80 -j DROP; then \
@@ -18,7 +10,7 @@ function test_run {
 		else \
 			echo 'TEST-2 FAIL'; \
 		fi; \
-	if	iptables -t raw -I PREROUTING -p udp --dport 53 -j NOTRACK && 
+	if	iptables -t raw -I PREROUTING -p udp --dport 53 -j NOTRACK &&
 		iptables -t raw -I OUTPUT -p udp --dport 53 -j NOTRACK; then \
 			echo 'TEST-3 OK'; \
 		else \
@@ -56,7 +48,7 @@ function test_run {
 		else \
 			echo 'TEST-9 FAIL'; \
 		fi \
-	" 
+	"
 }
 
 function test_processing {
diff --git a/engine/tests/Functional.ipv6connect/fuego_test.sh b/engine/tests/Functional.ipv6connect/fuego_test.sh
index c6fdd05..22454e9 100755
--- a/engine/tests/Functional.ipv6connect/fuego_test.sh
+++ b/engine/tests/Functional.ipv6connect/fuego_test.sh
@@ -9,11 +9,5 @@ function test_deploy {
 }
 
 function test_run {
-	report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./ipv6connect"  
+	report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./ipv6connect"
 }
-
-function test_processing {
-	true
-}
-
-
diff --git a/engine/tests/Functional.linus_stress/fuego_test.sh b/engine/tests/Functional.linus_stress/fuego_test.sh
index a03debd..15265c4 100755
--- a/engine/tests/Functional.linus_stress/fuego_test.sh
+++ b/engine/tests/Functional.linus_stress/fuego_test.sh
@@ -21,9 +21,3 @@ function test_run {
         cat ./dirty_ratio > /proc/sys/vm/dirty_ratio; \
         cat ./dirty_bg > /proc/sys/vm/dirty_background_ratio || echo 'WARNING: /proc/sys/vm/dirty_background_ratio is read-only'"
 }
-
-function test_processing {
-	true
-}
-
-
diff --git a/engine/tests/Functional.net-tools/fuego_test.sh b/engine/tests/Functional.net-tools/fuego_test.sh
index b25f8b7..06c80b2 100755
--- a/engine/tests/Functional.net-tools/fuego_test.sh
+++ b/engine/tests/Functional.net-tools/fuego_test.sh
@@ -1,13 +1,5 @@
 #!/bin/bash
 
-function test_build {
-	true
-}
-
-function test_deploy {
-	pwd
-}
-
 function test_run {
 	report "if arp; then echo 'TEST-1 OK'; else echo 'TEST-1 FAIL'; fi; \
 	if hostname; then echo 'TEST-2 OK'; else echo 'TEST-2 FAIL'; fi; \
diff --git a/engine/tests/Functional.rmaptest/fuego_test.sh b/engine/tests/Functional.rmaptest/fuego_test.sh
index 84e360b..7dfeb69 100755
--- a/engine/tests/Functional.rmaptest/fuego_test.sh
+++ b/engine/tests/Functional.rmaptest/fuego_test.sh
@@ -9,17 +9,11 @@ function test_deploy {
 }
 
 function test_run {
-	assert_define FUNCTIONAL_RMAPTEST_ITERATIONS 
-	assert_define FUNCTIONAL_RMAPTEST_VMA 
-	assert_define FUNCTIONAL_RMAPTEST_VMA_SIZE 
-	assert_define FUNCTIONAL_RMAPTEST_TASKS 
-	assert_define FUNCTIONAL_RMAPTEST_VMAS_FOR_PROCESS 
+	assert_define FUNCTIONAL_RMAPTEST_ITERATIONS
+	assert_define FUNCTIONAL_RMAPTEST_VMA
+	assert_define FUNCTIONAL_RMAPTEST_VMA_SIZE
+	assert_define FUNCTIONAL_RMAPTEST_TASKS
+	assert_define FUNCTIONAL_RMAPTEST_VMAS_FOR_PROCESS
 
-	report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./rmap-test -h -i$FUNCTIONAL_RMAPTEST_ITERATIONS -n$FUNCTIONAL_RMAPTEST_VMA -s$FUNCTIONAL_RMAPTEST_VMA_SIZE -t$FUNCTIONAL_RMAPTEST_TASKS -V$FUNCTIONAL_RMAPTEST_VMAS_FOR_PROCESS -v file1.dat"  
+	report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./rmap-test -h -i$FUNCTIONAL_RMAPTEST_ITERATIONS -n$FUNCTIONAL_RMAPTEST_VMA -s$FUNCTIONAL_RMAPTEST_VMA_SIZE -t$FUNCTIONAL_RMAPTEST_TASKS -V$FUNCTIONAL_RMAPTEST_VMAS_FOR_PROCESS -v file1.dat"
 }
-
-function test_processing {
-	true
-}
-
-
-- 
2.7.4



  parent reply	other threads:[~2017-05-12  8:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12  8:19 [Fuego] New batch of patches Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 01/19] fail_regexp: rename FAIL_PATTERN to FAIL_REGEXP for coherency Daniel Sangorrin
2017-05-12 22:56   ` Bird, Timothy
2017-05-12  8:19 ` [Fuego] [PATCH 02/19] functions:fail_check_cases: add message when no fail cases available Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 03/19] ft2demos: fix test and add to docker Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 04/19] unpack: remove nostrip option Daniel Sangorrin
2017-05-12 22:57   ` Bird, Timothy
2017-05-12  8:19 ` [Fuego] [PATCH 05/19] unpack: move code related to spec-defined tarballs to unpack Daniel Sangorrin
2017-05-12 23:05   ` Bird, Timothy
2017-05-12  8:19 ` [Fuego] [PATCH 06/19] bc: test that specs can override the tarball variable Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 07/19] unpack: handle possible errors Daniel Sangorrin
2017-05-12 23:09   ` Bird, Timothy
2017-05-12  8:19 ` [Fuego] [PATCH 08/19] main: remove ReBuild check Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 09/19] rebuild: make it simpler for test developers Daniel Sangorrin
2017-05-12 23:02   ` Bird, Timothy
2017-05-16  2:35     ` Daniel Sangorrin
2017-05-16  4:35       ` Daniel Sangorrin
2017-05-16  4:52         ` Bird, Timothy
2017-05-16  5:14           ` Daniel Sangorrin
2017-05-12  8:19 ` Daniel Sangorrin [this message]
2017-05-12  8:19 ` [Fuego] [PATCH 11/19] expat: remove unneeded semicolons Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 12/19] tarball: remove unneeded tarball definitions Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 13/19] style: fix trailing spaces and indentation Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 14/19] parser: allow parser.py to skip processing Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 15/19] LTP: copy target_bin before modifying it Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 16/19] LTP: fix the buildonly and runonly cases Daniel Sangorrin
2017-05-12  8:19 ` [Fuego] [PATCH 17/19] LTP: add support for skipping certain test cases Daniel Sangorrin
2017-05-12 22:57   ` Bird, Timothy
2017-05-12  8:19 ` [Fuego] [PATCH 18/19] LTP: add a spec for docker Daniel Sangorrin
2017-05-12  8:20 ` [Fuego] [PATCH 19/19] LTP: add a fixthis for the -t flag Daniel Sangorrin
2017-05-12 22:52 ` [Fuego] New batch of patches Bird, Timothy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494577200-11597-11-git-send-email-daniel.sangorrin@toshiba.co.jp \
    --to=daniel.sangorrin@toshiba.co.jp \
    --cc=fuego@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.