Skip to content
Snippets Groups Projects
Unverified Commit e4003290 authored by lantz's avatar lantz Committed by GitHub
Browse files

Try to install python2 and python3 mininet (#1008)

parent 9517f6c1
No related branches found
No related tags found
No related merge requests found
......@@ -183,8 +183,8 @@ function mn_deps {
${PYPKG}-pexpect ${PYPKG}-tk
# Install pip
$install ${PYPKG}-pip || $install ${PYPKG}-pip-whl
if ! ${PYTHON} -m pip; then
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
if ! ${PYTHON} -m pip -V; then
wget https://bootstrap.pypa.io/get-pip.py
sudo ${PYTHON} get-pip.py
rm get-pip.py
fi
......
......@@ -638,7 +638,8 @@ def checkOutBranch( vm, branch, prompt=Prompt ):
vm.sendline( 'util/install.sh -n' )
def interact( vm, tests, pre='', post='', prompt=Prompt ):
def interact( vm, tests, pre='', post='', prompt=Prompt,
clean=True):
"Interact with vm, which is a pexpect object"
login( vm )
log( '* Waiting for login...' )
......@@ -677,6 +678,10 @@ def interact( vm, tests, pre='', post='', prompt=Prompt ):
vm.sendline( "sudo sed -i -e 's/^GRUB_TERMINAL=serial/#GRUB_TERMINAL=serial/' "
"/etc/default/grub; sudo update-grub" )
vm.expect( prompt )
if clean:
log( '* Cleaning vm' )
vm.sendline( '~/mininet/util/install.sh -d' )
vm.expect( prompt )
log( '* Shutting down' )
vm.sendline( 'sync; sudo shutdown -h now' )
log( '* Waiting for EOF/shutdown' )
......
......@@ -24,7 +24,7 @@ if [ -e /etc/rc.local.backup ]; then
sudo mv /etc/rc.local.backup /etc/rc.local
fi
# Fetch Mininet
sudo apt-get -y install git-core openssh-server
sudo apt-get -y -qq install git-core openssh-server
git clone git://github.com/mininet/mininet
# Optionally check out branch
if [ "$1" != "" ]; then
......@@ -33,8 +33,14 @@ if [ "$1" != "" ]; then
git checkout $1
popd
fi
# Install Mininet
time mininet/util/install.sh
# Install Mininet for Python2 and Python3
APT="sudo apt-get -y -qq"
$APT install python3
$APT install python-is-python3 || true
$APT install python2 || $APT install python
python --version
time PYTHON=python3 mininet/util/install.sh
time PYTHON=python2 mininet/util/install.sh -n
# Finalize VM
time mininet/util/install.sh -tcd
# Ignoring this since NOX classic is deprecated
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment