Install python2 for Ubuntu 16.04 and CentOS 7 in Vagrant

- Fix double `end` in Vagrantfile
- Install python2 for Ubuntu 16.04 and CentOS 7 before executing test
  script.

Change-Id: Iec2ede3d94fd166d2e65b7e174f0f8dc51f720c0
This commit is contained in:
Cuong Nguyen 2017-02-06 14:46:05 +07:00
parent 8ae4e7b6b9
commit 1f174edb8d
2 changed files with 10 additions and 2 deletions

2
Vagrantfile vendored
View File

@ -3,14 +3,12 @@ Vagrant.configure(2) do |config|
v.memory = 2048 v.memory = 2048
v.cpus = 2 v.cpus = 2
end end
end
config.vm.define "ubuntu1604" do |xenial| config.vm.define "ubuntu1604" do |xenial|
xenial.vm.box = "ubuntu/xenial64" xenial.vm.box = "ubuntu/xenial64"
xenial.vm.provision "shell", inline: <<-SHELL xenial.vm.provision "shell", inline: <<-SHELL
sudo su - sudo su -
cd /vagrant cd /vagrant
apt-get update
./run_tests.sh ./run_tests.sh
SHELL SHELL
end end

View File

@ -17,6 +17,16 @@ set -euov
FUNCTIONAL_TEST=${FUNCTIONAL_TEST:-true} FUNCTIONAL_TEST=${FUNCTIONAL_TEST:-true}
# Install python2 for Ubuntu 16.04 and CentOS 7
if which apt-get; then
sudo apt-get update && sudo apt-get install -y python
fi
if which yum; then
sudo yum install -y python
fi
# Install pip # Install pip
if [ ! "$(which pip)" ]; then if [ ! "$(which pip)" ]; then
curl --silent --show-error --retry 5 \ curl --silent --show-error --retry 5 \