[Fuego] Integrate in-house test to Fuego

dhinakar k dhinakar.k at gmail.com
Mon Jun 5 18:09:56 UTC 2017


Hi Tim,

I tried to duplicate Functional.hello_world test.
Modified the fuego_test.sh as shown below.

#!/bin/bash

#tarball=hello-test-1.1.tgz

function test_build {
    make
}

function test_deploy {
    put /fuego-rw/transfer/hello_ssir $BOARD_TESTDIR/fuego.$TESTDIR/
    #put hello_ssir  $BOARD_TESTDIR/fuego.$TESTDIR/
}

function test_run {
#    assert_define FUNCTIONAL_HELLO_WORLD_ARG
    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./hello_ssir
$FUNCTIONAL_HELLO_WORLD_ARG"
}

function test_processing {
    log_compare "$TESTDIR" "1" "SUCCESS" "p"
}


My
BOARD_TESTDIR=/home/a
TESTDIR=Functional.ssir_hello

I ahve

But I keep getting the below mentioned error

'scp: /home/a/fuego.Functional.ssir_hello/Functional.ssir_hello.log:
No such file or directory'

error during execution even though I have kept the hello_ssir
executable under /home/dhinakar/fuego/fuego-rw/transfer

directory.

I think i am making some silly mistake. Can you please guide me on
this. I have pasted the detailed log below

for your reference.

.........................................................................................................
.........................................................................................................

+ cmd 'if [ ! -d /home/a ]; then mkdir -p /home/a; fi'
+ report_devlog 'cmd: if [ ! -d /home/a ]; then mkdir -p /home/a; fi'
+ echo 'cmd: if [ ! -d /home/a ]; then mkdir -p /home/a; fi'
+ ov_transport_cmd 'if [ ! -d /home/a ]; then mkdir -p /home/a; fi'
+ case "$TRANSPORT" in
+ sshpass -e ssh -o ServerAliveInterval=30 -o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null -o ConnectTimeout=30 -p 22
root at 192.168.1.117 'if [ ! -d /home/a ]; then mkdir -p /home/a; fi'
Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts.
+ local fuego_test_dir=/home/a/fuego.Functional.ssir_hello
+ local fuego_test_tmp=/tmp/fuego.Functional.ssir_hello
+ cmd 'rm -rf /home/a/fuego.Functional.ssir_hello
/tmp/fuego.Functional.ssir_hello; mkdir -p
/home/a/fuego.Functional.ssir_hello'
+ report_devlog 'cmd: rm -rf /home/a/fuego.Functional.ssir_hello
/tmp/fuego.Functional.ssir_hello; mkdir -p
/home/a/fuego.Functional.ssir_hello'
+ echo 'cmd: rm -rf /home/a/fuego.Functional.ssir_hello
/tmp/fuego.Functional.ssir_hello; mkdir -p
/home/a/fuego.Functional.ssir_hello'
+ ov_transport_cmd 'rm -rf /home/a/fuego.Functional.ssir_hello
/tmp/fuego.Functional.ssir_hello; mkdir -p
/home/a/fuego.Functional.ssir_hello'
+ case "$TRANSPORT" in
+ sshpass -e ssh -o ServerAliveInterval=30 -o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null -o ConnectTimeout=30 -p 22
root at 192.168.1.117 'rm -rf /home/a/fuego.Functional.ssir_hello
/tmp/fuego.Functional.ssir_hello; mkdir -p
/home/a/fuego.Functional.ssir_hello'
Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts.
+ ov_logger 'Starting test ubuntu-x86-target.default.Functional.ssir_hello'
+ local fuego_test_tmp=/tmp/fuego.Functional.ssir_hello
+ local fake_log=/tmp/fuego.Functional.ssir_hello/fake-syslog
+ cmd 'if [ ! -f /tmp/fuego.Functional.ssir_hello/fake-syslog ] ; then
		mkdir -p /tmp/fuego.Functional.ssir_hello ; touch
/tmp/fuego.Functional.ssir_hello/fake-syslog ; fi ; 		echo Starting
test ubuntu-x86-target.default.Functional.ssir_hello >>
/tmp/fuego.Functional.ssir_hello/fake-syslog'
+ report_devlog 'cmd: if [ ! -f
/tmp/fuego.Functional.ssir_hello/fake-syslog ] ; then 		mkdir -p
/tmp/fuego.Functional.ssir_hello ; touch
/tmp/fuego.Functional.ssir_hello/fake-syslog ; fi ; 		echo Starting
test ubuntu-x86-target.default.Functional.ssir_hello >>
/tmp/fuego.Functional.ssir_hello/fake-syslog'
+ echo 'cmd: if [ ! -f /tmp/fuego.Functional.ssir_hello/fake-syslog ]
; then 		mkdir -p /tmp/fuego.Functional.ssir_hello ; touch
/tmp/fuego.Functional.ssir_hello/fake-syslog ; fi ; 		echo Starting
test ubuntu-x86-target.default.Functional.ssir_hello >>
/tmp/fuego.Functional.ssir_hello/fake-syslog'
+ ov_transport_cmd 'if [ ! -f
/tmp/fuego.Functional.ssir_hello/fake-syslog ] ; then 		mkdir -p
/tmp/fuego.Functional.ssir_hello ; touch
/tmp/fuego.Functional.ssir_hello/fake-syslog ; fi ; 		echo Starting
test ubuntu-x86-target.default.Functional.ssir_hello >>
/tmp/fuego.Functional.ssir_hello/fake-syslog'
+ case "$TRANSPORT" in
+ sshpass -e ssh -o ServerAliveInterval=30 -o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null -o ConnectTimeout=30 -p 22
root at 192.168.1.117 'if [ ! -f
/tmp/fuego.Functional.ssir_hello/fake-syslog ] ; then 		mkdir -p
/tmp/fuego.Functional.ssir_hello ; touch
/tmp/fuego.Functional.ssir_hello/fake-syslog ; fi ; 		echo Starting
test ubuntu-x86-target.default.Functional.ssir_hello >>
/tmp/fuego.Functional.ssir_hello/fake-syslog'
Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts.
+ dump_syslogs /tmp/fuego.Functional.ssir_hello before
+ is_empty /tmp/fuego.Functional.ssir_hello
+ '[' -z /tmp/fuego.Functional.ssir_hello ']'
+ is_empty before
+ '[' -z before ']'
+ ov_rootfs_logread /tmp/fuego.Functional.ssir_hello before
+ local fake_log=/tmp/fuego.Functional.ssir_hello/fake-syslog
+ cmd 'cd /tmp/fuego.Functional.ssir_hello && cat
/tmp/fuego.Functional.ssir_hello/fake-syslog >
ubuntu-x86-target.4.4.before'
+ report_devlog 'cmd: cd /tmp/fuego.Functional.ssir_hello && cat
/tmp/fuego.Functional.ssir_hello/fake-syslog >
ubuntu-x86-target.4.4.before'
+ echo 'cmd: cd /tmp/fuego.Functional.ssir_hello && cat
/tmp/fuego.Functional.ssir_hello/fake-syslog >
ubuntu-x86-target.4.4.before'
+ ov_transport_cmd 'cd /tmp/fuego.Functional.ssir_hello && cat
/tmp/fuego.Functional.ssir_hello/fake-syslog >
ubuntu-x86-target.4.4.before'
+ case "$TRANSPORT" in
+ sshpass -e ssh -o ServerAliveInterval=30 -o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null -o ConnectTimeout=30 -p 22
root at 192.168.1.117 'cd /tmp/fuego.Functional.ssir_hello && cat
/tmp/fuego.Functional.ssir_hello/fake-syslog >
ubuntu-x86-target.4.4.before'
Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts.
+ ov_rootfs_sync
+ cmd sync
+ report_devlog 'cmd: sync'
+ echo 'cmd: sync'
+ ov_transport_cmd sync
+ case "$TRANSPORT" in
+ sshpass -e ssh -o ServerAliveInterval=30 -o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null -o ConnectTimeout=30 -p 22
root at 192.168.1.117 sync
Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts.

+ ov_rootfs_drop_caches
+ cmd 'echo 3 > /proc/sys/vm/drop_caches'
+ report_devlog 'cmd: echo 3 > /proc/sys/vm/drop_caches'
+ echo 'cmd: echo 3 > /proc/sys/vm/drop_caches'
+ ov_transport_cmd 'echo 3 > /proc/sys/vm/drop_caches'
+ case "$TRANSPORT" in
+ sshpass -e ssh -o ServerAliveInterval=30 -o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null -o ConnectTimeout=30 -p 22
root at 192.168.1.117 'echo 3 > /proc/sys/vm/drop_caches'
Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts.

+ echo '##### doing fuego phase: build ########'
##### doing fuego phase: build ########
+ build
+ local ret
+ pre_build
+ cd /fuego-rw/buildzone
+ mkdir -p ubuntu-x86-target.default.Functional.ssir_hello-x86_64

+ cd ubuntu-x86-target.default.Functional.ssir_hello-x86_64
+ concurrent_check
+ LOCKFILE=/fuego-rw/buildzone/ubuntu-x86-target.default.Functional.ssir_hello-x86_64.build.lock
+ '[' -e /fuego-rw/buildzone/ubuntu-x86-target.default.Functional.ssir_hello-x86_64.build.lock
']'
+++ cat /fuego-rw/buildzone/ubuntu-x86-target.default.Functional.ssir_hello-x86_64.build.lock
++ wget -qO- 'http://localhost:8080/fuego/job/ubuntu-x86-target.default.Functional.ssir_hello/3//api/xml?xpath=*/building/text%28%29'

+ false
+ echo http://localhost:8080/fuego/job/ubuntu-x86-target.default.Functional.ssir_hello/4/
+ '[' true = false ']'
+ ls -A1
+ xargs rm -rf
+ unpack
++ echo FUNCTIONAL.SSIR_HELLO
++ tr . _
+ upName=FUNCTIONAL_SSIR_HELLO
+ spec_tarball=FUNCTIONAL_SSIR_HELLO_TARBALL
+ '[' '!' -z '' ']'
+ '[' '!' -z ']'
+ spec_gitrepo=FUNCTIONAL_SSIR_HELLO_GITREPO
+ spec_gitref=FUNCTIONAL_SSIR_HELLO_GITREF
+ '[' '!' -z '' ']'
+ '[' '!' -z '' ']'
+ '[' '!' -z ']'
+ echo 'No tarball or gitrepo definition.'
No tarball or gitrepo definition.
+ '[' -e fuego_test_succesfully_built ']'
++ date +%s.%N

+ build_start_time=1496685449.984354934
+ call_if_present test_build
+ declare -f -F test_build
+ test_build
+ make
make: *** No targets specified and no makefile found.  Stop.
+ signal_handler
+ echo 'in signal_handler'
in signal_handler
+ post_test
+ trap post_term_handler SIGTERM
+ trap - SIGHUP SIGALRM SIGINT ERR EXIT
+ fetch_results
+ local fuego_test_tmp=/tmp/fuego.Functional.ssir_hello
+ firmware
+ ov_get_firmware
++ cmd 'uname -r | xargs echo '
++ report_devlog 'cmd: uname -r | xargs echo '
++ echo 'cmd: uname -r | xargs echo '
++ ov_transport_cmd 'uname -r | xargs echo '
++ case "$TRANSPORT" in
++ sshpass -e ssh -o ServerAliveInterval=30 -o
StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o
ConnectTimeout=30 -p 22 root at 192.168.1.117 'uname -r | xargs echo '

Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts.

+ FW=4.8.0-52-generic
+ export FWVER=4.8.0-52-generic
+ FWVER=4.8.0-52-generic
+ get /home/a/fuego.Functional.ssir_hello/Functional.ssir_hello.log
/fuego-rw/logs/Functional.ssir_hello/ubuntu-x86-target.default.4.4/testlog.txt
+ report_devlog 'get:
/home/a/fuego.Functional.ssir_hello/Functional.ssir_hello.log'
/fuego-rw/logs/Functional.ssir_hello/ubuntu-x86-target.default.4.4/testlog.txt
+ echo 'get: /home/a/fuego.Functional.ssir_hello/Functional.ssir_hello.log'
/fuego-rw/logs/Functional.ssir_hello/ubuntu-x86-target.default.4.4/testlog.txt
+ ov_transport_get
/home/a/fuego.Functional.ssir_hello/Functional.ssir_hello.log
/fuego-rw/logs/Functional.ssir_hello/ubuntu-x86-target.default.4.4/testlog.txt
+ case "$TRANSPORT" in
+ sshpass -e scp -o ServerAliveInterval=30 -o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null -o ConnectTimeout=30 -P 22 -r
root at 192.168.1.117:/home/a/fuego.Functional.ssir_hello/Functional.ssir_hello.log
/fuego-rw/logs/Functional.ssir_hello/ubuntu-x86-target.default.4.4/testlog.txt
Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts.
scp: /home/a/fuego.Functional.ssir_hello/Functional.ssir_hello.log: No
such file or directory
Build step 'Execute shell' marked build as failure
[description-setter] Description set: <a
href="/fuego/userContent/fuego.logs/Functional.ssir_hello/ubuntu-x86-target.default.4.4/plot.png">plot</a>
<a href="/fuego/userContent/fuego.logs/Functional.ssir_hello/ubuntu-x86-target.default.4.4/testlog.txt">log</a>
Finished: FAILURE


On Tue, May 30, 2017 at 7:12 PM, dhinakar k <dhinakar.k at gmail.com> wrote:

> Thank Daniel and Tim,
>
> I will try your suggestions and get back to you if I have any queries. The
> objective is to run the in-house tests using Fuego test framework excluding
> only the build step.
>
> @Tim - Hope you had a successful business trip. I read you email to the
> community about your trip. Thank you very much for the prompt support, as
> always. By the way may I know when is your plan to release v1.2. Daniel
> shared me a mail thread on that. But just wanted to confirm with you.
>
> Regards,
> Dhinakar
>
> On May 30, 2017 12:03 PM, "Bird, Timothy" <Tim.Bird at sony.com> wrote:
>
>> Hey Dhinakar,
>>
>> Sorry to be off-list for a few days.  I've been busy with traveling and
>> some other work.
>> I'll try to catch up and answer the last few days of questions, working
>> backwards from this one.
>>
>> > -----Original Message-----
>> > From: dhinakar k on Tuesday, May 30, 2017 12:38 AM
>> >
>> > I just want to integrate our in-house tests to Fuego dashboard. They are
>> > already cross compiled and hence I don't want to build them again. Only
>> > deploy and run. I am not sure where to keep the binaries, how to copy
>> them
>> > during deployment stage, execute them and just mark pass/fail status. I
>> tried​
>> > a few things but it is not able to recognize the path (path not found).
>> Also the
>> > /fuego-rw/build one/ gets cleaned up during build stage and hence cannot
>> > keep the binaries there. Is there any template for integrating such
>> in-house
>> > tests? Please share or let me know the procedure to achieve my goal.
>>
>> There are a couple of ways of handling this.  Daniel gave a good summary
>> that
>> applies if you can put the binary into your fuego-core repository.  Let
>> me add
>> some ideas:
>>
>> The test_deploy step can execute an arbitrary sequence of commands to put
>> the
>> test software onto the target.  It executes on the host, inside the
>> container, so this
>> gives it certain constraints.  When test_deploy is called, the current
>> directory is
>> the build directory (which is always created, whether there is a
>> test_build
>> function for your test or not).  However, you can reference the test's
>> "home" directory,
>> using the shell variable $TEST_HOME.  So you can easily transfer
>> materials from that
>> directory to the target.
>>
>> Here is the test_deploy function from Functional.fuego_board_check's base
>> script:
>> Note that scan_for_items.sh is not a compiled program, so there is no
>> build phase
>> for this test.  scan_for_items.sh is in the directory:
>> /fuego-core/engine/tests/Functional.fuego_board_check
>> (which is this test's home directory).
>>
>> function test_deploy {
>>     put $TEST_HOME/scan_for_items.sh  $BOARD_TESTDIR/fuego.$TESTDIR/
>> }
>>
>> So, as Daniel said, you can put binaries or other test materials into the
>> test's home directory.
>> This will be something like: fuego-core/engine/tests/Functi
>> onal.my_test_name.
>> You may want to grab the binary from some other location, such as a local
>> build directory
>> or a network server.  I would recommend either setting up a network
>> server for these
>> files, that the test_deploy function can access from inside the
>> container, or placing them
>> from the host into a directory visible inside the container.  For this
>> later method, I use
>> something like /fuego-rw/transfer (a directory I create myself).  Any
>> directory under fuego-rw
>> is readable and writable both from the host and inside the docker
>> container.
>> From the host, this would be under your 'fuego/fuego-rw' directory. (ex:
>> mine is in:
>> /home/tbird/work/fuego/fuego-rw/transfer)  This directory is
>> volume-mounted inside
>> the container, and 'fuego-rw' is mounted at the root of the container
>> filesystem.
>> So this would appear inside the container as /fuego-rw/transfer.
>>
>> Here are some examples of these different techniques:
>> test_deploy using networking to grab the test binary.
>> Assuming you have a web server set up somewhere (locally or on
>> another machine, and it can deliver your files, and is called
>> 'my_test_binary_server')
>>
>> function test_deploy {
>>     wget http://my_test_binary_server/my_test_binary
>>     put my_test_binary  $BOARD_TESTDIR/fuego.$TESTDIR/
>> }
>>
>> test_deploy using the transfer directory:
>>
>> function test_deploy {
>>   put /fuego-rw/transfer/my_test_binary $BOARD_TESTDIR/fuego.$TESTDIR/
>> }
>>
>> This last example assumes that there is some method of populating the
>> fuego-rw/transfer
>> directory with test binaries.  If they never change, this only needs to
>> be done once.
>> If they change frequently, they will need to be updated before you run
>> your tests.
>>
>> Note that having the binary outside the test home directory will make it
>> impossible
>> to share your test with others (unless the server is a public server).
>> For this reason we
>> strongly encourage putting all materials needed to perform the test into
>> the test home
>> directory.  Additionally, this is the same reason we prefer to provide or
>> reference source
>> code (rather than binaries) for a test, so that it is independent of any
>> particular
>> architecture or distribution.
>>
>> Soon we will support packaging a test and transferring the test to another
>> machine as a bundle.  The code to do this puts material from the test's
>> home directory
>> into the test package, so again, that is the preferred location for test
>> source and test
>> binaries.
>>
>> Once the binaries are deployed, they are executed like any other test
>> program.
>> Usually you will execute something on the target board using the 'report'
>> function.
>> This function runs the program on the board, gathers the standard output
>> from the
>> test binary, and places it into the test log.
>>
>> Usually, to report success or failure for a test (for a Functional test),
>> you run the log_compare
>> function.  You can specify a pattern string to find in the test log, and
>> if that pattern is
>> found a particular number of times, then the test is marked as success.
>>
>> If your test binary produces no output, and the only thing you have to
>> check is the
>> exit code, then I would structure the argument to the "report" function
>> to output
>> a single string that you can check with log_compare.  I'm making this up,
>> so the syntax
>> might not be exact, but you can do something like:
>>
>> function test_run {
>>    report "if $BOARD_TESTDIR/fuego.$TESTDIR/my_test_binary ; then echo
>> 'ok'  ; else echo 'fail' ; fi"
>> }
>>
>> function test_processing {
>>    log_compare "$TESTDIR" "1" "^ok" "p"
>> }
>>
>> I hope this is helpful.
>>  -- Tim
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/fuego/attachments/20170605/b4ec85cd/attachment-0001.html>


More information about the Fuego mailing list