Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TRACKER] Chef Workstation 2020 Testing - test-kitchen with kitchen-digitalocean #1204

Closed
kvivek1115 opened this issue May 16, 2020 · 7 comments
Assignees
Labels

Comments

@kvivek1115
Copy link

kvivek1115 commented May 16, 2020

Description

  • Setup the latest current channel chef-workstation.
  • Verify functionality and leave a comment for the results of the command

Parent task

#1167

Reference

https://github.com/test-kitchen/kitchen-digitalocean

Chef Workstation Version

Platform Version

Ubuntu 16.04

Aha! Link: https://chef.aha.io/features/SH-1935

@kvivek1115 kvivek1115 added Aspect: Testing Does the project have good coverage, and is CI working? Status: Sustaining Backlog An issue ideal for the Sustaining Engineering team (or anyone else if they want to adopt it). labels May 16, 2020
@kvivek1115 kvivek1115 self-assigned this May 16, 2020
@kvivek1115
Copy link
Author

Vagrant Ubuntu 16.04(Workstation)

Vagrant.configure(2) do |config|
  config.vm.box = "bento/ubuntu-16.04"
  config.vm.hostname = 'chef-workstation-app'
  config.vm.network 'private_network', ip: '192.168.33.50'
  config.vm.provision "shell", inline: <<-SHELL
    echo 192.168.33.50 chef-workstation-app | sudo tee -a /etc/hosts
  SHELL
end

Install Chef-Workstation:

  • wget https://packages.chef.io/files/current/chef-workstation/20.5.35/ubuntu/16.04/chef-workstation_20.5.35-1_amd64.deb

  • sudo dpkg -i chef-workstation_20.5.35-1_amd64.deb

Clone lean_chef_apache2 cookbook

  • mkdir cookbooks
  • cd cookbooks/
  • git clone [email protected]:learn-chef/learn_chef_apache2.git
  • sudo vi .kitchen.yml

@kvivek1115
Copy link
Author

Case1:

  • .kitchen.yml
---
driver:
  name: digitalocean
  tags:
    - test-kitchen
    - [email protected]
    - Vivek Singh
platforms:
  - name: ubuntu-16
  - name: ubuntu-18
  - name: debian-10
  - name: centos-8

provisioner:
  name: chef_zero
  chef_license: accept
suites:
  - name: default
    run_list:
      - recipe[learn_chef_apache2::default]
    verifier:
      inspec_tests:
        - test/smoke/default
    attributes:

> kitchen list

Instance           Driver        Provisioner  Verifier  Transport  Last Action  Last Error
default-ubuntu-16  Digitalocean  ChefZero     Busser    Ssh        Converged    <None>
default-ubuntu-18  Digitalocean  ChefZero     Busser    Ssh        Converged    <None>
default-debian-10  Digitalocean  ChefZero     Busser    Ssh        Converged    <None>
default-centos-8   Digitalocean  ChefZero     Busser    Ssh        Created      Kitchen::ActionFailed

Results: All passes with recipes related failures in centos-8.

  • Converge logs:
kitchen converge
-----> Starting Test Kitchen (v2.5.0)
-----> Converging <default-ubuntu-16>...
$$$$$$ Running legacy converge for 'Digitalocean' Driver
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 7.0.10...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
-----> Installing Chef install only if missing package
       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.1940/metadata.txt
       trying wget...
       sha1	53f187ff85678c9504731827147d638a0ab120b1
       sha256	9995a251dc82298a7badc19e881cd3b1c55f7be8fdbe09691170c000b61ec0e2
       url	https://packages.chef.io/files/stable/chef/16.1.0/ubuntu/16.04/chef_16.1.0-1_amd64.deb
       version	16.1.0
       downloaded metadata file looks valid...
       downloading https://packages.chef.io/files/stable/chef/16.1.0/ubuntu/16.04/chef_16.1.0-1_amd64.deb
         to file /tmp/install.sh.1940/chef_16.1.0-1_amd64.deb
       trying wget...
       Comparing checksum with sha256sum...
       
       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
       
       You are installing a 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 ... 54565 files and directories currently installed.)
       Preparing to unpack .../chef_16.1.0-1_amd64.deb ...
       Unpacking chef (16.1.0-1) ...
       Setting up chef (16.1.0-1) ...
       Thank you for installing Chef Infra Client! For help getting started visit https://learn.chef.io
       Transferring files to <default-ubuntu-16>
       +---------------------------------------------+
       ✔ 2 product licenses accepted.
       +---------------------------------------------+
       Starting Chef Infra Client, version 16.1.0
       Creating a new client identity for default-ubuntu-16 using the validator key.
       resolving cookbooks for run list: ["learn_chef_apache2::default"]

       Running handlers:
       Running handlers complete
       Chef Infra Client finished, 4/9 resources updated in 19 seconds
       Downloading files from <default-ubuntu-16>
       Finished converging <default-ubuntu-16> (1m4.14s).

@kvivek1115
Copy link
Author

Case 2:

  • .kitchen.yml
---
driver:
  name: digitalocean
  tags:
    - test-kitchen
    - [email protected]
    - Vivek Singh
platforms:
  - name: coreos-stable
  - name: coreos-beta
  - name: coreos-alpha
  - name: debian-7
  - name: fedora-27
  - name: fedora-28
  - name: fedora-29
  - name: freebsd-11.2
  - name: freebsd-11.1
  - name: freebsd-11.0
  - name: freebsd-10.4
  - name: freebsd-10.3
  - name: ubuntu-14
  - name: ubuntu-17
  - name: ubuntu-19

provisioner:
  name: chef_zero
  chef_license: accept
suites:
  - name: default
    run_list:
      - recipe[learn_chef_apache2::default]
> kitchen list
Instance               Driver        Provisioner  Verifier  Transport  Last Action    Last Error
default-coreos-stable  Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-coreos-beta    Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-coreos-alpha   Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-debian-7       Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-fedora-27      Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-fedora-28      Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-fedora-29      Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-freebsd-112    Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-freebsd-111    Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-freebsd-110    Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-freebsd-104    Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-freebsd-103    Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-ubuntu-14      Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-ubuntu-17      Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate
default-ubuntu-19      Digitalocean  ChefZero     Busser    Ssh        <Not Created>  DropletKit::FailedCreate

Results: Converge failed due to unsupported digital ocean images

Note:

@kvivek1115
Copy link
Author

kvivek1115 commented May 16, 2020

Reported Issue: test-kitchen/kitchen-digitalocean#76
PR: test-kitchen/kitchen-digitalocean#77

@btm Please have a look and let's know further if anything missing from my side?

Thanks!

@btm
Copy link
Contributor

btm commented May 17, 2020

test-kitchen/kitchen-digitalocean#77 was merged, it should be released in the next day and then we can pull it in to workstation.

@kvivek1115
Copy link
Author

@btm I have tested with the latest kitchen-digitalocean gem by manually installing using chef exec gem install kitchen-digitalocean

> chef exec gem install kitchen-digitalocean
Fetching kitchen-digitalocean-0.11.0.gem
Successfully installed kitchen-digitalocean-0.11.0
1 gem installed

console log:

kitchen create
-----> Starting Test Kitchen (v2.5.1)
-----> Creating <default-ubuntu-20>...
       DigitalOcean instance <192857356> created.
       Waiting for SSH service on 157.245.241.90:22, retrying in 3 seconds
       Waiting for SSH service on 157.245.241.90:22, retrying in 3 seconds
       Waiting for SSH service on 157.245.241.90:22, retrying in 3 seconds
       [SSH] Established
       (ssh ready)

       Finished creating <default-ubuntu-20> (0m50.45s).
-----> Test Kitchen is finished. (0m54.25s)

and created ubuntu-20 seems all working fine.

@kvivek1115
Copy link
Author

All looks good at my end closing this for now.

@jonsmorrow jonsmorrow added Epic and removed Aspect: Testing Does the project have good coverage, and is CI working? Status: Sustaining Backlog An issue ideal for the Sustaining Engineering team (or anyone else if they want to adopt it). labels Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants