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

Don't hardcode the path to test cases #3

Open
thozza opened this issue Mar 14, 2016 · 2 comments
Open

Don't hardcode the path to test cases #3

thozza opened this issue Mar 14, 2016 · 2 comments

Comments

@thozza
Copy link
Contributor

thozza commented Mar 14, 2016

When the network-testing is installed as RPM package, it is not possible to run the test cases from custom path.

The path where to look for test cases is hard-coded in the sources network_testing/client_server.py:

...
data_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
testcase_path = os.path.join(data_path, 'testcases', 'client-server')

...

class TestSuite:
    def __init__(self, testcases=None, scenarios=None):
        self.testcases = [Testcase(name, scenarios) for name in os.listdir(testcase_path)]
        if testcases:
            self.testcases = [testcase for testcase in self.testcases if testcase.name in testcases]
...

The driver may look for the test cases in some predefined directory, but it should be definitely possible to run testcases from defined path.

@pavlix
Copy link
Member

pavlix commented Apr 25, 2016

Is there a specific use case, yet?

@thozza
Copy link
Contributor Author

thozza commented May 5, 2016

Just the ease of use. This would allow to have separate test cases from what is distributed directly with the project. Please see issue #21, I think it these two are connected.

pavlix added a commit that referenced this issue Oct 27, 2016
    Traceback (most recent call last):
      File "./test-client-server", line 5, in <module>
        main()
      File "/home/pavlix/oss/network-testing/network_testing/client_server.py", line 55, in main
        suite.run()
      File "/home/pavlix/oss/network-testing/network_testing/test_suite.py", line 431, in run
        testcase.run()
      File "/home/pavlix/oss/network-testing/network_testing/test_suite.py", line 391, in run
        scenario.run()
      File "/home/pavlix/oss/network-testing/network_testing/test_suite.py", line 172, in run
        debugger.quit()
      File "/home/pavlix/oss/network-testing/network_testing/debug.py", line 198, in quit
        super(SyscallDebugger, self).quit()
      File "/usr/lib64/python3.4/site-packages/ptrace/debugger/debugger.py", line 105, in quit
        process.terminate()
      File "/usr/lib64/python3.4/site-packages/ptrace/debugger/process.py", line 330, in terminate
        self.waitExit()
      File "/usr/lib64/python3.4/site-packages/ptrace/debugger/process.py", line 351, in waitExit
        self.cont(signum)
      File "/usr/lib64/python3.4/site-packages/ptrace/debugger/process.py", line 717, in cont
        ptrace_cont(self.pid, signum)
      File "/usr/lib64/python3.4/site-packages/ptrace/binding/func.py", line 212, in ptrace_cont
        ptrace(PTRACE_CONT, pid, 0, signum)
      File "/usr/lib64/python3.4/site-packages/ptrace/binding/func.py", line 148, in ptrace
        raise PtraceError(message, errno=errno, pid=pid)
    ptrace.error.PtraceError: ptrace(cmd=7, pid=12894, 0, 133) error #3: No such process

Related: vstinner/python-ptrace#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants