Skip to content

Commit 9ab0142

Browse files
sheenaajayscotty-c
authored andcommitted
(CLOUD-1614) Fix acceptance tests to run on centos (#30)
1 parent c450164 commit 9ab0142

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

spec/acceptance/nodesets/pooler/centos7.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ HOSTS:
22
centos7:
33
roles:
44
- default
5-
platform: el7-x86_64
5+
platform: el-7-x86_64
66
hypervisor: vmpooler
77
template: Delivery/Quality Assurance/Templates/vCloud/centos-7-x86_64
88
CONFIG:

spec/spec_helper_acceptance.rb

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# shell('echo "#{vmhostname}" > /etc/hostname')
4545
# shell("hostname #{vmhostname}")
4646
hosts_file = <<-EOS
47-
127.0.0.1 #{vmhostname}
47+
127.0.0.1 localhost #{vmhostname} kubernetes
4848
#{vmipaddr} #{vmhostname}
4949
#{vmipaddr} kubernetes
5050
EOS
@@ -87,19 +87,31 @@
8787
selector:
8888
run: my-nginx
8989
EOS
90-
# Return ip adress
90+
if fact('osfamily') == 'Debian'
91+
#Installing rubydev environment
92+
on(host, "apt install ruby-bundler --yes", acceptable_exit_codes: [0]).stdout
93+
on(host, "apt-get install ruby-dev --yes", acceptable_exit_codes: [0]).stdout
94+
on(host, "apt-get install build-essential curl git m4 python-setuptools ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev --yes", acceptable_exit_codes: [0]).stdout
95+
end
96+
if fact('osfamily') == 'RedHat'
97+
#Installing rubydev environment
98+
on(host, "yum install -y ruby-devel git zlib-devel gcc-c++ lib yaml-devel libffi-devel make bzip2 libtool curl openssl-devel readline-devel", acceptable_exit_codes: [0]).stdout
99+
on(host, "gem install bundler", acceptable_exit_codes: [0]).stdout
100+
on(host, "git clone git://github.com/sstephenson/rbenv.git .rbenv", acceptable_exit_codes: [0]).stdout
101+
on(host, "echo 'export PATH=\"$HOME/.rbenv/bin:$PATH\"' >> ~/.bash_profile", acceptable_exit_codes: [0]).stdout
102+
on(host, "echo 'eval \"$(rbenv init -)\"' >> ~/.bash_profile" ,acceptable_exit_codes: [0]).stdout
103+
on(host, "git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build", acceptable_exit_codes: [0]).stdout
104+
on(host, "echo 'export PATH=\"$HOME/.rbenv/plugins/ruby-build/bin:$PATH\"' >> ~/.bash_profile", acceptable_exit_codes: [0]).stdout
105+
on(host, "source ~/.bash_profile;rbenv install -v 2.3.1;rbenv global 2.3.1;rbenv local 2.3.1", acceptable_exit_codes: [0]).stdout
106+
end
107+
91108
# Installing go, cfssl
109+
on(host, "cd /etc/puppetlabs/code/modules/kubernetes;rm -rf Gemfile.lock;bundle install --path vendor/bundle", acceptable_exit_codes: [0]).stdout
92110
on(host, "curl -o go.tar.gz https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz", acceptable_exit_codes: [0]).stdout
93111
on(host, "tar -C /usr/local -xzf go.tar.gz", acceptable_exit_codes: [0]).stdout
94-
on(host, "apt-get install git -y", acceptable_exit_codes: [0]).stdout
95112
on(host, "export PATH=$PATH:/usr/local/go/bin;go get -u github.com/cloudflare/cfssl/cmd/...", acceptable_exit_codes: [0]).stdout
96-
#Installing rubydev environment
97-
on(host, "apt install ruby-bundler --yes", acceptable_exit_codes: [0]).stdout
98-
on(host, "apt-get install ruby-dev --yes", acceptable_exit_codes: [0]).stdout
99-
on(host, "apt-get install build-essential curl git m4 python-setuptools ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev --yes", acceptable_exit_codes: [0]).stdout
100-
on(host, "cd /etc/puppetlabs/code/modules/kubernetes;rm -rf Gemfile.lock;bundle install --path vendor/bundle", acceptable_exit_codes: [0]).stdout
101113
# Creating certs
102-
on(host, "export PATH=$PATH:/usr/local/go/bin;export PATH=$PATH:/root/go/bin;cd /etc/puppetlabs/code/modules/kubernetes/tooling;./kube_tool.rb -f kubernetes -i #{vmipaddr} -b #{vmipaddr} -e \"etcd-#{vmhostname}=http://#{vmipaddr}:2380\" -t \"#{vmipaddr}\" -a \"#{vmipaddr}\" -d true", acceptable_exit_codes: [0]).stdout
114+
on(host, "source ~/.bash_profile;rbenv global 2.3.1;rbenv local 2.3.1;export PATH=$PATH:/usr/local/go/bin;export PATH=$PATH:/root/go/bin;cd /etc/puppetlabs/code/modules/kubernetes/tooling;./kube_tool.rb -f kubernetes -i #{vmipaddr} -b #{vmipaddr} -e \"etcd-#{vmhostname}=http://#{vmipaddr}:2380\" -t \"#{vmipaddr}\" -a \"#{vmipaddr}\" -d true", acceptable_exit_codes: [0]).stdout
103115
create_remote_file(host, "/etc/hosts", hosts_file)
104116
create_remote_file(host, "/tmp/nginx.yml", nginx)
105117
on(host, 'cp /etc/puppetlabs/code/modules/kubernetes/tooling/kubernetes.yaml /etc/puppetlabs/code/environments/production/hieradata/common.yaml', acceptable_exit_codes: [0]).stdout

0 commit comments

Comments
 (0)