Open peteroreil opened 7 years ago
@peteroreil thanks for reporting this issue, I don't know much about BusyBox but can you clone this project and run test npm test
with BusyBox first?
Actually need to update this ticket, recently learned (thanks to ps-node I might add) that ps
on BusyBox does take options. ps l
is a valid option.
@neekey ran tests on v0.1.5
81 passing (6m)
4 failing
1) test #lookup() by id:
Uncaught AssertionError: "/home/root/" == "/home/root/galileo-dsu/node_modules/ps-node/test/node_process_for_test.js"
+ expected - actual
-/home/root/
+/home/root/galileo-dsu/node_modules/ps-node/test/node_process_for_test.js
at test/test.js:53:16
at lib/index.js:182:7
at ChildProcess.<anonymous> (lib/index.js:97:9)
at Process.ChildProcess._handle.onexit (child_process.js:789:12)
2) test #lookup() by command & arguments:
Uncaught AssertionError: 0 == 1
+ expected - actual
-0
+1
at test/test.js:61:16
at lib/index.js:182:7
at ChildProcess.<anonymous> (lib/index.js:97:9)
at Process.ChildProcess._handle.onexit (child_process.js:789:12)
3) test #lookup() by arguments, the matching should be case insensitive :
Uncaught AssertionError: 0 == 1
+ expected - actual
-0
+1
at test/test.js:70:16
at lib/index.js:182:7
at ChildProcess.<anonymous> (lib/index.js:97:9)
at Process.ChildProcess._handle.onexit (child_process.js:789:12)
4) test #lookup() should work correctly with options `aux`:
Uncaught TypeError: Cannot read property 'length' of undefined
at test/test.js:92:26
at lib/index.js:156:14
at ChildProcess.<anonymous> (lib/index.js:94:16)
at Process.ChildProcess._handle.onexit (child_process.js:789:12)
I think you can mark this one as can't reproduce. Even those these tests are failing, these tests are still returning a process object.
The tests (Test 1 at least) that are failing are due issue #54 which I reported, which looks like is platform specific,
Regarding issue #54, the tests pass when I'm running on Ubuntu but BusyBox is not so co-operative. For some reason, the arguments array is shortened when running on BusyBox even though the output from the ps
command shows the full argument list.
Thanks
Hi @peteroreil thanks for all these detailed info, really helps to figure out the issue!
So according to your report, my suspicions are:
lookup()
, since it's the only case that the result list will be null and it should already pass out an err
object. Can you check if the ps command in BusyBox supports ps aux
?I think there is the same problem on MacOS. There is something wrong in the ps output parsing so that values are associated with the wrong column.
@neekey I'm sorry, I never seen this reply. :( The version of busybox I was using did not support aux
options, just l
I'm using this library on an Intel Galileo, Which is running BusyBox v1.22.1 (2015-10-25 11:24:34 GMT) multi-call binary.
When I pass a running
pId
to the lookup function in v0.1.4, theresultList
will return an array with the running process details.When I pass a running
pId
to the lookup function in v0.1.5 theresultList
will return an empty array.ps usage options on busybox a.k.a none
ps table fields on BusyBox
PID USER VSZ STAT COMMAND