Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pythonize run_unit_tests.sh #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Pythonize run_unit_tests.sh #58

wants to merge 2 commits into from

Conversation

XuefengHuang
Copy link

This helper script for Seattle Testbed, https://seattle.poly.edu/,

  • downloads Seattle Testbed's sources from GitHub,
  • builds them using Seattle's build scripts, and finally
  • runs Seattle's unit tests.

This helper script for Seattle Testbed, https://seattle.poly.edu/,
 * downloads Seattle Testbed's sources from GitHub,
 * builds them using Seattle's build scripts, and finally
 * runs Seattle's unit tests.
@XuefengHuang
Copy link
Author

This is part of the PR's test result:

Xuefengs-MacBook-Pro:untitled folder Xuefeng$ python run_unit_tests.py
Running tests for this list of SeattleTestbed's repositories: common nodemanager repy_v2 seattlelib_v2 seash softwareupdater utf
Testing SeattleTestbed/common now...
https://github.com/SeattleTestbed/common.git
Cloning into 'common'...
remote: Counting objects: 226, done.
remote: Total 226 (delta 0), reused 0 (delta 0), pack-reused 226
Receiving objects: 100% (226/226), 62.15 KiB | 0 bytes/s, done.
Resolving deltas: 100% (110/110), done.
Checking connectivity... done.
SeattleTestbed/commonhas no "tests" directory. Skipping.
Testing SeattleTestbed/nodemanager now...
https://github.com/SeattleTestbed/nodemanager.git
Cloning into 'nodemanager'...
remote: Counting objects: 794, done.
remote: Total 794 (delta 0), reused 0 (delta 0), pack-reused 794
Receiving objects: 100% (794/794), 284.42 KiB | 0 bytes/s, done.
Resolving deltas: 100% (639/639), done.
Checking connectivity... done.
Checking out repo from https://github.com/SeattleTestbed/seattlelib_v2 ...
Done!
Checking out repo from https://github.com/SeattleTestbed/portability ...
Done!
Checking out repo from https://github.com/SeattleTestbed/repy_v2 ...
Done!
Checking out repo from https://github.com/SeattleTestbed/affix ...
Done!
Checking out repo from https://github.com/SeattleTestbed/common ...
Done!
Checking out repo from https://github.com/SeattleTestbed/seash ...
Done!
Checking out repo from https://github.com/SeattleTestbed/utf ...
Done!
Building into /Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE
Done building!
Testing module: nm
Now starting subprocess: ut_nm_subprocess.py
Generating user keys...
Generating key...
Writing config file...
Writing vessel dictionary...
    Running: ut_nm_addfiletovessel.r2py                         [ PASS ]
    Running: ut_nm_addfiletovessel_duplicate_filename.r2py      [ PASS ]
    Running: ut_nm_addfiletovessel_emptyfile.r2py               [ PASS ]
    Running: ut_nm_addfiletovessel_emptyfilename.r2py           [ PASS ]
    Running: ut_nm_addfiletovessel_invalidfilename.r2py         [ PASS ]
    Running: ut_nm_addfiletovessel_parentdir.r2py               [ PASS ]
    Running: ut_nm_changeadvertise.r2py                         [ PASS ]
    Running: ut_nm_changeadvertise_invalidsequenceid.r2py       [ PASS ]
    Running: ut_nm_changeadvertise_invalidsequenceidnegative.r2py [ PASS ]
    Running: ut_nm_changeadvertise_invalidsequenceidstring.r2py [ PASS ]
    Running: ut_nm_changeowner.r2py                             [ PASS ]
    Running: ut_nm_changeowner_expired.r2py                     [ PASS ]
    Running: ut_nm_changeowner_invalidkey.r2py                  [ PASS ]
    Running: ut_nm_changeowner_validsequenceid.r2py             [ PASS ]
    Running: ut_nm_changeownerinfo.r2py                         [ PASS ]
    Running: ut_nm_changeownerinfo_emptystring.r2py             [ PASS ]
    Running: ut_nm_changeownerinfo_escapecharacters.r2py        [ PASS ]
    Running: ut_nm_changeownerinfo_longstring.r2py              [ PASS ]
    Running: ut_nm_changeownerinfo_unicode.r2py                 [ PASS ]
    Running: ut_nm_changeusers.r2py                             [ PASS ]
    Running: ut_nm_changeusers_invalid_action.r2py              [ PASS ]
    Running: ut_nm_changeusers_invalidactions.r2py              [ PASS ]
    Running: ut_nm_deletefileinvessel.r2py                      [ PASS ]
    Running: ut_nm_fastclient.py                                [ FAIL ]
--------------------------------------------------------------------------------
Standard error :
..............................Produced..............................
Traceback (most recent call last):
  File "ut_nm_fastclient.py", line 41, in <module>
    nmhandle = fastnmclient.nmclient_createhandle(getmyip(), 1224)
  File "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/fastnmclient.py", line 275, in nmclient_createhandle
    raise NMClientException, e
fastnmclient.NMClientException: The connection was refused!

..............................Expected..............................
None
--------------------------------------------------------------------------------
    Running: ut_nm_getoffcut.r2py                               [ PASS ]
    Running: ut_nm_getresources.r2py                            [ PASS ]
    Running: ut_nm_joinsplitvessels.r2py                        [ PASS ]
    Running: ut_nm_listfilesinvessel.r2py                       [ PASS ]
    Running: ut_nm_listfilesinvessel_add_and_remove.r2py        [ PASS ]
    Running: ut_nm_listfilesinvessel_clean_state_add.r2py       [ PASS ]
    Running: ut_nm_listfilesinvessel_no_files.r2py              [ PASS ]
    Running: ut_nm_private_addfile.r2py                         [ PASS ]
    Running: ut_nm_private_deletefile.r2py                      [ PASS ]
    Running: ut_nm_private_listfiles.r2py                       [ PASS ]
    Running: ut_nm_private_resetvessel.r2py                     [ PASS ]
    Running: ut_nm_private_retrievefile.r2py                    [ PASS ]
    Running: ut_nm_rawsayemptymethodname.r2py                   [ PASS ]
    Running: ut_nm_rawsaynonexistentmethod.r2py                 [ PASS ]
    Running: ut_nm_readvessellog.r2py                           [ PASS ]
    Running: ut_nm_resetvessel.r2py                             [ PASS ]
    Running: ut_nm_resetvessel_multireset.r2py                  [ PASS ]
    Running: ut_nm_signedsayemptymethodname.r2py                [ PASS ]
    Running: ut_nm_signedsaynonexistentmethod.r2py              [ PASS ]
    Running: ut_nm_simple.r2py                                  [ PASS ]
    Running: ut_nm_startstopvessel.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/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "ut_nm_startstopvessel.r2py", line 82, in <module>
  "nmclient.r2py", line 435, in nmclient_getvesseldict
  "nmclient.r2py", line 352, in nmclient_rawsay
  "nmclient.r2py", line 144, 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_startstopvessel.r2py", line 82, in <module>
  "nmclient.r2py", line 435, in nmclient_getvesseldict
  "nmclient.r2py", line 352, in nmclient_rawsay
  "nmclient.r2py", line 144, in nmclient_rawcommunicate

Exception (with class '.NMClientException'): RepyArgumentError("Provided destip is not valid! IP: '78c376508e688efc78519c39abb82f54964631e9'",)
---

..............................Expected..............................
None
--------------------------------------------------------------------------------
    Running: ut_nm_timeout.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/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "ut_nm_timeout.r2py", line 42, in <module>
  "nmclient.r2py", line 298, 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_timeout.r2py", line 42, in <module>
  "nmclient.r2py", line 298, in nmclient_createhandle

Exception (with class '.NMClientException'): RepyArgumentError("Provided destip is not valid! IP: '78c376508e688efc78519c39abb82f54964631e9'",)
---

..............................Expected..............................
None
--------------------------------------------------------------------------------
    Running: ut_nm_timeout2.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/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "ut_nm_timeout2.r2py", line 39, in <module>
  "nmclient.r2py", line 298, 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_timeout2.r2py", line 39, in <module>
  "nmclient.r2py", line 298, in nmclient_createhandle

Exception (with class '.NMClientException'): RepyArgumentError("Provided destip is not valid! IP: '78c376508e688efc78519c39abb82f54964631e9'",)
---

..............................Expected..............................
None
--------------------------------------------------------------------------------
    Running: ut_nm_validate_connection_limit.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/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "ut_nm_validate_connection_limit.r2py", line 50, in <module>
  "coordinationaffix.r2py", line 202, in openconnection
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/namespace.py", line 1207, in wrapped_function
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/emulcomm.py", line 1265, in openconnection

User traceback:
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "ut_nm_validate_connection_limit.r2py", line 50, in <module>
  "coordinationaffix.r2py", line 202, in openconnection

Exception (with class 'exception_hierarchy.RepyArgumentError'): Provided destip is not valid! IP: '78c376508e688efc78519c39abb82f54964631e9'
---

..............................Expected..............................
None
--------------------------------------------------------------------------------
    Running: ut_nm_validate_connection_timeout.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/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/virtual_namespace.py", line 117, in evaluate
  "/Users/huangxuefeng/Desktop/untitled folder/nodemanager/RUNNABLE/safe.py", line 588, in safe_run
  "ut_nm_validate_connection_timeout.r2py", line 47, in <module>
  "coordinationaffix.r2py", line 190, in openconnection
  "tcprelayaffix.r2py", line 155, in openconnection
  "sockettimeout.r2py", line 319, in timeout_openconnection

User traceback:
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "ut_nm_validate_connection_timeout.r2py", line 47, in <module>
  "coordinationaffix.r2py", line 190, in openconnection
  "tcprelayaffix.r2py", line 155, in openconnection
  "sockettimeout.r2py", line 319, in timeout_openconnection

Exception (with class 'exception_hierarchy.AddressBindingError'): Could not find any usable source port in the range [12345] on IP address 192.168.1.66.
---

..............................Expected..............................
None
--------------------------------------------------------------------------------
Now stopping subprocess: ut_nm_subprocess.py
Tests for SeattleTestbed/nodemanager took 880.573080063 seconds, excluding download and build

@aaaaalbert
Copy link
Contributor

Okay, thanks for your initiative on this. Here's a few things I noticed:

  • Please use 2 spaces of indentation per level.
  • The variable names are all upper-case, as in the original bash script. That looks weird in Python.
  • Make a list out of the space-separated string of repo names. Having this as a string was only necessary in bash.

Did you have a chance to run this on Windows btw? Do we have a tester with access to a Win box?

# For every repo name, ...
for repo in repolist:
print "Testing " + testbed + '/' + repo + " now..."
print "https://github.com/" + testbed + "/" + repo + ".git"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make the domain name configurable, too? For example, if a local or non-github git repository is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants