From 80a4e2138e195b3a2195899168046e3bb462acfb Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Wed, 15 May 2024 15:59:20 +0100 Subject: [PATCH] test --- spec/tasks/vagrant_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 spec/tasks/vagrant_spec.rb diff --git a/spec/tasks/vagrant_spec.rb b/spec/tasks/vagrant_spec.rb new file mode 100644 index 00000000..268475b6 --- /dev/null +++ b/spec/tasks/vagrant_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' +require_relative '../../tasks/vagrant' + +describe 'vagrant' do + let(:platform) { 'generic/debian10' } + let(:inventory_location) { './spec/fixtures/litmus_inventory.yaml' } + let(:enable_synced_folder) { true } + let(:provider) { 'virtualbox' } + let(:cpus) { 2 } + let(:memory) { 2048 } + let(:hyperv_vswitch) { nil } + let(:hyperv_smb_username) { nil } + let(:hyperv_smb_password) { nil } + let(:box_url) { nil } + let(:password) { 'password' } + let(:vars) { 'role: worker1' } + + describe 'provision::vagrant' do + it 'provisions a new vagrant box' do + result = provision(platform, inventory_location, enable_synced_folder, provider, cpus, memory, hyperv_vswitch, hyperv_smb_username, hyperv_smb_password, box_url, password, vars) + expect(result[:status]).to eq('ok') + expect(result[:node_name]).not_to be_nil + expect(result[:node]['facts']['provisioner']).to eq('vagrant') + expect(result[:node]['facts']['platform']).to eq(platform) + # expect(result[:node]['vars']).to eq(JSON.parse(vars)) + end + end +end