SeattleTestbed / nodemanager

Remote control server for SeattleTestbed nodes
MIT License
0 stars 10 forks source link

Review Nodemanager unit tests with Affix integration. #91

Open choksi81 opened 10 years ago

choksi81 commented 10 years ago

I am attaching a tarball with all the latest nodemanager unit tests along with the latest version of the nodemanager. Both the nodemanager and the unit tests use the Affix framework to communicate. Someone will need to review the changes and test out the unit tests on different platform. Out of all the unit tests, about ~7 of the unit tests fail. (Some of them due to us not being able to overload the openconnection call properly with affix.openconnection) To run all the tests properly, check out a fresh version of all files from svn. Untar the file nodemanager_and_unit_tests.tar.gz. Copy nmmain.py into repy_v2/nodemanager/. Untar ut_nm_tests.tar.gz into the directory repy_v2/nodemanager/tests/

choksi81 commented 10 years ago

Curiously, a test that fails is the ut_nm_simple.r2py because the overloading of openconnection does not seem to work properly. However adding the simple line: "dy_import_module_symbols('time.r2py')" right above 'dy_import_module_symbols('nmclient.r2py')" fixes the issue. That is, if we import time.r2py, the overloading of the openconnection seems to work and the test passes. The same behavior can be seen in some of the other tests that are failing and are not importing time.r2py.

choksi81 commented 10 years ago

This ticket description is missing useful information. Why do you think overloading is the root cause? What error occurs? What should happen? I see:

justins-air:test2 justincappos$ python utf.py -f ut_nm_simple.r2py 
Testing module: nm
Now starting subprocess: ut_nm_subprocess.py
Generating user keys...
Generating key...
Writing config file...
Writing vessel dictionary...
    Running: ut_nm_simple.r2py                                  [ FAIL ]
--------------------------------------------------------------------------------
Standard error :
..............................Produced..............................
---
Uncaught exception!
---
Following is a full traceback, and a user traceback.
The user traceback excludes non-user modules. The most recent call is displayed last.

Full debugging traceback:
  "repy.py", line 154, in execute_namespace_until_completion
  "/Users/justincappos/oldmacbookpro/test2/virtual_namespace.py", line 117, in evaluate
  "/Users/justincappos/oldmacbookpro/test2/safe.py", line 586, in safe_run
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "/Users/justincappos/oldmacbookpro/test2/virtual_namespace.py", line 117, in evaluate
  "/Users/justincappos/oldmacbookpro/test2/safe.py", line 586, in safe_run
  "ut_nm_simple.r2py", line 19, in <module>
  "nmclient.r2py", line 373, in nmclient_getvesseldict
  "nmclient.r2py", line 290, in nmclient_rawsay
  "nmclient.r2py", line 83, in nmclient_rawcommunicate

User traceback:
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "ut_nm_simple.r2py", line 19, in <module>
  "nmclient.r2py", line 373, in nmclient_getvesseldict
  "nmclient.r2py", line 290, in nmclient_rawsay
  "nmclient.r2py", line 83, in nmclient_rawcommunicate

Exception (with class '.NMClientException'): Timed-out connecting to the remote host!
---

..............................Expected..............................
None
--------------------------------------------------------------------------------
Now stopping subprocess: ut_nm_subprocess.py

Is this what I'm supposed to see? Why or why not?

choksi81 commented 10 years ago

Alternatively, is this what is expected:

justins-air:test2 justincappos$ python utf.py -f ut_nm_simple.r2py 
Testing module: nm
Now starting subprocess: ut_nm_subprocess.py
Generating user keys...
Generating key...
Writing config file...
Writing vessel dictionary...
    Running: ut_nm_simple.r2py                                  [ FAIL ]
--------------------------------------------------------------------------------
Standard error :
..............................Produced..............................
---
Uncaught exception!
---
Following is a full traceback, and a user traceback.
The user traceback excludes non-user modules. The most recent call is displayed last.

Full debugging traceback:
  "repy.py", line 154, in execute_namespace_until_completion
  "/Users/justincappos/oldmacbookpro/test2/virtual_namespace.py", line 117, in evaluate
  "/Users/justincappos/oldmacbookpro/test2/safe.py", line 586, in safe_run
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "/Users/justincappos/oldmacbookpro/test2/virtual_namespace.py", line 117, in evaluate
  "/Users/justincappos/oldmacbookpro/test2/safe.py", line 586, in safe_run
  "ut_nm_simple.r2py", line 40, in <module>
  "nmclient.r2py", line 236, in nmclient_createhandle

User traceback:
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "ut_nm_simple.r2py", line 40, in <module>
  "nmclient.r2py", line 236, in nmclient_createhandle

Exception (with class '.NMClientException'): Provided destip is not valid! IP: '3fc19f3303dd7f9ad25bc43123af3929fbece978.zenodotus.poly.edu'
---

..............................Expected..............................
None
--------------------------------------------------------------------------------
Now stopping subprocess: ut_nm_subprocess.py
choksi81 commented 10 years ago

I changed the nm_client default timeout from 15 to 150. And here is what I got

Following is a full traceback, and a user traceback.
The user traceback excludes non-user modules. The most recent call is displayed last.

Full debugging traceback:
  "repy.py", line 154, in execute_namespace_until_completion
  "/Users/yyzh/project/seattle/branches/repy_v2/ticket1415/virtual_namespace.py", line 117, in evaluate
  "/Users/yyzh/project/seattle/branches/repy_v2/ticket1415/safe.py", line 586, in safe_run
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "/Users/yyzh/project/seattle/branches/repy_v2/ticket1415/virtual_namespace.py", line 117, in evaluate
  "/Users/yyzh/project/seattle/branches/repy_v2/ticket1415/safe.py", line 586, in safe_run
  "ut_nm_simple.r2py", line 42, in <module>
  "nmclient.r2py", line 236, in nmclient_createhandle

User traceback:
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "ut_nm_simple.r2py", line 42, in <module>
  "nmclient.r2py", line 236, in nmclient_createhandle

Exception (with class '.NMClientException'): The connection was refused!