goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.53k stars 470 forks source link

Goss validation fails within a container while reading the process name in ubuntu16.04 #775

Closed ns-tghosh closed 10 months ago

ns-tghosh commented 1 year ago

Describe the bug

Below process validation in goss is failing within a container: root 15 1 0 19:08 ? 00:00:00 /usr/bin/python3.8 /usr/local/bin/verdict_controller_server.py --port 5000

# ps -p 15 -o comm,cmd
COMMAND         CMD
verdict_control /usr/bin/python3.8 /usr/local/bin/verdict_controller_server.py --port 5000

# cat /proc/15/comm
verdict_control

# cat process.yaml
process:
  verdict_control:
    running: true

# ../goss -g process.yaml validate
F

Failures/Skipped:

Process: verdict_control: running:
Expected
    false
to equal
    true

Total Duration: 0.027s
Count: 1, Failed: 1, Skipped: 0

Environment:

ns-tghosh commented 1 year ago

@aelsabbahy Any luck on the issue, please?

aelsabbahy commented 1 year ago

I can create a v4-bugs label to track bugs specifically for that branch. I don't think the v4 branch is stable or complete.

That said.. it might be verdict_controller_server.py. If that doesn't work, I would suggest reading through the gopsutil code to see how it resolved process names.

Out of curiosity, why doesn't the release version of Goss meet your needs?

ns-tghosh commented 1 year ago

@aelsabbahy We are using v4 branch to utilize the stdout feature which is not yet merged in the release branch. Please refer to this issue.

We tried with the release branch and the process determination is working correctly, however, the stdout feature is quite needed for us, so we can't give it up at this point.

aelsabbahy commented 1 year ago

Hello, just following up on this.

Did the name in my last message work for you?

ns-tghosh commented 1 year ago

By that time we have faced this issue in multiple cases, however, the output of ps -p <pid> -o comm works in the release branch. But we need to keep using v4 for the stdout feature.

aelsabbahy commented 1 year ago

I created v4-bug to track bugs on the v4 release.

Feel free to open more bugs on this branch as you encounter them.

Is everything working well for you now with the process test?

aelsabbahy commented 11 months ago

v0.4.0 release candidate just released.. It uses the v0.3.X process detection (due to this issue and others).

Let me know if that works well for you.

aelsabbahy commented 10 months ago

Resolved in v4 release, feel free to re-open issue or open new issue if you have further issues.

Thank you for reporting this.