Skip to content

Commit

Permalink
Fetch a working url for mininet setup
Browse files Browse the repository at this point in the history
Github does not allow git:// link anymore. This was fixed by commit
c3ba039a but there is no new release of mininet. Thus, we need to use
the script of this commit.
  • Loading branch information
jadinm committed Mar 27, 2022
1 parent 7d1afda commit d84aceb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions ipmininet/install/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
LibyangVersion = "v1.0.215"
ExaBGPVersion = "4.2.11"

# XXX: We need the explicit script until the following issue is fixed:
# https://github.com/mininet/mininet/issues/1120
MininetInstallCommit = "c3ba039a9781c6c5f475b7c88ff577185747a1da"

os.environ["PATH"] = "%s:/sbin:/usr/sbin/:/usr/local/sbin" % os.environ["PATH"]


Expand Down Expand Up @@ -65,10 +69,18 @@ def install_mininet(output_dir: str, pip_install=True):
mininet_opts = "-a"

sh("git clone https://github.com/mininet/mininet.git", cwd=output_dir)
# Save valid version of mininet install script
sh("git checkout %s" % MininetInstallCommit,
cwd=os.path.join(output_dir, "mininet/util"))
sh("cp install.sh install.tmp.sh",
cwd=os.path.join(output_dir, "mininet/util"))
# Use it in the fixed version of Mininet
sh("git checkout %s" % MininetVersion,
cwd=os.path.join(output_dir, "mininet"))
sh("mininet/util/install.sh %s -s ." % mininet_opts,
cwd=output_dir)
cwd=os.path.join(output_dir, "mininet/util"))
sh("mv install.tmp.sh install.sh",
cwd=os.path.join(output_dir, "mininet/util"))
sh("./install.sh %s -s ." % mininet_opts,
cwd=os.path.join(output_dir, "mininet/util"))

if pip_install:
dist.pip_install("mininet/", cwd=output_dir)
Expand Down

0 comments on commit d84aceb

Please sign in to comment.