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

Can not validate port from a running service in container. #366

Closed
lotusirous opened this issue Jun 29, 2018 · 4 comments
Closed

Can not validate port from a running service in container. #366

lotusirous opened this issue Jun 29, 2018 · 4 comments

Comments

@lotusirous
Copy link

lotusirous commented Jun 29, 2018

I'm using redis and registry:2 in Ubuntu server. The services as follows:

user@localhost$ docker run --rm -p 5001:5000 --name registry -v /mnt/registry:/var/lib/registry registry:2
user@localhost$ docker run -p 6379:6379 -v /mnt/redis_data:/data --name redis --rm redis

I can access to the ports

root@localhost# ss -pltun |grep 5001
tcp    LISTEN   0     128      *:5001         *:*    users:(("docker-proxy",pid=6536,fd=4))             
                            
root@localhost# ss -pltun |grep 6379
tcp    LISTEN   0     128      *:6379         *:*    users:(("docker-proxy",pid=6510,fd=4)

root@localhost# uname -a
Linux 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I added port 5001 and 6379 goss.yaml using command

root@localhost#  goss add port 5001
root@localhost#  goss add port 6379
port:
  tcp:5001:
    listening: false
    ip: []
  tcp:6379:
    listening: false
    ip: []

Why goss add listening status is false ?

I modified listening to true, the the result as follows:

FSFS

Failures/Skipped:

Port: tcp:5001: listening:
Expected
    <bool>: false
to equal
    <bool>: true
Port: tcp:5001: ip: skipped

Port: tcp:6379: listening:
Expected
    <bool>: false
to equal
    <bool>: true
Port: tcp:6379: ip: skipped

Total Duration: 0.004s
Count: 4, Failed: 2, Skipped: 2

I wondering why it is failed in this case.

@aelsabbahy
Copy link
Member

Try goss a port tcp6:5001

see: https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port about tcp vs tcp6 issues

@lotusirous
Copy link
Author

@aelsabbahy This issue also exists in TCP/IPv4

@aelsabbahy
Copy link
Member

Sorry, I'm not following. Does goss a port tcp6:5001 work or not work on that machine for generating tests and validating?

I assume you're hitting this issue: #149

@lotusirous
Copy link
Author

goss a port tcp6:5001 works well.

The ss command shows that the program listens on port 5001.

Result from /proc/net/tcp6

$ cat /proc/net/tcp6 | grep $(printf "%X\n" 5001) 
   0: 00000000000000000000000000000000:1389 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 43364 1 0000000000000000 100 0 0 10 0

I think it is duplicated from #149

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