From 7d667c9deaea1ade3b3bf4b01afe0948c254a7af Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 17 Dec 2019 13:34:52 -0800 Subject: [PATCH] Update ansible install tests --- .../ansible/cap/guest/debian/ansible_install_test.rb | 4 ++-- .../ansible/cap/guest/freebsd/ansible_install_test.rb | 4 ++-- .../cap/guest/shared/pip_ansible_install_examples.rb | 6 +++--- .../ansible/cap/guest/ubuntu/ansible_install_test.rb | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/unit/plugins/provisioners/ansible/cap/guest/debian/ansible_install_test.rb b/test/unit/plugins/provisioners/ansible/cap/guest/debian/ansible_install_test.rb index 09e2003de..d11eeb489 100644 --- a/test/unit/plugins/provisioners/ansible/cap/guest/debian/ansible_install_test.rb +++ b/test/unit/plugins/provisioners/ansible/cap/guest/debian/ansible_install_test.rb @@ -40,11 +40,11 @@ INLINE_CRIPT expect(communicator).to receive(:sudo).once.ordered.with(install_backports_if_wheezy_release) expect(communicator).to receive(:sudo).once.ordered.with("apt-get update -y -qq") - expect(communicator).to receive(:sudo).once.ordered.with("apt-get install -y -qq ansible") + expect(communicator).to receive(:sudo).once.ordered.with("DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --option \"Dpkg::Options::=--force-confold\" ansible") subject.ansible_install(machine, :default, "", "", "") end end end -end \ No newline at end of file +end diff --git a/test/unit/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install_test.rb b/test/unit/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install_test.rb index cfd18925f..6357c7254 100644 --- a/test/unit/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install_test.rb +++ b/test/unit/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install_test.rb @@ -31,11 +31,11 @@ describe VagrantPlugins::Ansible::Cap::Guest::FreeBSD::AnsibleInstall do describe "when install_mode is :default (or unknown)" do it "installs ansible with 'pkg' package manager" do - expect(communicator).to receive(:sudo).with("yes | pkg install ansible") + expect(communicator).to receive(:sudo).with("pkg install -qy py36-ansible") subject.ansible_install(machine, :default, "", "", "") end end end -end \ No newline at end of file +end diff --git a/test/unit/plugins/provisioners/ansible/cap/guest/shared/pip_ansible_install_examples.rb b/test/unit/plugins/provisioners/ansible/cap/guest/shared/pip_ansible_install_examples.rb index ba6e096c9..b897d94a3 100644 --- a/test/unit/plugins/provisioners/ansible/cap/guest/shared/pip_ansible_install_examples.rb +++ b/test/unit/plugins/provisioners/ansible/cap/guest/shared/pip_ansible_install_examples.rb @@ -33,7 +33,7 @@ shared_examples_for "Ansible setup via pip on Debian-based systems" do expect(communicator).to receive(:sudo).once.ordered. with("apt-get update -y -qq") expect(communicator).to receive(:sudo).once.ordered. - with("apt-get install -y -qq build-essential curl git libssl-dev libffi-dev python-dev") + with("DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --option \"Dpkg::Options::=--force-confold\" build-essential curl git libssl-dev libffi-dev python-dev") expect(communicator).to receive(:sudo).once.ordered. with("pip install --upgrade ansible") @@ -44,7 +44,7 @@ shared_examples_for "Ansible setup via pip on Debian-based systems" do expect(communicator).to receive(:sudo).once.ordered. with("apt-get update -y -qq") expect(communicator).to receive(:sudo).once.ordered. - with("apt-get install -y -qq build-essential curl git libssl-dev libffi-dev python-dev") + with("DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --option \"Dpkg::Options::=--force-confold\" build-essential curl git libssl-dev libffi-dev python-dev") expect(communicator).to receive(:sudo).once.ordered. with("pip install") @@ -65,4 +65,4 @@ shared_examples_for "Ansible setup via pip is not implemented" do end end -end \ No newline at end of file +end diff --git a/test/unit/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install_test.rb b/test/unit/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install_test.rb index cae9a4cf8..f29bcd43d 100644 --- a/test/unit/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install_test.rb +++ b/test/unit/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install_test.rb @@ -42,13 +42,13 @@ describe VagrantPlugins::Ansible::Cap::Guest::Ubuntu::AnsibleInstall do expect(communicator).to receive(:sudo).once.ordered. with(""" apt-get update -y -qq && \ - apt-get install -y -qq software-properties-common + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq software-properties-common --option \"Dpkg::Options::=--force-confold\" """) expect(communicator).to receive(:sudo).once.ordered. with(""" add-apt-repository ppa:ansible/ansible -y && \ apt-get update -y -qq && \ - apt-get install -y -qq ansible + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq ansible --option \"Dpkg::Options::=--force-confold\" """) subject.ansible_install(machine, :default, "", "", "") @@ -62,7 +62,7 @@ describe VagrantPlugins::Ansible::Cap::Guest::Ubuntu::AnsibleInstall do with(""" add-apt-repository ppa:ansible/ansible -y && \ apt-get update -y -qq && \ - apt-get install -y -qq ansible + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq ansible --option \"Dpkg::Options::=--force-confold\" """) subject.ansible_install(machine, :default, "", "", "") @@ -73,4 +73,4 @@ describe VagrantPlugins::Ansible::Cap::Guest::Ubuntu::AnsibleInstall do end end -end \ No newline at end of file +end