[vcap-dev] Warden test case, why check reachable by ping "4.2.2.1"

39 views
Skip to first unread message

tsj...@huawei.com

unread,
May 7, 2014, 11:52:37 PM5/7/14
to vcap...@cloudfoundry.org

https://github.com/cloudfoundry/warden/blob/master/warden/spec/container/linux_spec.rb#L500

 

 

why is a exact ip “4.2.2.1 in my test environment, this ip is not exist, maybe should be the gateway’s ip of host?

 

Like “ip route get 1.1.1.1 | cut -f 3 -d ' ' |head -n 1” ?

Glyn Normington

unread,
May 8, 2014, 1:34:58 AM5/8/14
to vcap...@cloudfoundry.org
I suppose the earlier definition:

let(:allow_networks) do
        ["4.2.2.1/32"]
end

sets this up.

tsj...@huawei.com

unread,
May 8, 2014, 2:32:29 AM5/8/14
to vcap...@cloudfoundry.org
thank you for reply, this is my first post. :-) 

i find the "allow_networks" will be used for host's iptables, here:
https://github.com/cloudfoundry/warden/blob/master/warden/root/linux/net.sh#L88

but if the destination ip is not exist, though the ping packet can pass the iptables, it can not get a response. 

so how it works? 


在 2014年5月8日星期四UTC+8下午1时34分58秒,Glyn Normington写道:

Jan Dubois

unread,
May 8, 2014, 1:31:59 PM5/8/14
to vcap-dev
On Wed, May 7, 2014 at 11:32 PM, <tsj...@huawei.com> wrote:
> thank you for reply, this is my first post. :-)
>
> i find the "allow_networks" will be used for host's iptables, here:
> https://github.com/cloudfoundry/warden/blob/master/warden/root/linux/net.sh#L88
>
> but if the destination ip is not exist, though the ping packet can pass the
> iptables, it can not get a response.
>
> so how it works?

4.2.2.1 is a public DNS server by Level 3 (like 8.8.8.8 by Google). So
if you have access to the public internet, then you should be able to
route to it.

I guess the test should be skipped in case you are running in a walled
off network (or you would have to manually change to an IP address
that you "know" exists in your setup).

Cheers,
-Jan

tsj...@huawei.com

unread,
May 8, 2014, 9:51:22 PM5/8/14
to vcap...@cloudfoundry.org
get it, thank you very much:-)

so this test case is not suit for these who are running behind a proxy, a http_proxy is not support 'ping' method, though packet install is ok in other test case.
hope it can be more "robust".

在 2014年5月9日星期五UTC+8上午1时31分59秒,Jan Dubois写道:
Reply all
Reply to author
Forward
0 new messages