Opened 9 years ago

Closed 9 years ago

#648 closed enhancement (complete)

Show BIND 10 children

Reported by: shane Owned by: shane
Priority: low Milestone: A-Team-Sprint-20110316
Component: ~Boss of BIND (obsolete) Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

In trying to figure out how to test the boss process when it gets a signal (see ticket #642), I discovered I need to know the process identifiers of its children. Since it is probably useful in a general case to show the running BIND 10 processes, this functionality should be added.

Subtickets

Change History (10)

comment:1 Changed 9 years ago by shane

  • Milestone set to A-Team-Task-Backlog

comment:2 Changed 9 years ago by shane

  • Milestone changed from A-Team-Task-Backlog to A-Team-Sprint-20110309
  • Owner changed from shane to UnAssigned
  • Status changed from new to reviewing

I've implemented this feature. I know it wasn't on the sprint originally, but ff there is time it would be nice if someone could review this so I could get it merged.

comment:3 Changed 9 years ago by shane

BTW, the branch is trac648.

comment:4 Changed 9 years ago by vorner

  • Owner changed from UnAssigned to vorner

comment:5 Changed 9 years ago by vorner

  • Owner changed from vorner to shane

Hello

The tests start bind10? And the tests seem to expect only boss, msgq and cfgmgr is started. How is it prevented to start the other processes? I can't find it in the code. What did I miss? Anyway, I feel uneasy about starting the system.

About the code:

  • I fixed few space issues (spaces at the end of line, mixing of tabs and spaces, broke one too long line). Directly commited to the branch, please check if it's OK.
  • assertTrue is nicer than assertEqual.
  • Shouldn't the new test file have a copyright header?
  • There are two print commands (one at the classSetUp, one at the boss unknown command). Are they wanted? Shouldn't they print to stderr? The second one should have a [bind10] prefix I guess.
  • The make distcheck fails:
Running test: bind10_cmd_test.py
setupclass?
EE
======================================================================
ERROR: testPing (__main__.TestBossCmd)
Simple aliveness check
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vorner/work/bind10/bind10-devel-20110224/src/lib/python/isc/cc/session.py", line 55, in __init__
    self._socket.connect(self.socket_file)
socket.error: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vorner/work/bind10/bind10-devel-20110224/_build/../src/bin/bind10/tests/bind10_cmd_test.py", line 53, in testPing
    self.cc = isc.cc.Session()
  File "/home/vorner/work/bind10/bind10-devel-20110224/src/lib/python/isc/cc/session.py", line 64, in __init__
    raise SessionError(se)
isc.cc.session.SessionError: [Errno 2] No such file or directory

======================================================================
ERROR: testShowServices (__main__.TestBossCmd)
Get a list of children
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vorner/work/bind10/bind10-devel-20110224/src/lib/python/isc/cc/session.py", line 55, in __init__
    self._socket.connect(self.socket_file)
socket.error: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vorner/work/bind10/bind10-devel-20110224/_build/../src/bin/bind10/tests/bind10_cmd_test.py", line 94, in testShowServices
    self.cc = isc.cc.Session()
  File "/home/vorner/work/bind10/bind10-devel-20110224/src/lib/python/isc/cc/session.py", line 64, in __init__
    raise SessionError(se)
isc.cc.session.SessionError: [Errno 2] No such file or directory

----------------------------------------------------------------------
Ran 2 tests in 0.006s

FAILED (errors=2)
make[6]: *** [check-local] Error 1
make[6]: Leaving directory `/home/vorner/work/bind10/bind10-devel-20110224/_build/src/bin/bind10/tests'
make[5]: *** [check-am] Error 2
make[5]: Leaving directory `/home/vorner/work/bind10/bind10-devel-20110224/_build/src/bin/bind10/tests'
make[4]: *** [check-recursive] Error 1
make[4]: Leaving directory `/home/vorner/work/bind10/bind10-devel-20110224/_build/src/bin/bind10'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/home/vorner/work/bind10/bind10-devel-20110224/_build/src/bin'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/vorner/work/bind10/bind10-devel-20110224/_build/src'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/vorner/work/bind10/bind10-devel-20110224/_build'
make: *** [distcheck] Error 1

comment:6 follow-up: Changed 9 years ago by shane

Okay, I've redone the tests to avoid the need to start a separate process (what a bad idea that was).

I had to refactor the bind10.py a little bit, so initializing a ProcessInfo? does not actually start the process. I also refactored the bind10_test.py program so that the same descendant of the BoB class can be used for multiple purposes.

Regarding your comments on the earlier version, I think the only thing I needed to address was the copyrights, which I have done.

Thanks.

comment:7 Changed 9 years ago by shane

  • Owner changed from shane to vorner

comment:8 in reply to: ↑ 6 Changed 9 years ago by vorner

Hello

Replying to shane:

Regarding your comments on the earlier version, I think the only thing I needed to address was the copyrights, which I have done.

I like the changes. There's one problem left, though ‒ on the line 303 of bind.py.in, you print something to stdout. It is either a debug print which should be removed or it should be prefixed with the [bind10] I believe.

Thanks

comment:9 Changed 9 years ago by vorner

  • Owner changed from vorner to shane

comment:10 Changed 9 years ago by shane

  • Resolution set to complete
  • Status changed from reviewing to closed

Okay, I've removed that spurious print, and merged into master. Closing ticket.

Note: See TracTickets for help on using tickets.