All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] [PATCH 1/7] environment.sh: remove this script not used by anyone
@ 2016-11-02  6:29 Daniel Sangorrin
  2016-11-02  6:29 ` [Fuego] [PATCH 2/7] reboot: fix the reboot test Daniel Sangorrin
  2016-11-02  6:29 ` [Fuego] [PATCH 3/7] scp: add the -r flag so that get supports directories Daniel Sangorrin
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Sangorrin @ 2016-11-02  6:29 UTC (permalink / raw)
  To: tim.bird, dmitry.cherkasov; +Cc: fuego

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
 engine/scripts/environment.sh | 36 ------------------------------------
 1 file changed, 36 deletions(-)
 delete mode 100755 engine/scripts/environment.sh

diff --git a/engine/scripts/environment.sh b/engine/scripts/environment.sh
deleted file mode 100755
index e00a925..0000000
--- a/engine/scripts/environment.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (c) 2014 Cogent Embedded, Inc.
-
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-
-PATH=/usr/local/bin:$PATH
-SSH=ssh -o ServerAliveInterval=30 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=15 $LOGIN@
-SCP=scp -o ServerAliveInterval=30 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=15
-
-# if [ "$BATCH_TESTPLAN" ]
-# then
-#     echo "using $BATCH_TESTPLAN batch testplan"
-#     TESTPLAN=$BATCH_TESTPLAN
-
-#     source $FUEGO_SCRIPTS_PATH/overlays.sh
-#     set_overlay_vars
-
-#     touch $OF_ROOT/work/use_batch_prolog
-# fi
-
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Fuego] [PATCH 2/7] reboot: fix the reboot test
  2016-11-02  6:29 [Fuego] [PATCH 1/7] environment.sh: remove this script not used by anyone Daniel Sangorrin
@ 2016-11-02  6:29 ` Daniel Sangorrin
  2016-11-02  6:29 ` [Fuego] [PATCH 3/7] scp: add the -r flag so that get supports directories Daniel Sangorrin
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Sangorrin @ 2016-11-02  6:29 UTC (permalink / raw)
  To: tim.bird, dmitry.cherkasov; +Cc: fuego

This patch fixes the reboot test:
  - tests.info: reboot has only a time plot at the moment. The
    memory and disk plots are not available so remove them
    until implemented.
    TODO: why are there two tests.info files?
  - functions.sh: instead of using a magic number it's better
    to let the user choose the maximum tries depending on the
    board
  - parser.py: adapt regex patterns to current kernels where
    the typical message is:
    [  timestamp] Freeing unused kernel memory
    In fact the current search pattern included 264K so probably
    it only worked for oneboard.
    The key time.init is changed to 'time' in order to
    match tests.info.
  - reboot: dmesg is more common than logread, so choose that.
    And search for 'Freeing' only because new kernels show
    a sligthly different message (Freeing unused kernel ..)
  - reference.log: a kernel should usually boot in less than
    10s not 1000s.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
 engine/scripts/functions.sh                 | 27 +++++++++++++++++++--------
 engine/tests/Benchmark.reboot/parser.py     | 14 +++++++-------
 engine/tests/Benchmark.reboot/reboot        |  9 +++------
 engine/tests/Benchmark.reboot/reboot.sh     |  5 ++++-
 engine/tests/Benchmark.reboot/reference.log |  6 ++----
 jobs/tests.info                             |  2 +-
 6 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/engine/scripts/functions.sh b/engine/scripts/functions.sh
index fd86d41..ef8c62e 100755
--- a/engine/scripts/functions.sh
+++ b/engine/scripts/functions.sh
@@ -391,16 +391,27 @@ function target_cleanup {
   cmd "rm -rf $FUEGO_HOME/* /tmp/* $FUEGO_HOME/.local"
 }
 
+# Reboot the target and wait until we reconnect to it
+#
+# Usage: target_reboot MAX_REBOOT_RETRIES
+#
+# [Note] retries are used instead of a simple timeout because 
+# 'cmd' may have an underlying timeout (e.g.: ConnectTimeout=15
+# for ssh).
 function target_reboot {
   ov_rootfs_reboot
-
-  sleep 30 # This magic number required as we need to wait until device reboots
-  cmd "true"
-  if [ $? ]; then
-   true
-  else
-   false
-  fi
+  # set +e because cmd will fail during the boot process
+  set +e
+  retries=0
+  while [ $retries -le $1 ]
+  do
+    cmd "true"
+    if [ $? -eq 0 ]; then return 0; fi
+    sleep 1
+    retries=$((retries+1));
+  done
+  set -e
+  abort_job "FAIL: reboot retries exhausted\n"
 }
 
 # $1 - tarball template
diff --git a/engine/tests/Benchmark.reboot/parser.py b/engine/tests/Benchmark.reboot/parser.py
index 9b0a6a3..14c893e 100755
--- a/engine/tests/Benchmark.reboot/parser.py
+++ b/engine/tests/Benchmark.reboot/parser.py
@@ -5,17 +5,17 @@ import os, re, sys
 sys.path.insert(0, os.environ['FUEGO_PARSER_PATH'])
 import common as plib
 
+# pattern that matches reference.log
+ref_section_pat = "^\[[\w]+.[gle]{2}\]"
 
-ref_section_pat = "^\[[\w\d_ ./]+.[gle]{2}\]"
-	
-# Jan  6 09:55:31 2013 (none) user.notice bootlog: [     2.227600] bootlogd.
-
-cur_search_pat = re.compile(" user.info kernel: \[ *([\d.]+)\] Freeing init memory: 264K\n")
+# pattern that matches 'reboot' (requires CONFIG_PRINTK_TIME=y)
+cur_search_pat = re.compile("\[\s*(.*)\] Freeing")
 
 cur_dict = {}
 pat_result = plib.parse(cur_search_pat)
 if pat_result:
 	for item in pat_result:
-		cur_dict["time.init"] = item[0]
+		cur_dict["time"] = item
+
+sys.exit(plib.process_data(ref_section_pat, cur_dict, 's', 'Kernel boot time (seconds)'))
 
-sys.exit(plib.process_data(ref_section_pat, cur_dict, 'm', ' '))
diff --git a/engine/tests/Benchmark.reboot/reboot b/engine/tests/Benchmark.reboot/reboot
index 40dfce2..4d4ad33 100755
--- a/engine/tests/Benchmark.reboot/reboot
+++ b/engine/tests/Benchmark.reboot/reboot
@@ -1,9 +1,6 @@
 #!/bin/sh
 
-# Bootlogd stop time (i.e. firmware startup time),
-# and X Server start time (i.e. minimum time before software can draw on the screen)
-/sbin/logread |grep -E 'Freeing init memory'
-
-# Memory usage in KiB
-#top -b -n 1 |grep '^Mem:'
+# Assume that the kernel boot ends when the last
+# message containing 'Freeing' appears.
+dmesg | grep -E 'Freeing'
 
diff --git a/engine/tests/Benchmark.reboot/reboot.sh b/engine/tests/Benchmark.reboot/reboot.sh
index 3fc682f..179dd8d 100644
--- a/engine/tests/Benchmark.reboot/reboot.sh
+++ b/engine/tests/Benchmark.reboot/reboot.sh
@@ -9,7 +9,10 @@ function test_deploy {
 }
 
 function test_run {
-	target_reboot
+	# MAX_REBOOT_RETRIES can be defined in the board's file. 
+	# Otherwise, the default is 10 retries
+	retries=${MAX_REBOOT_RETRIES:-10}
+	target_reboot $retries
 	report "cd $FUEGO_HOME/fuego.$TESTDIR; ./reboot"  
 }
 
diff --git a/engine/tests/Benchmark.reboot/reference.log b/engine/tests/Benchmark.reboot/reference.log
index 3c8e159..7504269 100755
--- a/engine/tests/Benchmark.reboot/reference.log
+++ b/engine/tests/Benchmark.reboot/reference.log
@@ -1,4 +1,2 @@
-# Automatically generated on fuego host by thresholds.awk based on
-# 7 results of 0\.18\.04\. firmware regexp crossed with [652, 658] build range
-[time.init|le]
-10000
+[time|le]
+10
diff --git a/jobs/tests.info b/jobs/tests.info
index 1eb7ec9..7cda77a 100644
--- a/jobs/tests.info
+++ b/jobs/tests.info
@@ -20,7 +20,7 @@
 	"linpack":["linpack"],
 	"nbench-byte":["INDEX","TEST_GROUP1","TEST_GROUP2"],
 	"netperf":["MIGRATED_TCP_MAERTS","MIGRATED_TCP_STREAM"],
-	"reboot":["time", "mem", "disk"],
+	"reboot":["time"],
 	"Stream":["Add","Copy","Scale","Triad"],
 	"unixbench":["System_Index","Test"],
 	"Whetstone":["Whetstone"],
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Fuego] [PATCH 3/7] scp: add the -r flag so that get supports directories
  2016-11-02  6:29 [Fuego] [PATCH 1/7] environment.sh: remove this script not used by anyone Daniel Sangorrin
  2016-11-02  6:29 ` [Fuego] [PATCH 2/7] reboot: fix the reboot test Daniel Sangorrin
@ 2016-11-02  6:29 ` Daniel Sangorrin
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Sangorrin @ 2016-11-02  6:29 UTC (permalink / raw)
  To: tim.bird, dmitry.cherkasov; +Cc: fuego

Without the -r flag, only individual files can be retreived
from the target.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
 engine/overlays/base/base-board.fuegoclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/engine/overlays/base/base-board.fuegoclass b/engine/overlays/base/base-board.fuegoclass
index def0da4..a511151 100644
--- a/engine/overlays/base/base-board.fuegoclass
+++ b/engine/overlays/base/base-board.fuegoclass
@@ -10,7 +10,7 @@ SRV_IP="`/sbin/ip a s |awk -F ' +|/' '/inet / && $3 != "127.0.0.1" { print $3; e
 function ov_transport_get () {
   case "$TRANSPORT" in
   "ssh")
-    $SCP $LOGIN@${DEVICE}:"$1" "${*:2}"
+    $SCP -r $LOGIN@${DEVICE}:"$1" "${*:2}"
     ;;
   "serial")
     ;;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-02  6:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-02  6:29 [Fuego] [PATCH 1/7] environment.sh: remove this script not used by anyone Daniel Sangorrin
2016-11-02  6:29 ` [Fuego] [PATCH 2/7] reboot: fix the reboot test Daniel Sangorrin
2016-11-02  6:29 ` [Fuego] [PATCH 3/7] scp: add the -r flag so that get supports directories Daniel Sangorrin

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.