Bug 8194 - 'FakeTarget' object has no attribute 'run_serial'
Summary: 'FakeTarget' object has no attribute 'run_serial'
Status: CLOSED DUPLICATE of bug 8203
Alias: None
Product: Runtime Testing
Classification: QA/Testing
Component: general (show other bugs)
Version: 1.8.1
Hardware: x86 Multiple
: Undecided critical
Target Milestone: ---
Assignee: Mariano Lopez
QA Contact: Daniel Istrate
URL:
Whiteboard:
Depends on: 8212
Blocks:
  Show dependency tree
 
Reported: 2015-08-21 09:14 UTC by zjh
Modified: 2015-10-12 03:34 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
This patch will allow to runexported script compatible with host dump (3.63 KB, patch)
2015-08-27 20:59 UTC, Mariano Lopez
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zjh 2015-08-21 09:14:00 UTC
When we use SimpleRemoteTarget or FakeTarget to run our testing. It will have this ERROR:
Traceback (most recent call last):
  File "/home/tester/Iot-auto/Iot_test_suites/gb_168full/iottest/oeqa/oetest.py", line 125, in tearDown
    self.dump_target_logs()
  File "/home/tester/Iot-auto/Iot_test_suites/gb_168full/iottest/oeqa/oetest.py", line 150, in dump_target_logs
    (status, output) = self.target.run_serial(comm)
AttributeError: 'FakeTarget' object has no attribute 'run_serial'
Comment 1 zjh 2015-08-25 07:00:32 UTC
reproduce condition: at least a error or a fail test case.

Another issue: If this happens, It will block posterior test cases.
It because an if sentence in oeRuntimeTest's teawDown:
   if (self._resultForDoCleanups.failures or
                self._resultForDoCleanups.errors):
       self.dump_target_logs()

In this sentence we must notice that self._resultForDoCleanups.failures and self._resultForDoCleanups.errors were lists, these two lists contain test cases have already failed or in error, so when an error(or fail) happens, this if is always true, and self.dump_target_logs() will always be executed.
Comment 2 zjh 2015-08-25 07:01:52 UTC
reproduce condition: at least a error or a fail test case.

Another issue: If this happens, It will block posterior test cases.
It because an if sentence in oeRuntimeTest's teawDown:
   if (self._resultForDoCleanups.failures or
                self._resultForDoCleanups.errors):
       self.dump_target_logs()

In this sentence we must notice that self._resultForDoCleanups.failures and self._resultForDoCleanups.errors were lists, these two lists contain test cases have already failed or in error, so when an error(or fail) happens, this if is always true, and self.dump_target_logs() will always be executed.
Comment 3 Cathy Shen 2015-08-25 09:42:31 UTC
I'm afraid this issue is easy to be reproduced and impact test a lot once there is fail cases, pls. prioritize the fixing.
Comment 4 Daniel Istrate 2015-08-26 14:22:39 UTC
Hi,

This issue seem to be similar with the one seen in bug 8203.
Please take a look at that and apply those patches and see if it works.

I tested with TEST_TARGET = "simpleremote", I am not so sure about fake target.


Thanks,
--Daniel
Comment 5 Mariano Lopez 2015-08-26 14:49:44 UTC
As Daniel mentioned in the last comment the patches in bug 8203 fix the simple remote bug, unfortunately they introduced another one when generating the exported test. I'm currently working on this.
Comment 6 Mariano Lopez 2015-08-26 15:12:55 UTC
Are you able to run exported tests? I'm not able to run them at all. For me it can't find module bb. If you are able to run it please let me know how.
Comment 7 Mariano Lopez 2015-08-26 16:50:02 UTC
I performed more testing. Trying with current master I get this traceback when I try to run the runexported.py script:

$ ./runexported.py testdata.json 
Traceback (most recent call last):
  File "./runexported.py", line 33, in <module>
    from oeqa.oetest import runTests
  File "/home/mlopezva/otc/repo/poky/bug8118/tmp/testimage/core-image-sato/oeqa/oetest.py", line 14, in <module>
    import bb
ImportError: No module named bb


Using bb for logging was introduced in 	058e75d60e98841c8532a05006ae46725e3cdfd1.
If I try before that commit I get this trace:

$ ./runexported.py testdata.json
SSH log file: /home/mlopezva/repo/poky/temp/tmp/testimage/core-image-sato/ssh_target_log.20150826075658
Traceback (most recent call last):
  File "./runexported.py", line 135, in <module>
    ret = main()
  File "./runexported.py", line 129, in main
    runTests(tc)
  File "/home/mlopezva/repo/poky/temp/tmp/testimage/core-image-sato/oeqa/oetest.py", line 35, in runTests
    suite = loadTests(tc, type)
  File "/home/mlopezva/repo/poky/temp/tmp/testimage/core-image-sato/oeqa/oetest.py", line 29, in loadTests
    suite = testloader.loadTestsFromNames(tc.testslist)
  File "/usr/lib64/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
AttributeError: 'module' object has no attribute 'buildcvs'


That is why I need to know how do you test using FakeTarget. I have a patch that I think solves the issue that will be introduced with the patches of bug 8203 but I don't have a way to testing it.
Comment 8 Mariano Lopez 2015-08-26 20:31:18 UTC
Bug 8212 opened for the exported case test.
Comment 9 zjh 2015-08-27 01:17:08 UTC
(In reply to comment #7)
> I performed more testing. Trying with current master I get this traceback
> when I try to run the runexported.py script:
> 
> $ ./runexported.py testdata.json 
> Traceback (most recent call last):
>   File "./runexported.py", line 33, in <module>
>     from oeqa.oetest import runTests
>   File
> "/home/mlopezva/otc/repo/poky/bug8118/tmp/testimage/core-image-sato/oeqa/
> oetest.py", line 14, in <module>
>     import bb
> ImportError: No module named bb
> 
> 
> Using bb for logging was introduced in 
> 058e75d60e98841c8532a05006ae46725e3cdfd1.
> If I try before that commit I get this trace:
> 
> $ ./runexported.py testdata.json
> SSH log file:
> /home/mlopezva/repo/poky/temp/tmp/testimage/core-image-sato/ssh_target_log.
> 20150826075658
> Traceback (most recent call last):
>   File "./runexported.py", line 135, in <module>
>     ret = main()
>   File "./runexported.py", line 129, in main
>     runTests(tc)
>   File
> "/home/mlopezva/repo/poky/temp/tmp/testimage/core-image-sato/oeqa/oetest.py",
> line 35, in runTests
>     suite = loadTests(tc, type)
>   File
> "/home/mlopezva/repo/poky/temp/tmp/testimage/core-image-sato/oeqa/oetest.py",
> line 29, in loadTests
>     suite = testloader.loadTestsFromNames(tc.testslist)
>   File "/usr/lib64/python2.7/unittest/loader.py", line 130, in
> loadTestsFromNames
>     suites = [self.loadTestsFromName(name, module) for name in names]
> AttributeError: 'module' object has no attribute 'buildcvs'
> 
> 
> That is why I need to know how do you test using FakeTarget. I have a patch
> that I think solves the issue that will be introduced with the patches of
> bug 8203 but I don't have a way to testing it.

Yes, we had found this issue before, But we use our scripts to export test suites, so we fixed this issue in our scripts
Comment 10 Mariano Lopez 2015-08-27 20:59:13 UTC
Created attachment 2691 [details]
This patch will allow to runexported script compatible with host dump

This is a patch allows to work exported test with host dump. Notice that I won't fix current broken export tests feature. I think you will need to rebase to patch to work with your scripts. Please note this patch requires http://lists.openembedded.org/pipermail/openembedded-core/2015-August/109376.html
Comment 11 Mariano Lopez 2015-08-27 21:00:43 UTC
I will mark as duplicate of bug 8203 because the same series of patches broke the hardware test functionality.

*** This bug has been marked as a duplicate of bug 8203 ***
Comment 12 Cathy Shen 2015-10-12 03:34:03 UTC
Close this ticket since it's fixed.