From 640d640c9b55e5c7697bd22b6c8a91758d90f563 Mon Sep 17 00:00:00 2001 From: Marcus Young Date: Tue, 5 May 2020 11:24:59 -0500 Subject: [PATCH] Fix up dependencies --- Gemfile | 11 - Gemfile.lock | 224 ++---------------- Jenkinsfile | 70 ------ README.md | 19 -- .../bios_serial/bios_serial_spec.rb | 6 - .../dynamic_network/network_spec.rb | 6 - test/integration/optimized_for.sh | 4 - .../singleton-static_network/network_spec.rb | 11 - vagrant-ovirt4.gemspec | 1 + 9 files changed, 18 insertions(+), 334 deletions(-) delete mode 100644 Jenkinsfile delete mode 100644 test/integration/bios_serial/bios_serial_spec.rb delete mode 100644 test/integration/dynamic_network/network_spec.rb delete mode 100644 test/integration/optimized_for.sh delete mode 100644 test/integration/singleton-static_network/network_spec.rb diff --git a/Gemfile b/Gemfile index 3b6c5c1..cf56f32 100755 --- a/Gemfile +++ b/Gemfile @@ -1,22 +1,11 @@ source 'http://rubygems.org' group :development do - gem 'vagrant', :git => 'git://github.com/myoung34/vagrant.git' gem 'pry' gem 'byebug' gem 'pry-byebug' end -group :testing do - gem 'rspec-its' - gem 'rspec' - gem 'rake' - gem 'kitchen-vagrant' - gem 'kitchen-inspec' - gem 'test-kitchen' - gem 'net-scp', "~>1.2" -end - group :plugins do gem 'vagrant-ovirt4', :path => '.' end diff --git a/Gemfile.lock b/Gemfile.lock index 15dc27c..32abe9b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,229 +1,39 @@ -GIT - remote: git://github.com/myoung34/vagrant.git - revision: 4572267c33f4ba569f68ad4bff026e9a7ef63b56 - specs: - vagrant (1.9.3.dev) - childprocess (~> 0.5.0) - erubis (~> 2.7.0) - hashicorp-checkpoint (~> 0.1.1) - i18n (>= 0.6.0, <= 0.8.0) - listen (~> 3.1.5) - log4r (~> 1.1.9, < 1.1.11) - net-scp (~> 1.2.0) - net-sftp (~> 2.1) - net-ssh (~> 3.0.1) - nokogiri (= 1.6.7.1) - rb-kqueue (~> 0.2.0) - rest-client (>= 1.6.0, < 3.0) - ruby_dep (<= 1.3.1) - wdm (~> 0.1.0) - winrm (~> 2.1) - winrm-elevated (~> 1.1) - winrm-fs (~> 1.0) - PATH remote: . specs: - vagrant-ovirt4 (1.2.1) + vagrant-ovirt4 (1.2.3) filesize (~> 0) + nokogiri (>= 1.10.8) ovirt-engine-sdk (~> 4.0.1) GEM remote: http://rubygems.org/ specs: - artifactory (2.7.0) - blankslate (2.1.2.4) - builder (3.2.3) - byebug (9.0.6) - childprocess (0.5.9) - ffi (~> 1.0, >= 1.0.11) - coderay (1.1.1) - diff-lcs (1.3) - docker-api (1.33.2) - excon (>= 0.38.0) - json - domain_name (0.5.20170223) - unf (>= 0.0.5, < 1.0.0) - erubis (2.7.0) - excon (0.71.0) - faraday (0.11.0) - multipart-post (>= 1.2, < 3) - ffi (1.11.1) - filesize (0.1.1) - gssapi (1.2.0) - ffi (>= 1.0.1) - gyoku (1.3.1) - builder (>= 2.1.2) - hashicorp-checkpoint (0.1.4) - hashie (3.5.5) - http-cookie (1.0.3) - domain_name (~> 0.5) - httpclient (2.8.3) - i18n (0.8.0) - inspec (1.15.0) - faraday (>= 0.9.0) - hashie (~> 3.4) - json (>= 1.8, < 3.0) - method_source (~> 0.8) - mixlib-log - parallel (~> 1.9) - pry (~> 0) - rainbow (~> 2) - rspec (~> 3) - rspec-its (~> 1.2) - rspec_junit_formatter (~> 0.2.3) - rubyzip (~> 1.1) - sslshake (~> 1) - thor (~> 0.19) - toml (~> 0.1) - train (>= 0.22.0, < 1.0) - json (2.0.3) - kitchen-inspec (0.17.0) - hashie (~> 3.4) - inspec (>= 0.34.0, < 2.0.0) - test-kitchen (~> 1.6) - kitchen-vagrant (1.0.2) - test-kitchen (~> 1.4) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - little-plugger (1.1.4) - log4r (1.1.10) - logging (2.1.0) - little-plugger (~> 1.1) - multi_json (~> 1.10) - method_source (0.8.2) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.0.0) - mixlib-install (2.1.12) - artifactory - mixlib-shellout - mixlib-versioning - thor - mixlib-log (1.7.1) - mixlib-shellout (2.2.7) - mixlib-versioning (1.1.0) - multi_json (1.12.1) - multipart-post (2.0.0) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-ssh (3.0.2) - net-ssh-gateway (1.3.0) - net-ssh (>= 2.6.5) - netrc (0.11.0) - nokogiri (1.6.7.1) - mini_portile2 (~> 2.0.0.rc2) - nori (2.6.0) + byebug (11.1.3) + coderay (1.1.2) + filesize (0.2.0) + json (2.3.0) + method_source (1.0.0) + mini_portile2 (2.4.0) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) ovirt-engine-sdk (4.0.12) json - parallel (1.10.0) - parslet (1.5.0) - blankslate (~> 2.0) - pry (0.10.4) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.4.0) - byebug (~> 9.0) - pry (~> 0.10) - rainbow (2.2.1) - rake (13.0.1) - rb-fsevent (0.9.8) - rb-inotify (0.9.8) - ffi (>= 0.5.0) - rb-kqueue (0.2.4) - ffi (>= 0.5.0) - rest-client (2.0.1) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-its (1.2.0) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) - rspec-mocks (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - rspec_junit_formatter (0.2.3) - builder (< 4) - rspec-core (>= 2, < 4, != 2.12.0) - ruby_dep (1.3.1) - rubyntlm (0.6.1) - rubyzip (1.3.0) - safe_yaml (1.0.4) - slop (3.6.0) - sslshake (1.0.13) - test-kitchen (1.15.0) - mixlib-install (>= 1.2, < 3.0) - mixlib-shellout (>= 1.2, < 3.0) - net-scp (~> 1.1) - net-ssh (>= 2.9, < 5.0) - net-ssh-gateway (~> 1.2) - safe_yaml (~> 1.0) - thor (~> 0.18) - thor (0.19.4) - toml (0.1.2) - parslet (~> 1.5.0) - train (0.22.1) - docker-api (~> 1.26) - json (>= 1.8, < 3.0) - mixlib-shellout (~> 2.0) - net-scp (~> 1.2) - net-ssh (>= 2.9, < 5.0) - winrm (~> 2.0) - winrm-fs (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.2) - wdm (0.1.1) - winrm (2.1.2) - builder (>= 2.1.2) - erubis (~> 2.7) - gssapi (~> 1.2) - gyoku (~> 1.0) - httpclient (~> 2.2, >= 2.2.0.2) - logging (>= 1.6.1, < 3.0) - nori (~> 2.0) - rubyntlm (~> 0.6.0, >= 0.6.1) - winrm-elevated (1.1.0) - winrm (~> 2.0) - winrm-fs (~> 1.0) - winrm-fs (1.0.1) - erubis (~> 2.7) - logging (>= 1.6.1, < 3.0) - rubyzip (~> 1.1) - winrm (~> 2.0) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.9.0) + byebug (~> 11.0) + pry (~> 0.13.0) PLATFORMS ruby DEPENDENCIES byebug - kitchen-inspec - kitchen-vagrant - net-scp (~> 1.2) pry pry-byebug - rake - rspec - rspec-its - test-kitchen - vagrant! vagrant-ovirt4! BUNDLED WITH - 1.14.4 + 1.17.2 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index c8b9e79..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env groovy -node { - stage('Checkout') { - checkout scm - } - - // Run as many tests as possible in parallel. - String[] vagrantVersions = ["1.9.1", "1.9.2"] - stage('Test') { - - def buildJobs = [:] - - buildJobs["rspec"] = { - docker.build("jenkins/ruby:2.2.6").inside('-v /opt/gemcache:/opt/gemcache') { - sh """#!/bin/bash -ex - bundle install --path /opt/gemcache - bundle exec rspec - """ - } - } - - for (int i = 0; i < vagrantVersions.length; i++) { - def index = i //if we tried to use i below, it would equal 4 in each job execution. - def vagrantVersion = vagrantVersions[index] - - buildJobs["vagrant-${vagrantVersion}"] = { - - docker.image("myoung34/vagrant:${vagrantVersion}").inside('-v /opt/gemcache:/opt/gemcache') { - sh """#!/bin/bash -ex - temp_dir="/tmp/\$(cat /proc/sys/kernel/random/uuid)" - cp -r \$(pwd) \$temp_dir - cd \$temp_dir - gem build *.gemspec - /usr/bin/vagrant plugin install *.gem - bundle install --path /opt/gemcache --without development plugins - export VAGRANT_VERSION=\$(echo ${vagrantVersion} | sed 's/\\.//g') - bundle exec kitchen test ^[^singleton-] - """ - } - - } - } - - parallel( buildJobs ) - } - - for (int i = 0; i < vagrantVersions.length; i++) { - def index = i //if we tried to use i below, it would equal 4 in each job execution. - def vagrantVersion = vagrantVersions[index] - - - stage("singleton vagrant-${vagrantVersion}") { - docker.image("myoung34/vagrant:${vagrantVersion}").inside('-v /opt/gemcache:/opt/gemcache') { - sh """#!/bin/bash -ex - gem build *.gemspec - /usr/bin/vagrant plugin install *.gem - bundle install --path /opt/gemcache --without development plugins - bundle exec kitchen destroy all - rm -rf .kitchen - export VAGRANT_VERSION=\$(echo ${vagrantVersion} | sed 's/\\.//g') - bundle exec kitchen test ^singleton- - """ - } - } - } - - stage("Cleanup") { - deleteDir() - } -} diff --git a/README.md b/README.md index 08d950c..3d75e3b 100755 --- a/README.md +++ b/README.md @@ -132,25 +132,6 @@ end a. `storage_domain`: the storage domain where the disk should be created -## Testing - -Currently pull-requests are tested via [test-kitchen using kitchen-vagrant](https://github.com/test-kitchen/kitchen-vagrant). -See [Jenkinsfile](Jenkinsfile) for more information. -If you'd like to run them yourself, however, they make not work in all setups. For example they assume `192.168.2.0/24`, host pinning will probably not have a host that's in all set ups, and the template names might not match. - -To run Unit tests: `bundle install; bundle exec rspec` - -To run acceptance tests: - -```bash -export OVIRT_URL='https://yoururl/ovirt-engine/api'' -export OVIRT_USERNAME='yourname@internal' -export OVIRT_PASSWORD='yourpassword!' -gem build *.gemspec -vagrant plugin install *.gem -bundle exec kitchen test all -``` - ## Contributing 1. Fork it diff --git a/test/integration/bios_serial/bios_serial_spec.rb b/test/integration/bios_serial/bios_serial_spec.rb deleted file mode 100644 index cef9acf..0000000 --- a/test/integration/bios_serial/bios_serial_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -describe command('dmidecode -s system-serial-number') do - its(:exit_status) { should eq 0 } - its(:stderr) { should be_empty } - its(:stdout) { should match(/^banana-hammock$/) } -end - diff --git a/test/integration/dynamic_network/network_spec.rb b/test/integration/dynamic_network/network_spec.rb deleted file mode 100644 index f4fe1b1..0000000 --- a/test/integration/dynamic_network/network_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -describe command('uname -a') do - its(:exit_status) { should eq 0 } - its(:stderr) { should be_empty } - its(:stdout) { should match(/^Linux kitchen-dynamic-[0-9]+-[a-f0-9\-]+/) } -end - diff --git a/test/integration/optimized_for.sh b/test/integration/optimized_for.sh deleted file mode 100644 index 0323975..0000000 --- a/test/integration/optimized_for.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -bios_serial=$(vagrant ssh -c 'sudo dmidecode -s system-serial-number' 2>/dev/null | tail -n 1 | sed 's/[\r\n]//g') -vm_id=$(curl --silent -k -L --user "${OVIRT_USERNAME}:${OVIRT_PASSWORD}" --header 'Content-Type: application/xml' --header 'Accept: application/xml' ${OVIRT_URL}/vms | xmllint --xpath 'string(./vms/vm[./serial_number/value/text() = "'$bios_serial'"]/@id)' -) -curl --silent -k -L --user "${OVIRT_USERNAME}:${OVIRT_PASSWORD}" --header 'Content-Type: application/xml' --header 'Accept: application/xml' ${OVIRT_URL}/vms/${vm_id} | xmllint --xpath './vm/type/text()' - | grep server diff --git a/test/integration/singleton-static_network/network_spec.rb b/test/integration/singleton-static_network/network_spec.rb deleted file mode 100644 index 20ac7fd..0000000 --- a/test/integration/singleton-static_network/network_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -describe command('uname -a') do - its(:exit_status) { should eq 0 } - its(:stderr) { should be_empty } - its(:stdout) { should match(/^Linux kitchen-static-[0-9]+-[a-f0-9\-]+/) } -end - -describe command("ip route get 1 | awk '{print $NF;exit}'") do - its(:exit_status) { should eq 0 } - its(:stderr) { should be_empty } - its(:stdout) { should match(/^192.168.2.254$/) } -end diff --git a/vagrant-ovirt4.gemspec b/vagrant-ovirt4.gemspec index 3ae40ac..5454104 100755 --- a/vagrant-ovirt4.gemspec +++ b/vagrant-ovirt4.gemspec @@ -18,5 +18,6 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'ovirt-engine-sdk', '~> 4.0.1' gem.add_runtime_dependency 'filesize', '~> 0' + gem.add_runtime_dependency 'nokogiri', '>= 1.10.8' end