sous-chefs / packagecloud

Development repository for the packagecloud cookbook
https://supermarket.chef.io/cookbooks/packagecloud
Apache License 2.0
17 stars 48 forks source link

Pile of small fixes and testing improvements #53

Closed tas50 closed 6 years ago

tas50 commented 7 years ago

1 change per commit. This syncs up testing to Chef best practices and fixes warnings / failures in Chef 13

damacus commented 7 years ago

We probably don't need the Vagrantfile anymore. Kitchen should be handling this for us no?

tas50 commented 7 years ago

Ping. It would be great to get this merged in and released

damacus commented 7 years ago

Hi!

We're stuck on merging a downstream change due to this being broken right now.

Any chance we can ship and merge this please?

ice799 commented 7 years ago

Hi!

When I attempt to run the kitchen test suite for this cookbook (the default-ubuntu-1404 instance), the changes on this branch cause the tests to fail. I've included the output below - you can reproduce it by running kitchen test locally.

       ================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/yum/resources/globalconfig.rb
       ================================================================================

       ArgumentError
       -------------
       Cannot specify both default and name_property/name_attribute together on property path of resource yum_globalconfig

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/yum/resources/globalconfig.rb:76:in `class_from_file'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/yum/resources/globalconfig.rb:

        69:  attribute :mdpolicy, :kind_of => String, :equal_to => %w(instant group:primary group:small group:main group:all), :default => nil
        70:  attribute :metadata_expire, :kind_of => String, :regex => [/^\d+$/, /^\d+[mhd]$/, /never/], :default => nil
        71:  attribute :mirrorlist_expire, :kind_of => String, :regex => /^\d+$/, :default => nil
        72:  attribute :multilib_policy, :kind_of => String, :equal_to => %w(all best), :default => nil
        73:  attribute :obsoletes, :kind_of => [TrueClass, FalseClass], :default => nil
        74:  attribute :overwrite_groups, :kind_of => [TrueClass, FalseClass], :default => nil
        75:  attribute :password, :kind_of => String, :regex => /.*/, :default => nil
        76>> attribute :path, :kind_of => String, :regex => /.*/, :default => nil, :name_attribute => true
        77:  attribute :persistdir, :kind_of => String, :regex => /.*/, :default => nil
        78:  attribute :pluginconfpath, :kind_of => String, :regex => /.*/, :default => nil
        79:  attribute :pluginpath, :kind_of => String, :regex => /.*/, :default => nil
        80:  attribute :plugins, :kind_of => [TrueClass, FalseClass], :default => true
        81:  attribute :protected_multilib, :kind_of => [TrueClass, FalseClass], :default => nil
        82:  attribute :protected_packages, :kind_of => String, :regex => /.*/, :default => nil
        83:  attribute :proxy, :kind_of => String, :regex => /.*/, :default => nil
        84:  attribute :proxy_password, :kind_of => String, :regex => /.*/, :default => nil
        85:  attribute :proxy_username, :kind_of => String, :regex => /.*/, :default => nil

       System Info:
       ------------
       chef_version=13.1.31
       platform=ubuntu
       platform_version=14.04
       ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
       program_name=chef-client worker: ppid=1226;start=07:14:23;
       executable=/opt/chef/bin/chef-client
damacus commented 7 years ago

Hi @ice799 I'm not getting this errror on tas50's branch

       Finished in 0.11124 seconds (files took 0.34092 seconds to load)
       15 examples, 0 failures
ice799 commented 7 years ago

Hi @damacus. The test output you've provided is not from the kitchen ci tests. Those are the chefspec/rspec tests. We also need the kitchen ci tests to pass before merging this. There's a few changes provided in this PR that unfortunately, I won't be able to merge. I'll try to leave a review for those changes, soon.

damacus commented 7 years ago

Nope , they are the inspec tests passing.

I can paste the full link if you'd like?

We're finding it easier in sous-chefs to use Travis automated testing to complete the testing for us automatically so everyone can see the output.

The Haproxy repo has a good bunch of Travis settings and dokken integrated testing

https://github.com/sous-chefs/haproxy?files=1

ice799 commented 7 years ago

Hi @damacus, please see my previous reply here: https://github.com/computology/packagecloud-cookbook/pull/53#issuecomment-308029469.

Until kitchen test passes I can not merge this PR. It does not currently pass. It is not run automatically with Travis. Some changes must also be made to this PR before it can be merged. I will do a review soon. Thanks!

damacus commented 7 years ago

See below for me checking out tas50's repo, switching to the fork, and running kitchen test.

So I'm not sure which branch you're testing on. Possibly the main branch in the package-cloud repo?

git clone git@github.com:tas50/packagecloud-cookbook.git Cloning into 'packagecloud-cookbook'... remote: Counting objects: 850, done. remote: Total 850 (delta 0), reused 0 (delta 0), pack-reused 850 Receiving objects: 100% (850/850), 119.58 KiB | 0 bytes/s, done. Resolving deltas: 100% (355/355), done. ➜ sous-chefs cd packagecloud-cookbook && git checkout fixup Branch fixup set up to track remote branch fixup from origin. Switched to a new branch 'fixup' ➜ packagecloud-cookbook git:(fixup) kitchen test -----> Starting Kitchen (v1.16.0) -----> Cleaning up any prior instances of -----> Destroying ... Finished destroying (0m0.00s). -----> Testing -----> Creating ... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'bento/ubuntu-14.04'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'bento/ubuntu-14.04' is up to date... ==> default: A newer version of the box 'bento/ubuntu-14.04' is available! You currently ==> default: have version '2.3.4'. The latest is version '2.3.5'. Run ==> default: `vagrant box update` to update. ==> default: Setting the name of the VM: kitchen-packagecloud-cookbook-default-ubuntu-1404_default_1497426364334_22487 ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: default: Vagrant insecure key detected. Vagrant will automatically replace default: this with a newly generated keypair for better security. default: default: Inserting generated public key within guest... default: Removing insecure key from the guest if it's present... default: Key inserted! Disconnecting and reconnecting using new SSH key... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... ==> default: Setting hostname... ==> default: Mounting shared folders... default: /tmp/omnibus/cache => /Users/dmw/.kitchen/cache ==> default: Machine not provisioned because `--no-provision` is specified. [SSH] Established Vagrant instance created. Finished creating (0m34.32s). -----> Converging ... Preparing files for transfer Preparing dna.json Resolving cookbook dependencies with Berkshelf 6.0.1... Removing non-cookbook files before transfer Preparing validation.pem Preparing client.rb -----> Installing Chef Omnibus (install only if missing) Downloading https://omnitruck.chef.io/install.sh to file /tmp/install.sh Trying wget... Download complete. ubuntu 14.04 x86_64 Getting information for chef stable for ubuntu... downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=ubuntu&pv=14.04&m=x86_64 to file /tmp/install.sh.1539/metadata.txt trying wget... sha1 0a9cb607bc5b9189c88a981ee010e1e15a8a9042 sha256 d8b0a8c012945cda9a2ff1b6b93bd852b06b81c71b4604250dac7c90143fd14d url https://packages.chef.io/files/stable/chef/13.1.31/ubuntu/14.04/chef_13.1.31-1_amd64.deb version 13.1.31 downloaded metadata file looks valid... /tmp/omnibus/cache/chef_13.1.31-1_amd64.deb already exists, verifiying checksum... Comparing checksum with sha256sum... checksum compare succeeded, using existing file! WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING You are installing an omnibus package without a version pin. If you are installing on production servers via an automated process this is DANGEROUS and you will be upgraded without warning on new releases, even to new major releases. Letting the version float is only appropriate in desktop, test, development or CI/CD environments. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Installing chef installing with dpkg... Selecting previously unselected package chef. (Reading database ... 35391 files and directories currently installed.) Preparing to unpack .../cache/chef_13.1.31-1_amd64.deb ... Unpacking chef (13.1.31-1) ... Setting up chef (13.1.31-1) ... Thank you for installing Chef! Transferring files to Starting Chef Client, version 13.1.31 Creating a new client identity for default-ubuntu-1404 using the validator key. resolving cookbooks for run list: ["packagecloud_test::distro_deps", "packagecloud_test::deb", "packagecloud_test::rubygems"] Synchronizing Cookbooks: - packagecloud_test (0.0.0) - packagecloud (0.3.0) - yum (5.0.1) Installing Cookbook Gems: Compiling Cookbooks... Converging 11 resources Recipe: packagecloud_test::distro_deps * apt_update[] action periodic - update new lists of packages * directory[/var/lib/apt/periodic] action create (up to date) * directory[/etc/apt/apt.conf.d] action create (up to date) * file[/etc/apt/apt.conf.d/15update-stamp] action create_if_missing (up to date) * execute[apt-get -q update] action run - execute apt-get -q update * apt_package[ruby] action install - install version 1:1.9.3.4 of package ruby * apt_package[dpkg-dev] action install - install version 1.17.5ubuntu5.7 of package dpkg-dev Recipe: packagecloud_test::deb * packagecloud_repo[computology_public_deb] action add * apt_package[wget] action install (up to date) * apt_package[apt-transport-https] action install (up to date) * apt_package[lsb-release] action install (up to date) * ohai[reload-lsb-computology_public_deb] action nothing (skipped due to action :nothing) * template[/etc/apt/sources.list.d/computology_public_deb.list] action create - create new file /etc/apt/sources.list.d/computology_public_deb.list - update content in file /etc/apt/sources.list.d/computology_public_deb.list from none to fa4386 --- /etc/apt/sources.list.d/computology_public_deb.list 2017-06-14 07:48:05.494639182 +0000 +++ /etc/apt/sources.list.d/.chef-computology_public_deb20170614-1628-pxj6b1.list 2017-06-14 07:48:05.494639182 +0000 @@ -1 +1,3 @@ +deb https://packagecloud.io/computology/packagecloud-cookbook-test-public/ubuntu trusty main +deb-src https://packagecloud.io/computology/packagecloud-cookbook-test-public/ubuntu trusty main - change mode from '' to '0644' * execute[apt-key-add-computology_public_deb] action run - execute wget --auth-no-challenge -qO - https://packagecloud.io/computology/packagecloud-cookbook-test-public/gpgkey | apt-key add - * execute[apt-get-update-computology_public_deb] action run - execute apt-get update -o Dir::Etc::sourcelist="sources.list.d/computology_public_deb.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" * execute[apt-key-add-computology_public_deb] action nothing (skipped due to action :nothing) * execute[apt-get-update-computology_public_deb] action nothing (skipped due to action :nothing) * apt_package[jake] action install - install version 1.0-5 of package jake * packagecloud_repo[computology_private] action add * apt_package[wget] action install (up to date) * apt_package[apt-transport-https] action install (up to date) * apt_package[lsb-release] action install (up to date) * ohai[reload-lsb-computology_private] action nothing (skipped due to action :nothing) * template[/etc/apt/sources.list.d/computology_private.list] action create - create new file /etc/apt/sources.list.d/computology_private.list - update content in file /etc/apt/sources.list.d/computology_private.list from none to 976cc1 --- /etc/apt/sources.list.d/computology_private.list 2017-06-14 07:48:18.104331187 +0000 +++ /etc/apt/sources.list.d/.chef-computology_private20170614-1628-a8hszb.list 2017-06-14 07:48:18.104331187 +0000 @@ -1 +1,3 @@ +deb https://177f893699ab01dcaf687c4359928e1ffe043c57815ef361:@packagecloud.io/computology/packagecloud-cookbook-test-private/ubuntu trusty main +deb-src https://177f893699ab01dcaf687c4359928e1ffe043c57815ef361:@packagecloud.io/computology/packagecloud-cookbook-test-private/ubuntu trusty main - change mode from '' to '0644' * execute[apt-key-add-computology_private] action run - execute wget --auth-no-challenge -qO - https://177f893699ab01dcaf687c4359928e1ffe043c57815ef361:@packagecloud.io/computology/packagecloud-cookbook-test-private/gpgkey | apt-key add - * execute[apt-get-update-computology_private] action run - execute apt-get update -o Dir::Etc::sourcelist="sources.list.d/computology_private.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" * execute[apt-key-add-computology_private] action nothing (skipped due to action :nothing) * execute[apt-get-update-computology_private] action nothing (skipped due to action :nothing) * apt_package[jake-doc] action install - install version 1.0-5 of package jake-doc * execute[install_jake_source] action run - execute apt-get source jake * packagecloud_repo[computology/packagecloud-test-packages] action add * apt_package[wget] action install (up to date) * apt_package[apt-transport-https] action install (up to date) * apt_package[lsb-release] action install (up to date) * ohai[reload-lsb-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) * template[/etc/apt/sources.list.d/computology_packagecloud-test-packages.list] action create - create new file /etc/apt/sources.list.d/computology_packagecloud-test-packages.list - update content in file /etc/apt/sources.list.d/computology_packagecloud-test-packages.list from none to f709f6 --- /etc/apt/sources.list.d/computology_packagecloud-test-packages.list 2017-06-14 07:48:34.388185182 +0000 +++ /etc/apt/sources.list.d/.chef-computology_packagecloud-test-packages20170614-1628-1yrl9md.list 2017-06-14 07:48:34.388185182 +0000 @@ -1 +1,3 @@ +deb https://packagecloud.io/computology/packagecloud-test-packages/debian wheezy main +deb-src https://packagecloud.io/computology/packagecloud-test-packages/debian wheezy main - change mode from '' to '0644' * execute[apt-key-add-computology_packagecloud-test-packages] action run - execute wget --auth-no-challenge -qO - https://packagecloud.io/computology/packagecloud-test-packages/gpgkey | apt-key add - * execute[apt-get-update-computology_packagecloud-test-packages] action run - execute apt-get update -o Dir::Etc::sourcelist="sources.list.d/computology_packagecloud-test-packages.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" * execute[apt-key-add-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) * execute[apt-get-update-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) Recipe: packagecloud_test::rubygems * packagecloud_repo[computology/packagecloud-cookbook-test-public] action add * execute[install packagecloud computology/packagecloud-cookbook-test-public repo as gem source] action run - execute gem source --add https://packagecloud.io/computology/packagecloud-cookbook-test-public/ * gem_package[jakedotrb] action install[2017-06-14T07:48:43+00:00] WARN: failed to find gem jakedotrb (= 0.0.1) from [https://www.rubygems.org] - install version 0.0.1 of package jakedotrb Running handlers: Running handlers complete Chef Client finished, 22/43 resources updated in 02 minutes 06 seconds Finished converging (2m24.18s). -----> Setting up ... Finished setting up (0m0.00s). -----> Verifying ... Preparing files for transfer -----> Installing Busser (busser) Fetching: thor-0.19.0.gem (100%) Successfully installed thor-0.19.0 Fetching: busser-0.7.1.gem (100%) Successfully installed busser-0.7.1 2 gems installed Installing Busser plugins: busser-serverspec Plugin serverspec installed (version 0.5.10) -----> Running postinstall for serverspec plugin Suite path directory /tmp/verifier/suites does not exist, skipping. Transferring files to -----> Running serverspec test suite -----> Installing Serverspec.. Fetching: diff-lcs-1.3.gem (100%) Fetching: rspec-expectations-3.6.0.gem (100%) Fetching: rspec-mocks-3.6.0.gem (100%) Fetching: rspec-3.6.0.gem (100%) Fetching: rspec-its-1.2.0.gem (100%) Fetching: multi_json-1.12.1.gem (100%) Fetching: net-ssh-4.1.0.gem (100%) Fetching: net-scp-1.2.1.gem (100%) Fetching: net-telnet-0.1.1.gem (100%) Fetching: sfl-2.3.gem (100%) Fetching: specinfra-2.68.0.gem (100%) Fetching: serverspec-2.39.1.gem (100%) -----> serverspec installed (version 2.39.1) /opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec -I/tmp/verifier/gems/gems/rspec-support-3.6.0/lib:/tmp/verifier/gems/gems/rspec-core-3.6.0/lib /opt/chef/embedded/bin/rspec --pattern /tmp/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/verifier/suites/serverspec File "/etc/apt/sources.list.d/computology_packagecloud-test-packages.list" should exist content should eq "deb https://packagecloud.io/computology/packagecloud-test-packages/debian wheezy main\ndeb-src https://packagecloud.io/computology/packagecloud-test-packages/debian wheezy main\n" Command "ls /usr/local/bin/jake" exit_status should eq 0 Command "/usr/local/bin/jake" exit_status should eq 0 stdout should eq "as it so happens, jake douglas is a very nice young man.\n" Command "man jake" exit_status should eq 0 stdout should match /jake man page/ stdout should match /binary executable program/ stdout should match /No known bugs/ Command "ls /home/vagrant/jake_1.0-7.dsc" exit_status should eq 0 Command "ls /home/vagrant/jake_1.0.orig.tar.bz2" exit_status should eq 0 Command "ls /home/vagrant/jake_1.0-7.debian.tar.gz" exit_status should eq 0 Command "ls /usr/local/bin/jakedotrb" exit_status should eq 0 Command "/usr/local/bin/jakedotrb" exit_status should eq 0 stdout should match /jake douglas is a very nice young man./ Finished in 0.10873 seconds (files took 0.3408 seconds to load) 15 examples, 0 failures Finished verifying (0m11.26s). -----> Destroying ... ==> default: Forcing shutdown of VM... ==> default: Destroying VM and associated drives... Vagrant instance destroyed. Finished destroying (0m5.02s). Finished testing (3m14.79s). -----> Cleaning up any prior instances of -----> Destroying ... Finished destroying (0m0.00s). -----> Testing -----> Creating ... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'bento/ubuntu-16.04'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'bento/ubuntu-16.04' is up to date... ==> default: A newer version of the box 'bento/ubuntu-16.04' is available! You currently ==> default: have version '2.3.4'. The latest is version '2.3.5'. Run ==> default: `vagrant box update` to update. ==> default: Setting the name of the VM: kitchen-packagecloud-cookbook-default-ubuntu-1604_default_1497426560116_4423 ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: default: Vagrant insecure key detected. Vagrant will automatically replace default: this with a newly generated keypair for better security. default: default: Inserting generated public key within guest... default: Removing insecure key from the guest if it's present... default: Key inserted! Disconnecting and reconnecting using new SSH key... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... ==> default: Setting hostname... ==> default: Mounting shared folders... default: /tmp/omnibus/cache => /Users/dmw/.kitchen/cache ==> default: Machine not provisioned because `--no-provision` is specified. [SSH] Established Vagrant instance created. Finished creating (0m35.53s). -----> Converging ... Preparing files for transfer Preparing dna.json Resolving cookbook dependencies with Berkshelf 6.0.1... Removing non-cookbook files before transfer Preparing validation.pem Preparing client.rb -----> Installing Chef Omnibus (install only if missing) Downloading https://omnitruck.chef.io/install.sh to file /tmp/install.sh Trying wget... Download complete. ubuntu 16.04 x86_64 Getting information for chef stable for ubuntu... downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=ubuntu&pv=16.04&m=x86_64 to file /tmp/install.sh.1654/metadata.txt trying wget... sha1 0a9cb607bc5b9189c88a981ee010e1e15a8a9042 sha256 d8b0a8c012945cda9a2ff1b6b93bd852b06b81c71b4604250dac7c90143fd14d url https://packages.chef.io/files/stable/chef/13.1.31/ubuntu/16.04/chef_13.1.31-1_amd64.deb version 13.1.31 downloaded metadata file looks valid... /tmp/omnibus/cache/chef_13.1.31-1_amd64.deb already exists, verifiying checksum... Comparing checksum with sha256sum... checksum compare succeeded, using existing file! WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING You are installing an omnibus package without a version pin. If you are installing on production servers via an automated process this is DANGEROUS and you will be upgraded without warning on new releases, even to new major releases. Letting the version float is only appropriate in desktop, test, development or CI/CD environments. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Installing chef installing with dpkg... Selecting previously unselected package chef. (Reading database ... 37826 files and directories currently installed.) Preparing to unpack .../cache/chef_13.1.31-1_amd64.deb ... Unpacking chef (13.1.31-1) ... Setting up chef (13.1.31-1) ... Thank you for installing Chef! Transferring files to Starting Chef Client, version 13.1.31 Creating a new client identity for default-ubuntu-1604 using the validator key. resolving cookbooks for run list: ["packagecloud_test::distro_deps", "packagecloud_test::deb", "packagecloud_test::rubygems_private"] Synchronizing Cookbooks: - yum (5.0.1) - packagecloud_test (0.0.0) - packagecloud (0.3.0) Installing Cookbook Gems: Compiling Cookbooks... Converging 12 resources Recipe: packagecloud_test::distro_deps * apt_update[] action periodic - update new lists of packages * directory[/var/lib/apt/periodic] action create (up to date) * directory[/etc/apt/apt.conf.d] action create (up to date) * file[/etc/apt/apt.conf.d/15update-stamp] action create_if_missing (up to date) * execute[apt-get -q update] action run - execute apt-get -q update * apt_package[ruby] action install - install version 1:2.3.0+1 of package ruby * apt_package[dpkg-dev] action install - install version 1.18.4ubuntu1.2 of package dpkg-dev Recipe: packagecloud_test::deb * packagecloud_repo[computology_public_deb] action add * apt_package[wget] action install (up to date) * apt_package[apt-transport-https] action install (up to date) * apt_package[lsb-release] action install (up to date) * ohai[reload-lsb-computology_public_deb] action nothing (skipped due to action :nothing) * template[/etc/apt/sources.list.d/computology_public_deb.list] action create - create new file /etc/apt/sources.list.d/computology_public_deb.list - update content in file /etc/apt/sources.list.d/computology_public_deb.list from none to eaaef4 --- /etc/apt/sources.list.d/computology_public_deb.list 2017-06-14 07:50:49.530207904 +0000 +++ /etc/apt/sources.list.d/.chef-computology_public_deb20170614-1738-1yqiu0m.list 2017-06-14 07:50:49.530207904 +0000 @@ -1 +1,3 @@ +deb https://packagecloud.io/computology/packagecloud-cookbook-test-public/ubuntu xenial main +deb-src https://packagecloud.io/computology/packagecloud-cookbook-test-public/ubuntu xenial main - change mode from '' to '0644' * execute[apt-key-add-computology_public_deb] action run - execute wget --auth-no-challenge -qO - https://packagecloud.io/computology/packagecloud-cookbook-test-public/gpgkey | apt-key add - * execute[apt-get-update-computology_public_deb] action run - execute apt-get update -o Dir::Etc::sourcelist="sources.list.d/computology_public_deb.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" * execute[apt-key-add-computology_public_deb] action nothing (skipped due to action :nothing) * execute[apt-get-update-computology_public_deb] action nothing (skipped due to action :nothing) * apt_package[jake] action install - install version 1.0-5 of package jake * packagecloud_repo[computology_private] action add * apt_package[wget] action install (up to date) * apt_package[apt-transport-https] action install (up to date) * apt_package[lsb-release] action install (up to date) * ohai[reload-lsb-computology_private] action nothing (skipped due to action :nothing) * template[/etc/apt/sources.list.d/computology_private.list] action create - create new file /etc/apt/sources.list.d/computology_private.list - update content in file /etc/apt/sources.list.d/computology_private.list from none to 9bb1ff --- /etc/apt/sources.list.d/computology_private.list 2017-06-14 07:51:01.904391456 +0000 +++ /etc/apt/sources.list.d/.chef-computology_private20170614-1738-e7ibgc.list 2017-06-14 07:51:01.904391456 +0000 @@ -1 +1,3 @@ +deb https://ac296a2cfb563f1613621b05d48fa240f4c440d985dde0db:@packagecloud.io/computology/packagecloud-cookbook-test-private/ubuntu xenial main +deb-src https://ac296a2cfb563f1613621b05d48fa240f4c440d985dde0db:@packagecloud.io/computology/packagecloud-cookbook-test-private/ubuntu xenial main - change mode from '' to '0644' * execute[apt-key-add-computology_private] action run - execute wget --auth-no-challenge -qO - https://ac296a2cfb563f1613621b05d48fa240f4c440d985dde0db:@packagecloud.io/computology/packagecloud-cookbook-test-private/gpgkey | apt-key add - * execute[apt-get-update-computology_private] action run - execute apt-get update -o Dir::Etc::sourcelist="sources.list.d/computology_private.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" * execute[apt-key-add-computology_private] action nothing (skipped due to action :nothing) * execute[apt-get-update-computology_private] action nothing (skipped due to action :nothing) * apt_package[jake-doc] action install - install version 1.0-5 of package jake-doc * execute[install_jake_source] action run - execute apt-get source jake * packagecloud_repo[computology/packagecloud-test-packages] action add * apt_package[wget] action install (up to date) * apt_package[apt-transport-https] action install (up to date) * apt_package[lsb-release] action install (up to date) * ohai[reload-lsb-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) * template[/etc/apt/sources.list.d/computology_packagecloud-test-packages.list] action create - create new file /etc/apt/sources.list.d/computology_packagecloud-test-packages.list - update content in file /etc/apt/sources.list.d/computology_packagecloud-test-packages.list from none to f709f6 --- /etc/apt/sources.list.d/computology_packagecloud-test-packages.list 2017-06-14 07:51:17.079974906 +0000 +++ /etc/apt/sources.list.d/.chef-computology_packagecloud-test-packages20170614-1738-1pcbvsh.list 2017-06-14 07:51:17.079974906 +0000 @@ -1 +1,3 @@ +deb https://packagecloud.io/computology/packagecloud-test-packages/debian wheezy main +deb-src https://packagecloud.io/computology/packagecloud-test-packages/debian wheezy main - change mode from '' to '0644' * execute[apt-key-add-computology_packagecloud-test-packages] action run - execute wget --auth-no-challenge -qO - https://packagecloud.io/computology/packagecloud-test-packages/gpgkey | apt-key add - * execute[apt-get-update-computology_packagecloud-test-packages] action run - execute apt-get update -o Dir::Etc::sourcelist="sources.list.d/computology_packagecloud-test-packages.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" * execute[apt-key-add-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) * execute[apt-get-update-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) Recipe: packagecloud_test::rubygems_private * apt_update[] action periodic (up to date) * packagecloud_repo[computology/packagecloud-cookbook-test-private] action add * execute[install packagecloud computology/packagecloud-cookbook-test-private repo as gem source] action run - execute gem source --add https://ac296a2cfb563f1613621b05d48fa240f4c440d985dde0db:@packagecloud.io/computology/packagecloud-cookbook-test-private/ * gem_package[jakedotrb] action install[2017-06-14T07:51:25+00:00] WARN: failed to find gem jakedotrb (= 0.0.1) from [https://www.rubygems.org] - install version 0.0.1 of package jakedotrb Running handlers: Running handlers complete Chef Client finished, 22/44 resources updated in 01 minutes 37 seconds Finished converging (1m46.95s). -----> Setting up ... Finished setting up (0m0.00s). -----> Verifying ... Preparing files for transfer -----> Installing Busser (busser) Fetching: thor-0.19.0.gem (100%) Successfully installed thor-0.19.0 Fetching: busser-0.7.1.gem (100%) Successfully installed busser-0.7.1 2 gems installed Installing Busser plugins: busser-serverspec Plugin serverspec installed (version 0.5.10) -----> Running postinstall for serverspec plugin Suite path directory /tmp/verifier/suites does not exist, skipping. Transferring files to -----> Running serverspec test suite -----> Installing Serverspec.. Fetching: diff-lcs-1.3.gem (100%) Fetching: rspec-expectations-3.6.0.gem (100%) Fetching: rspec-mocks-3.6.0.gem (100%) Fetching: rspec-3.6.0.gem (100%) Fetching: rspec-its-1.2.0.gem (100%) Fetching: multi_json-1.12.1.gem (100%) Fetching: net-ssh-4.1.0.gem (100%) Fetching: net-scp-1.2.1.gem (100%) Fetching: net-telnet-0.1.1.gem (100%) Fetching: sfl-2.3.gem (100%) Fetching: specinfra-2.68.0.gem (100%) Fetching: serverspec-2.39.1.gem (100%) -----> serverspec installed (version 2.39.1) /opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec -I/tmp/verifier/gems/gems/rspec-support-3.6.0/lib:/tmp/verifier/gems/gems/rspec-core-3.6.0/lib /opt/chef/embedded/bin/rspec --pattern /tmp/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/verifier/suites/serverspec File "/etc/apt/sources.list.d/computology_packagecloud-test-packages.list" should exist content should eq "deb https://packagecloud.io/computology/packagecloud-test-packages/debian wheezy main\ndeb-src https://packagecloud.io/computology/packagecloud-test-packages/debian wheezy main\n" Command "ls /usr/local/bin/jake" exit_status should eq 0 Command "/usr/local/bin/jake" exit_status should eq 0 stdout should eq "as it so happens, jake douglas is a very nice young man.\n" Command "man jake" exit_status should eq 0 stdout should match /jake man page/ stdout should match /binary executable program/ stdout should match /No known bugs/ Command "ls /home/vagrant/jake_1.0-7.dsc" exit_status should eq 0 Command "ls /home/vagrant/jake_1.0.orig.tar.bz2" exit_status should eq 0 Command "ls /home/vagrant/jake_1.0-7.debian.tar.gz" exit_status should eq 0 Command "ls /usr/local/bin/jakedotrb" exit_status should eq 0 Command "/usr/local/bin/jakedotrb" exit_status should eq 0 stdout should match /jake douglas is a very nice young man./ Finished in 0.1257 seconds (files took 0.34297 seconds to load) 15 examples, 0 failures Finished verifying (0m11.92s). -----> Destroying ... ==> default: Forcing shutdown of VM... ==> default: Destroying VM and associated drives... Vagrant instance destroyed. Finished destroying (0m4.71s). Finished testing (2m39.13s). -----> Cleaning up any prior instances of -----> Destroying ... Finished destroying (0m0.00s). -----> Testing -----> Creating ... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'bento/centos-6.8'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'bento/centos-6.8' is up to date... ==> default: Setting the name of the VM: kitchen-packagecloud-cookbook-default-centos-68_default_1497426714841_36490 ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: default: Vagrant insecure key detected. Vagrant will automatically replace default: this with a newly generated keypair for better security. default: default: Inserting generated public key within guest... default: Removing insecure key from the guest if it's present... default: Key inserted! Disconnecting and reconnecting using new SSH key... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... ==> default: Setting hostname... ==> default: Mounting shared folders... default: /tmp/omnibus/cache => /Users/dmw/.kitchen/cache ==> default: Machine not provisioned because `--no-provision` is specified. [SSH] Established Vagrant instance created. Finished creating (0m45.09s). -----> Converging ... Preparing files for transfer Preparing dna.json Resolving cookbook dependencies with Berkshelf 6.0.1... Removing non-cookbook files before transfer Preparing validation.pem Preparing client.rb -----> Installing Chef Omnibus (install only if missing) Downloading https://omnitruck.chef.io/install.sh to file /tmp/install.sh Trying wget... Download complete. el 6 x86_64 Getting information for chef stable for el... downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=el&pv=6&m=x86_64 to file /tmp/install.sh.2870/metadata.txt trying wget... sha1 a165cae5ea416a32afc5646c5e0a9ac775bc7df4 sha256 31d3c8d09a884a10f93d58c9ead636cfb19b12c9ea6c8de1bb661918347c164d url https://packages.chef.io/files/stable/chef/13.1.31/el/6/chef-13.1.31-1.el6.x86_64.rpm version 13.1.31 downloaded metadata file looks valid... /tmp/omnibus/cache/chef-13.1.31-1.el6.x86_64.rpm already exists, verifiying checksum... Comparing checksum with sha256sum... checksum compare succeeded, using existing file! WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING You are installing an omnibus package without a version pin. If you are installing on production servers via an automated process this is DANGEROUS and you will be upgraded without warning on new releases, even to new major releases. Letting the version float is only appropriate in desktop, test, development or CI/CD environments. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Installing chef installing with rpm... warning: /tmp/omnibus/cache/chef-13.1.31-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY Preparing... ########################################### [100%] 1:chef ########################################### [100%] Thank you for installing Chef! Transferring files to Starting Chef Client, version 13.1.31 Creating a new client identity for default-centos-68 using the validator key. resolving cookbooks for run list: ["packagecloud_test::distro_deps", "packagecloud_test::rpm", "packagecloud_test::rubygems"] Synchronizing Cookbooks: - packagecloud_test (0.0.0) - yum (5.0.1) - packagecloud (0.3.0) Installing Cookbook Gems: Compiling Cookbooks... Converging 12 resources Recipe: packagecloud_test::distro_deps * apt_update[] action periodic (up to date) * yum_package[ruby] action install - install version 1.8.7.374-5.el6 of package ruby * yum_package[rubygems] action install - install version 1.3.7-5.el6 of package rubygems Recipe: packagecloud_test::rpm * packagecloud_repo[computology_public_rpm] action add * yum_package[pygpgme] action install (up to date) * log[pygpgme_warning] action write (skipped due to not_if) * ruby_block[disable repo_gpgcheck if no pygpgme] action run (skipped due to not_if) * template[/etc/yum.repos.d/computology_public_rpm.repo] action create - create new file /etc/yum.repos.d/computology_public_rpm.repo - update content in file /etc/yum.repos.d/computology_public_rpm.repo from none to f0ba3d --- /etc/yum.repos.d/computology_public_rpm.repo 2017-06-14 07:52:53.343663100 +0000 +++ /etc/yum.repos.d/.chef-computology_public_rpm20170614-2982-1irypsn.repo 2017-06-14 07:52:53.343663100 +0000 @@ -1 +1,11 @@ +[computology_public_rpm] +name=computology_public_rpm +baseurl=https://packagecloud.io/computology/packagecloud-cookbook-test-public/el/6/$basearch +repo_gpgcheck=1 +gpgcheck=0 +enabled=1 +gpgkey=https://packagecloud.io/computology/packagecloud-cookbook-test-public/gpgkey +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt +metadata_expire=300 - change mode from '' to '0644' - restore selinux security context * execute[yum-makecache-computology_public_rpm] action run - execute yum -q makecache -y --disablerepo=* --enablerepo=computology_public_rpm * ruby_block[yum-cache-reload-computology_public_rpm] action create - execute the ruby block yum-cache-reload-computology_public_rpm * execute[yum-makecache-computology_public_rpm] action nothing (skipped due to action :nothing) * ruby_block[yum-cache-reload-computology_public_rpm] action nothing (skipped due to action :nothing) * yum_package[jake] action install - install version 1.0-3.el6 of package jake * packagecloud_repo[computology/packagecloud-cookbook-test-private] action add * yum_package[pygpgme] action install (up to date) * log[pygpgme_warning] action write (skipped due to not_if) * ruby_block[disable repo_gpgcheck if no pygpgme] action run (skipped due to not_if) * template[/etc/yum.repos.d/computology_packagecloud-cookbook-test-private.repo] action create - create new file /etc/yum.repos.d/computology_packagecloud-cookbook-test-private.repo - update content in file /etc/yum.repos.d/computology_packagecloud-cookbook-test-private.repo from none to e078c5 --- /etc/yum.repos.d/computology_packagecloud-cookbook-test-private.repo 2017-06-14 07:53:02.489233596 +0000 +++ /etc/yum.repos.d/.chef-computology_packagecloud-cookbook-test-private20170614-2982-1gmhefp.repo 2017-06-14 07:53:02.489233596 +0000 @@ -1 +1,11 @@ +[computology_packagecloud-cookbook-test-private] +name=computology_packagecloud-cookbook-test-private +baseurl=https://e7c4daf76dc6a39d7f8dc571928a9c28d505903ec7291fc7:@packagecloud.io/computology/packagecloud-cookbook-test-private/el/6/$basearch +repo_gpgcheck=1 +gpgcheck=0 +enabled=1 +gpgkey=https://e7c4daf76dc6a39d7f8dc571928a9c28d505903ec7291fc7:@packagecloud.io/computology/packagecloud-cookbook-test-private/gpgkey +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt +metadata_expire=300 - change mode from '' to '0644' - restore selinux security context * execute[yum-makecache-computology_packagecloud-cookbook-test-private] action run - execute yum -q makecache -y --disablerepo=* --enablerepo=computology_packagecloud-cookbook-test-private * ruby_block[yum-cache-reload-computology_packagecloud-cookbook-test-private] action create - execute the ruby block yum-cache-reload-computology_packagecloud-cookbook-test-private * execute[yum-makecache-computology_packagecloud-cookbook-test-private] action nothing (skipped due to action :nothing) * ruby_block[yum-cache-reload-computology_packagecloud-cookbook-test-private] action nothing (skipped due to action :nothing) * yum_package[man] action install - install version 1.6f-39.el6 of package man * yum_package[jake-docs] action install - install version 1.0-3.el6 of package jake-docs * packagecloud_repo[computology/packagecloud-test-packages] action add * yum_package[pygpgme] action install (up to date) * log[pygpgme_warning] action write (skipped due to not_if) * ruby_block[disable repo_gpgcheck if no pygpgme] action run (skipped due to not_if) * template[/etc/yum.repos.d/computology_packagecloud-test-packages.repo] action create - create new file /etc/yum.repos.d/computology_packagecloud-test-packages.repo - update content in file /etc/yum.repos.d/computology_packagecloud-test-packages.repo from none to 98a771 --- /etc/yum.repos.d/computology_packagecloud-test-packages.repo 2017-06-14 07:53:13.183578095 +0000 +++ /etc/yum.repos.d/.chef-computology_packagecloud-test-packages20170614-2982-1oo22jq.repo 2017-06-14 07:53:13.183578095 +0000 @@ -1 +1,11 @@ +[computology_packagecloud-test-packages] +name=computology_packagecloud-test-packages +baseurl=https://packagecloud.io/computology/packagecloud-test-packages/el/6/$basearch +repo_gpgcheck=1 +gpgcheck=0 +enabled=1 +gpgkey=https://packagecloud.io/computology/packagecloud-test-packages/gpgkey +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt +metadata_expire=300 - change mode from '' to '0644' - restore selinux security context * execute[yum-makecache-computology_packagecloud-test-packages] action run - execute yum -q makecache -y --disablerepo=* --enablerepo=computology_packagecloud-test-packages * ruby_block[yum-cache-reload-computology_packagecloud-test-packages] action create - execute the ruby block yum-cache-reload-computology_packagecloud-test-packages * execute[yum-makecache-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) * ruby_block[yum-cache-reload-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) * yum_package[packagecloud-test] action install - install version 1.1-1 of package packagecloud-test Recipe: packagecloud_test::rubygems * packagecloud_repo[computology/packagecloud-cookbook-test-public] action add * execute[install packagecloud computology/packagecloud-cookbook-test-public repo as gem source] action run - execute gem source --add https://packagecloud.io/computology/packagecloud-cookbook-test-public/ * gem_package[jakedotrb] action install[2017-06-14T07:53:22+00:00] WARN: failed to find gem jakedotrb (= 0.0.1) from [https://www.rubygems.org] ================================================================================ Error executing action `install` on resource 'gem_package[jakedotrb]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Expected process to exit with [0], but received '2' ---- Begin output of /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin ---- STDOUT: STDERR: ERROR: Could not find a valid gem 'jakedotrb' (= 0.0.1) in any repository ---- End output of /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin ---- Ran /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin returned 2 Resource Declaration: --------------------- # In /tmp/kitchen/cache/cookbooks/packagecloud_test/recipes/rubygems.rb 5: gem_package 'jakedotrb' do 6: options '--bindir /usr/local/bin' 7: version '0.0.1' 8: end Compiled Resource: ------------------ # Declared in /tmp/kitchen/cache/cookbooks/packagecloud_test/recipes/rubygems.rb:5:in `from_file' gem_package("jakedotrb") do package_name "jakedotrb" action [:install] default_guard_interpreter :default declared_type :gem_package cookbook_name "packagecloud_test" recipe_name "rubygems" options "--bindir /usr/local/bin" version "0.0.1" gem_binary "/usr/bin/gem" end System Info: ------------ chef_version=13.1.31 platform=centos platform_version=6.8 ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] program_name=chef-client worker: ppid=2977;start=07:52:38; executable=/opt/chef/bin/chef-client Running handlers: [2017-06-14T07:53:28+00:00] ERROR: Running exception handlers [2017-06-14T07:53:28+00:00] ERROR: Running exception handlers Running handlers complete [2017-06-14T07:53:28+00:00] ERROR: Exception handlers complete [2017-06-14T07:53:28+00:00] ERROR: Exception handlers complete Chef Client failed. 20 resources updated in 50 seconds [2017-06-14T07:53:28+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out [2017-06-14T07:53:28+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out [2017-06-14T07:53:28+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2017-06-14T07:53:28+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2017-06-14T07:53:28+00:00] ERROR: gem_package[jakedotrb] (packagecloud_test::rubygems line 5) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2' ---- Begin output of /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin ---- STDOUT: STDERR: ERROR: Could not find a valid gem 'jakedotrb' (= 0.0.1) in any repository ---- End output of /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin ---- Ran /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin returned 2 [2017-06-14T07:53:28+00:00] ERROR: gem_package[jakedotrb] (packagecloud_test::rubygems line 5) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2' ---- Begin output of /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin ---- STDOUT: STDERR: ERROR: Could not find a valid gem 'jakedotrb' (= 0.0.1) in any repository ---- End output of /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin ---- Ran /usr/bin/gem install jakedotrb -q --no-rdoc --no-ri -v "0.0.1" --source=https://www.rubygems.org --bindir /usr/local/bin returned 2 [2017-06-14T07:53:28+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) [2017-06-14T07:53:28+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) -----> Cleaning up any prior instances of -----> Destroying ... Finished destroying (0m0.00s). -----> Testing -----> Creating ... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'bento/centos-7.3'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'bento/centos-7.3' is up to date... ==> default: A newer version of the box 'bento/centos-7.3' is available! You currently ==> default: have version '2.3.4'. The latest is version '2.3.5'. Run ==> default: `vagrant box update` to update. ==> default: Setting the name of the VM: kitchen-packagecloud-cookbook-default-centos-73_default_1497426820621_86993 ==> default: Fixed port collision for 22 => 2222. Now on port 2200. ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 (guest) => 2200 (host) (adapter 1) ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2200 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Remote connection disconnect. Retrying... default: Warning: Connection reset. Retrying... default: Warning: Remote connection disconnect. Retrying... default: Warning: Connection reset. Retrying... default: Warning: Remote connection disconnect. Retrying... default: default: Vagrant insecure key detected. Vagrant will automatically replace default: this with a newly generated keypair for better security. default: default: Inserting generated public key within guest... default: Removing insecure key from the guest if it's present... default: Key inserted! Disconnecting and reconnecting using new SSH key... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... ==> default: Setting hostname... ==> default: Mounting shared folders... default: /tmp/omnibus/cache => /Users/dmw/.kitchen/cache ==> default: Machine not provisioned because `--no-provision` is specified. [SSH] Established Vagrant instance created. Finished creating (0m43.32s). -----> Converging ... Preparing files for transfer Preparing dna.json Resolving cookbook dependencies with Berkshelf 6.0.1... Removing non-cookbook files before transfer Preparing validation.pem Preparing client.rb -----> Installing Chef Omnibus (install only if missing) Downloading https://omnitruck.chef.io/install.sh to file /tmp/install.sh Trying wget... Download complete. el 7 x86_64 Getting information for chef stable for el... downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=el&pv=7&m=x86_64 to file /tmp/install.sh.3985/metadata.txt trying wget... sha1 65c046c91a7186a28af9642e3cffcd72296cf602 sha256 b8397ea2a33a3f4c860daac1cb0714a11d8dad5287b0eb7054e8432d484f9f2c url https://packages.chef.io/files/stable/chef/13.1.31/el/7/chef-13.1.31-1.el7.x86_64.rpm version 13.1.31 downloaded metadata file looks valid... downloading https://packages.chef.io/files/stable/chef/13.1.31/el/7/chef-13.1.31-1.el7.x86_64.rpm to file /tmp/omnibus/cache/chef-13.1.31-1.el7.x86_64.rpm trying wget... Comparing checksum with sha256sum... WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING You are installing an omnibus package without a version pin. If you are installing on production servers via an automated process this is DANGEROUS and you will be upgraded without warning on new releases, even to new major releases. Letting the version float is only appropriate in desktop, test, development or CI/CD environments. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Installing chef installing with rpm... warning: /tmp/omnibus/cache/chef-13.1.31-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY Preparing... ################################# [100%] Updating / installing... 1:chef-13.1.31-1.el7 ################################# [100%] Thank you for installing Chef! Transferring files to Starting Chef Client, version 13.1.31 Creating a new client identity for default-centos-73 using the validator key. resolving cookbooks for run list: ["packagecloud_test::distro_deps", "packagecloud_test::rpm", "packagecloud_test::rubygems_private"] Synchronizing Cookbooks: - packagecloud_test (0.0.0) - packagecloud (0.3.0) - yum (5.0.1) Installing Cookbook Gems: Compiling Cookbooks... Converging 13 resources Recipe: packagecloud_test::distro_deps * apt_update[] action periodic (up to date) * yum_package[ruby] action install - install version 2.0.0.648-29.el7 of package ruby * yum_package[rubygems] action install (up to date) Recipe: packagecloud_test::rpm * packagecloud_repo[computology_public_rpm] action add * yum_package[pygpgme] action install (up to date) * log[pygpgme_warning] action write (skipped due to not_if) * ruby_block[disable repo_gpgcheck if no pygpgme] action run (skipped due to not_if) * template[/etc/yum.repos.d/computology_public_rpm.repo] action create - create new file /etc/yum.repos.d/computology_public_rpm.repo - update content in file /etc/yum.repos.d/computology_public_rpm.repo from none to 9b3db8 --- /etc/yum.repos.d/computology_public_rpm.repo 2017-06-14 07:54:45.694035827 +0000 +++ /etc/yum.repos.d/.chef-computology_public_rpm20170614-4126-r7uses.repo 2017-06-14 07:54:45.694035827 +0000 @@ -1 +1,11 @@ +[computology_public_rpm] +name=computology_public_rpm +baseurl=https://packagecloud.io/computology/packagecloud-cookbook-test-public/el/7/$basearch +repo_gpgcheck=1 +gpgcheck=0 +enabled=1 +gpgkey=https://packagecloud.io/computology/packagecloud-cookbook-test-public/gpgkey +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt +metadata_expire=300 - change mode from '' to '0644' - restore selinux security context * execute[yum-makecache-computology_public_rpm] action run - execute yum -q makecache -y --disablerepo=* --enablerepo=computology_public_rpm * ruby_block[yum-cache-reload-computology_public_rpm] action create - execute the ruby block yum-cache-reload-computology_public_rpm * execute[yum-makecache-computology_public_rpm] action nothing (skipped due to action :nothing) * ruby_block[yum-cache-reload-computology_public_rpm] action nothing (skipped due to action :nothing) * yum_package[jake] action install - install version 1.0-3.el6 of package jake * packagecloud_repo[computology/packagecloud-cookbook-test-private] action add * yum_package[pygpgme] action install (up to date) * log[pygpgme_warning] action write (skipped due to not_if) * ruby_block[disable repo_gpgcheck if no pygpgme] action run (skipped due to not_if) * template[/etc/yum.repos.d/computology_packagecloud-cookbook-test-private.repo] action create - create new file /etc/yum.repos.d/computology_packagecloud-cookbook-test-private.repo - update content in file /etc/yum.repos.d/computology_packagecloud-cookbook-test-private.repo from none to 0b594d --- /etc/yum.repos.d/computology_packagecloud-cookbook-test-private.repo 2017-06-14 07:54:56.357446172 +0000 +++ /etc/yum.repos.d/.chef-computology_packagecloud-cookbook-test-private20170614-4126-1mgode8.repo 2017-06-14 07:54:56.357446172 +0000 @@ -1 +1,11 @@ +[computology_packagecloud-cookbook-test-private] +name=computology_packagecloud-cookbook-test-private +baseurl=https://ed63533cccc7acfeda9cc6a7b399f8619406ea2f3984469c:@packagecloud.io/computology/packagecloud-cookbook-test-private/el/7/$basearch +repo_gpgcheck=1 +gpgcheck=0 +enabled=1 +gpgkey=https://ed63533cccc7acfeda9cc6a7b399f8619406ea2f3984469c:@packagecloud.io/computology/packagecloud-cookbook-test-private/gpgkey +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt +metadata_expire=300 - change mode from '' to '0644' - restore selinux security context * execute[yum-makecache-computology_packagecloud-cookbook-test-private] action run - execute yum -q makecache -y --disablerepo=* --enablerepo=computology_packagecloud-cookbook-test-private * ruby_block[yum-cache-reload-computology_packagecloud-cookbook-test-private] action create - execute the ruby block yum-cache-reload-computology_packagecloud-cookbook-test-private * execute[yum-makecache-computology_packagecloud-cookbook-test-private] action nothing (skipped due to action :nothing) * ruby_block[yum-cache-reload-computology_packagecloud-cookbook-test-private] action nothing (skipped due to action :nothing) * yum_package[man] action install (up to date) * yum_package[jake-docs] action install - install version 1.0-3.el6 of package jake-docs * packagecloud_repo[computology/packagecloud-test-packages] action add * yum_package[pygpgme] action install (up to date) * log[pygpgme_warning] action write (skipped due to not_if) * ruby_block[disable repo_gpgcheck if no pygpgme] action run (skipped due to not_if) * template[/etc/yum.repos.d/computology_packagecloud-test-packages.repo] action create - create new file /etc/yum.repos.d/computology_packagecloud-test-packages.repo - update content in file /etc/yum.repos.d/computology_packagecloud-test-packages.repo from none to 98a771 --- /etc/yum.repos.d/computology_packagecloud-test-packages.repo 2017-06-14 07:55:07.117814599 +0000 +++ /etc/yum.repos.d/.chef-computology_packagecloud-test-packages20170614-4126-f25zzc.repo 2017-06-14 07:55:07.117814599 +0000 @@ -1 +1,11 @@ +[computology_packagecloud-test-packages] +name=computology_packagecloud-test-packages +baseurl=https://packagecloud.io/computology/packagecloud-test-packages/el/6/$basearch +repo_gpgcheck=1 +gpgcheck=0 +enabled=1 +gpgkey=https://packagecloud.io/computology/packagecloud-test-packages/gpgkey +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt +metadata_expire=300 - change mode from '' to '0644' - restore selinux security context * execute[yum-makecache-computology_packagecloud-test-packages] action run - execute yum -q makecache -y --disablerepo=* --enablerepo=computology_packagecloud-test-packages * ruby_block[yum-cache-reload-computology_packagecloud-test-packages] action create - execute the ruby block yum-cache-reload-computology_packagecloud-test-packages * execute[yum-makecache-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) * ruby_block[yum-cache-reload-computology_packagecloud-test-packages] action nothing (skipped due to action :nothing) * yum_package[packagecloud-test] action install - install version 1.1-1 of package packagecloud-test Recipe: packagecloud_test::rubygems_private * apt_update[] action periodic (up to date) * packagecloud_repo[computology/packagecloud-cookbook-test-private] action add * execute[install packagecloud computology/packagecloud-cookbook-test-private repo as gem source] action run - execute gem source --add https://ed63533cccc7acfeda9cc6a7b399f8619406ea2f3984469c:@packagecloud.io/computology/packagecloud-cookbook-test-private/ * gem_package[jakedotrb] action install[2017-06-14T07:55:18+00:00] WARN: failed to find gem jakedotrb (= 0.0.1) from [https://www.rubygems.org] - install version 0.0.1 of package jakedotrb Running handlers: Running handlers complete Chef Client finished, 19/38 resources updated in 58 seconds Finished converging (1m13.25s). -----> Setting up ... Finished setting up (0m0.00s). -----> Verifying ... Preparing files for transfer -----> Installing Busser (busser) Fetching: thor-0.19.0.gem (100%) Successfully installed thor-0.19.0 Fetching: busser-0.7.1.gem (100%) Successfully installed busser-0.7.1 2 gems installed Installing Busser plugins: busser-serverspec Plugin serverspec installed (version 0.5.10) -----> Running postinstall for serverspec plugin Suite path directory /tmp/verifier/suites does not exist, skipping. Transferring files to -----> Running serverspec test suite -----> Installing Serverspec.. Fetching: diff-lcs-1.3.gem (100%) Fetching: rspec-expectations-3.6.0.gem (100%) Fetching: rspec-mocks-3.6.0.gem (100%) Fetching: rspec-3.6.0.gem (100%) Fetching: rspec-its-1.2.0.gem (100%) Fetching: multi_json-1.12.1.gem (100%) Fetching: net-ssh-4.1.0.gem (100%) Fetching: net-scp-1.2.1.gem (100%) Fetching: net-telnet-0.1.1.gem (100%) Fetching: sfl-2.3.gem (100%) Fetching: specinfra-2.68.0.gem (100%) Fetching: serverspec-2.39.1.gem (100%) -----> serverspec installed (version 2.39.1) /opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec -I/tmp/verifier/gems/gems/rspec-support-3.6.0/lib:/tmp/verifier/gems/gems/rspec-core-3.6.0/lib /opt/chef/embedded/bin/rspec --pattern /tmp/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/verifier/suites/serverspec Command "ls /usr/local/bin/jake" exit_status should eq 0 Command "/usr/local/bin/jake" exit_status should eq 0 stdout should eq "as it so happens, jake douglas is a very nice young man.\n" Command "man jake" exit_status should eq 0 stdout should match /jake man page/ stdout should match /binary executable program/ stdout should match /No known bugs/ Command "ls /usr/local/bin/jakedotrb" exit_status should eq 0 Command "/usr/local/bin/jakedotrb" exit_status should eq 0 stdout should match /jake douglas is a very nice young man./ Finished in 0.1011 seconds (files took 0.29465 seconds to load) 10 examples, 0 failures Finished verifying (0m10.77s). -----> Destroying ... ==> default: Forcing shutdown of VM... ==> default: Destroying VM and associated drives... Vagrant instance destroyed. Finished destroying (0m4.69s). Finished testing (2m12.05s).
damacus commented 7 years ago

Hi @ice799 any update on this one please?

martinisoft commented 7 years ago

I'd like to see an update about this PR as well. I'm about to submit a separate one which is based off master to make this a Chef 12.6+ based cookbook.

tas50 commented 7 years ago

@ice799 I updated the test recipe to specify the rubygems source with the install, which is required with Chef 13. I also added kitchen runs against Chef 12.1 and the latest release on centos 6/7 and ubuntu 14.04/16.04. Passing Travis tests now should give a pretty high degree of confidence. Let me know if there's anything else you need to get this merged/released?

ice799 commented 7 years ago

Hi:

Some initial feedback:

  1. I can't seem to run the kitchen tests. I get this error:
       ArgumentError
       -------------
       Cannot specify both default and name_property/name_attribute together on property path of resource yum_globalconfig

Which seems to be due to:

        76>> attribute :path, :kind_of => String, :regex => /.*/, :default => nil, :name_attribute => true

The SHA on the tree with which I am testing is: 8a7b55cf831b00fe09e9954fcdb132a322410ebe1.

  1. This looks like support is dropped for CentOS 5. Unfortunately, we cannot drop support for CentOS 5, so the tests which use CentOS 5 need to be re-enabled.
  2. This looks like support is dropped for Ubuntu 12.04. Unfortunately, we cannot drop support for Ubuntu 12.04, so the tests which use Ubuntu 12.04 need to be re-enabled.
tas50 commented 7 years ago

I've added back Test Kitchen CentOS 5 / Ubuntu 12.04 testing. The yum error your getting is due to an old version of yum on your local system. You should be able to run berks update to resolve that.

Here's the latest release: https://github.com/chef-cookbooks/yum/blob/master/resources/globalconfig.rb#L73

ice799 commented 7 years ago

Hi @tas50. I've updated and re-run the tests. All tests pass for Ubuntu 12.04 - 16.04. Unfortuantely, the tests for CentOS 5.11 seem to fail with the following error for me:

       ---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----
       STDOUT: [option installonlypkgs] kernel kernel-bigmem kernel-enterprise kernel-smp kernel-modules kernel-debug kernel-unsupported kernel-source kernel-devel kernel-PAE kernel-PAE-debug
       YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
        Eg. Invalid release/
       removing mirrorlist with no valid mirrors: /var/cache/yum/base/mirrorlist.txt
       STDERR: yum-dump Repository Error: Cannot find a valid baseurl for repo: base
       ---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----
       Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 returned 1

I haven't had a chance to debug it yet, but wanted to update this thread.

tas50 commented 7 years ago

It appears that the docker centos 5 box hasn't been updated since they archived the mirrors. I'll see if I can get that working locally

tas50 commented 7 years ago

@ice799 Can you try running the centos 5 test again. I've updated the docker image for centos5 to fix the repos.

martinisoft commented 7 years ago

I've closed my PR in favor of this one as a small step forward to modernizing this cookbook. A better pattern down the road will be to separate each of the package providers into their own platform based provider (rpm, apt, etc) so the code isn't so complex in terms of platform detection.

martinisoft commented 7 years ago

Where are we with this change set?

tas50 commented 6 years ago

@ice799 Any objections with this now? CentOS 5 testing in Travis is a no go due to networking issues in the centos-5 container. I have it working and passing for the RPM stuff in Vagrant. The Ruby stuff doesn't work since gem is so old on CentOS 5 that it doesn't support source so the entire resource doesn't work there. I'd update gem, but Ruby is so old there that it doesn't support the rubygems updater. Old and old.

mburns commented 6 years ago

bump. Is there any chance we can get this merged and cut a new version?

martinisoft commented 6 years ago

I emailed @ice799 to have him look at this PR again. If it can't be merged then we'll probably create our own internal implementation and eventually phase out this cookbook. Don't see the hold up here to hang on to one VERY old platform which is most likely not in use. Chef 14's release this April will start a timer for us phasing out this cookbook if even this PR cannot be merged in time. 😢

grv87 commented 6 years ago

@martinisoft, please don't create own internal implementation and create open fork instead.

ice799 commented 6 years ago

@tas50

The code as-is currently fails when I run kitchen test, but I was able to get the CentOS 5 tests working by making a few small changes. It seems that the newer version of chef broke gem_package for CentOS 5 so I simply shell out to gem install in the CentOS 5 case and everything works as expected.

I tried to push a commit to your branch on your repo (https://help.github.com/articles/committing-changes-to-a-pull-request-branch-created-from-a-fork/), but I think perhaps changes may not be allowed (https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/).

Here's a diff I created that should apply cleanly to your branch: https://gist.github.com/ice799/49bef10a9b5915d60f5cb8678589e05a

When I apply this diff and run kitchen test all tests succeed -- if you want to apply this diff and verify it works for you and push it up, I think we can probably merge this after that.

Sorry for the pain around CentOS 5 -- we have a considerable number of customers using CentOS 5 so we need to continue supporting it for now.

martinisoft commented 6 years ago

If CentOS 5 support is such a sticking point then I'd propose this PR mark a breaking version number to allow you to move forward. Fixes for that platform could be backported if needed to matching version numbers there.

This breaking version would have to be Chef 12.7+ and would break support for CentOS 5. Food for thought is that CentOS 5 isn't officially supported by Chef anymore so it's fair to break it here and move on as the Chef community has right now. Chef 12 support will also be EOL as of April 30th of this year.

This proposal work for you @ice799 ?

ice799 commented 6 years ago

@martinisoft I'll merge once the tests pass. The tests do not currently pass when you run kitchen test on this branch because the CentOS 5 tests run and fail on this branch without my patch. My proposed patch to this branch fixes the tests and makes this mergeable.

tas50 commented 6 years ago

@ice799 'Allow edits from maintainers.' is enabled so you should be able to continue to work on this PR.

tas50 commented 6 years ago

@ice799 The PR is passing now