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

Port time_server.repy to RepyV2 #7

Open
aaaaalbert opened this issue Dec 30, 2014 · 5 comments
Open

Port time_server.repy to RepyV2 #7

aaaaalbert opened this issue Dec 30, 2014 · 5 comments
Assignees

Comments

@aaaaalbert
Copy link
Contributor

No description provided.

@asm582 asm582 self-assigned this Dec 31, 2014
@asm582
Copy link

asm582 commented Dec 31, 2014

Working on this..

@asm582
Copy link

asm582 commented Jan 2, 2015

I have ported this file to repy v2. running this file independently gave getlock() error as below:-
Exception (with type 'exceptions.NameError'): name 'getlock' is not defined

and i tried checking restrictions file where getlock is allowed, i think that getlock is a python call, so i imported the file in python and it works. Please find below the ported code. I will work again on this if i am incorrect.

https://github.com/asm582/seattleissues/blob/master/time_server.r2py

@aaaaalbert
Copy link
Contributor Author

If it's ported to RepyV2, then it can't import Python code. For creating a lock in RepyV2, see the API docs.

There are other problems with the proposed code too --- you'll see when you fix the lock issue.

BTW, any reason you didn't just fork the timeserver repo, create a new branch, and push stuff there?

@asm582
Copy link

asm582 commented Jan 6, 2015

From albert's comments i tried to resolved attribute error exception by using getconnection() and used null check for checking value of object and when found null used exitall() to terminate the program as there is no client to connect. below is the link to modification

https://github.com/asm582/timeserver/blob/timeserver_v2/time_server.r2py

@asm582
Copy link

asm582 commented Jan 12, 2015

I have tested integration tests for time sever below are the results:-

abhishek@abhishek-VirtualBox:~/seattlelib_v2/RUNNABLE$ python test_time_tcp.py
read file /home/abhishek/seattlelib_v2/RUNNABLE/seattle_gmail_info
loaded gmail info
Mon Jan 12 11:49:10 2015 : Starting test_time_tcp.py...
<builtin.timeout_socket instance at 0xb6c9f10c> Mon Jan 12 11:49:13 2015 : Calling time_gettime(). Retrieved time: 3630070151.96
<builtin.timeout_socket instance at 0xb6c9f04c> Mon Jan 12 11:49:16 2015 : Calling time_gettime(). Retrieved time: 3630070155.06
<builtin.timeout_socket instance at 0xb6c9f28c> Mon Jan 12 11:49:19 2015 : Calling time_gettime(). Retrieved time: 3630070157.51
<builtin.timeout_socket instance at 0xb6c9f1ac> Mon Jan 12 11:49:22 2015 : Calling time_gettime(). Retrieved time: 3630070161.26
<builtin.timeout_socket instance at 0xb6c9f7ec> Mon Jan 12 11:49:26 2015 : Calling time_gettime(). Retrieved time: 3630070164.96
inside try block time-a.nist.gov time.nist.gov time-b.nist.gov nist1.symmetricom.com time-a.timefreq.bldrdoc.gov Mon Jan 12 11:49:32 2015 : Finished running test_time_tcp.py..... Test Passed
......................................................

abhishek@abhishek-VirtualBox:~/seattlelib_v2/RUNNABLE$ python test_time_servers_running.py
read file /home/abhishek/seattlelib_v2/RUNNABLE/seattle_gmail_info
loaded gmail info
Mon Jan 12 12:05:10 2015 : Looking up time_servers
Mon Jan 12 12:05:14 2015 : Finished looking up test servers... Test Passed
........................................................

I think i have updated the pull request as well with required code and hope to close this ticket soon.

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

No branches or pull requests

2 participants