[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #15449 [Stem]: test_is_running() fails on OSX



#15449: test_is_running() fails on OSX
--------------------+------------------------
 Reporter:  corcra  |          Owner:  atagar
     Type:  defect  |         Status:  new
 Priority:  minor   |      Milestone:
Component:  Stem    |        Version:
 Keywords:          |  Actual Points:
Parent ID:          |         Points:
--------------------+------------------------
 On OSX, tor runs under the name `tor.real` (due to
 https://trac.torproject.org/projects/tor/ticket/10030#comment:20), but is
 ''started'' by calling `tor`, so this fails during testing:

 `self.assertTrue(stem.util.system.is_running(test.runner.get_runner().get_tor_command(True)))`

 (this is in `stem/test/integ/util/system.py`)

 A ''possible'' workaround would be modifying the workaround for #10030
 (it's workarounds all the way down) to use

 `exec -a tor ./tor.real "$@"`

 instead of

 `exec ./tor.real "$@"`

 and then changing the `ps` call in `stem/stem/util/system.py` to not use
 accounting, so it sees the process running as `tor`:

 `IS_RUNNING_PS_BSD = 'ps -ao comm='`

 instead of

 `IS_RUNNING_PS_BSD = 'ps -ao ucomm='`

 ... but I'm not sure if turning off accounting is appropriate/desirable,
 and changing non-stem things just to fix a bug in stem tests seems like
 overkill.

 The OSX 'weirdness' is already handled appropriately elsewhere in stem, so
 maybe this test should just be modified (like)

 `self.assertTrue(stem.util.system.is_running('tor') or
 stem.util.system.is_running('tor.real'))`

 or further upstream, set `_tor_cmd` in the runner in an OS-conscious
 manner?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15449>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs