Comments (7)
Do the logs help or should I step in with pdb ?
from ipmininet.
It seems to be in the Mininet cleanup code but I really don't see why it would be blocked so long there.
I guess that doing mn -c
doesn't block?
I can try to install the same Mininet version as yours.
Maybe it will help to reproduce the bug on my VM.
Which one is it?
Otherwise, yes, using pdb might give better information on the issue.
from ipmininet.
If you replace the cleanup()
call in ipmininet/test/test_sshd.py
by pass
, does the test succeed?
Afterwards, you might need to call sudo python -m ipmininet.clean
, the equivalent of mn -c
for IPMininet to clean remaining processes.
from ipmininet.
@butjar Actually I might have a lead...
Could you check your /etc/shadow file and tell me if there is the line with the root user of your VM starts with "root:!" or with "root:*"?
If you see the first string, it means that the root account is locked and by default sshd won't allow you to login to the account (unless UsePAM is set to 'yes').
Moreover, there is an issue in the test that makes it loop forever if the ssh command fails.
So this could explain why the test takes forever in your VM while it does not in mine.
from ipmininet.
If you replace the
cleanup()
call inipmininet/test/test_sshd.py
bypass
, does the test succeed?Afterwards, you might need to call
sudo python -m ipmininet.clean
, the equivalent ofmn -c
for IPMininet to clean remaining processes.
Seems not to be in cleanup. After removing the cleanup,
--- a/ipmininet/tests/test_sshd.py
+++ b/ipmininet/tests/test_sshd.py
@@ -32,4 +32,5 @@ def test_sshd_example():
net.stop()
finally:
- cleanup()
+ pass
+ #cleanup()
the test didn't come back either (should be finished roughly in about 1.5 min).
I guess the test does not come back because you are not incrementing t
:
diff --git a/ipmininet/tests/test_sshd.py b/ipmininet/tests/test_sshd.py
index ece2e6e..f57844c 100644
--- a/ipmininet/tests/test_sshd.py
+++ b/ipmininet/tests/test_sshd.py
@@ -27,6 +27,7 @@ def test_sshd_example():
t = 0
while t < 60 and net["r1"].popen(cmd.split(" ")).wait() != 0:
time.sleep(0.5)
+ t=t+1
p = net["r1"].popen(cmd.split(" "))
assert p.wait() == 0, "Cannot connect with SSH to the router"
The test fails with:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
@require_root
def test_sshd_example():
try:
net = IPNet(topo=SSHTopo())
net.start()
ssh_key = None
with open("/tmp/sshd_r2.cfg") as fileobj:
for line in fileobj:
if "AuthorizedKeysFile" in line:
ssh_key = line.split(" ")[1].split(".")[0]
assert ssh_key is not None, "No authorized SSH key found in the configuration"
assert os.path.isfile(ssh_key), "Cannot find key file at %s" % ssh_key
import pdb; pdb.set_trace()
ip = net["r2"].intf("r2-eth0").ip
cmd = "ssh -oStrictHostKeyChecking=no -oConnectTimeout=1 -i %s %s ls" % (ssh_key, ip)
t = 0
while t < 60 and net["r1"].popen(cmd.split(" ")).wait() != 0:
> time.sleep(0.5)
E AssertionError: Cannot connect with SSH to the router
E assert 255 == 0
E + where 255 = <bound method Popen.wait of <subprocess.Popen object at 0x7f68eb7a1690>>()
E + where <bound method Popen.wait of <subprocess.Popen object at 0x7f68eb7a1690>> = <subprocess.Popen object at 0x7f68eb7a1690>.wait
ipmininet/tests/test_sshd.py:30: AssertionError
I will check now if /etc/shadow
is the root cause.
from ipmininet.
@butjar Actually I might have a lead...
Could you check your /etc/shadow file and tell me if there is the line with the root user of your VM starts with "root:!" or with "root:*"?
If you see the first string, it means that the root account is locked and by default sshd won't allow you to login to the account (unless UsePAM is set to 'yes').Moreover, there is an issue in the test that makes it loop forever if the ssh command fails.
So this could explain why the test takes forever in your VM while it does not in mine.
Yes, thats the issue. After changing:
1c1
< root:!:17999:0:99999:7:::
---
> root:*:17999:0:99999:7:::
The test passes.
from ipmininet.
Thanks a lot!
I will update that when I have some time.
from ipmininet.
Related Issues (20)
- Whether ipmininet supprt HMAC TLV? HOT 2
- ImportError: cannot import name 'StaticRoute' HOT 1
- BGP default permit filters collide with autogenerated route map names HOT 1
- Various pitfalls when trying to use complex BGP filters
- [Enhancement][PCEP] Add support for PCEPLib
- Why traffic cann't be captured by wireshark? HOT 2
- Can't open the srv6 example correctly. HOT 4
- Does ipmininet available for both SDN(by openflow ) and SRv6? HOT 2
- Cannot install IPmininet HOT 4
- citation HOT 1
- [OpenR] The OpenR install script does not work on Ubuntu 20.04
- Please create a new release of VM HOT 1
- [Install failed] Can't install in ubuntu 22.04 HOT 1
- Is adding a OpenFlow Switch in a network possbile?
- Impossible to use BBP RouteMapEntry call_action and exit_policy
- Hub is not working HOT 1
- Is it possible to unbuffer sys.stdin for a node's shell process HOT 2
- OpenR doesnt work
- Hosts can't ping each other in a simple topology. HOT 2
- How to modify FRRouting configuration file settings? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipmininet.