Skip to content
This repository has been archived by the owner on Aug 8, 2022. It is now read-only.

[dex] Add inspec tests and update documentation #2

Merged
merged 4 commits into from
Aug 27, 2020

Conversation

gavindidrichsen
Copy link
Contributor

Since dex is a habitat service, then in azuredevops it should be built, exported, and tested in docker. Summary of features here:

All inspec tests are passing in local docker export:

hab pkg exec chef/inspec inspec exec /src/dex/. --chef-license=accept -t docker://core_dex --input-file /src/dex/attributes.yml.studio.yml

Profile: Habitat Core Plan dex (dex)
Version: 0.1.0
Target:  docker://62618a57e65a3c966d3ae50f644e3bd11d8e10bcc03932c6cee7202659622d25

  ✔  core-plans-dex-works: Ensure dex works as expected
     ✔  Command: `hab pkg path core/dex` exit_status is expected to eq 0
     ✔  Command: `hab pkg path core/dex` stdout is expected not to be empty
     ✔  Command: `hab pkg path core/dex` stderr is expected to be empty
     ✔  Command: `/hab/pkgs/core/dex/2.24.0/20200825161933/bin/dex version` exit_status is expected to eq 0
     ✔  Command: `/hab/pkgs/core/dex/2.24.0/20200825161933/bin/dex version` stdout is expected not to be empty
     ✔  Command: `/hab/pkgs/core/dex/2.24.0/20200825161933/bin/dex version` stdout is expected to match /dex Version:\s+v2.24.0/
     ✔  Command: `/hab/pkgs/core/dex/2.24.0/20200825161933/bin/dex version` stderr is expected to be empty
  ✔  core-plans-dex-exists: Ensure dex exists
     ✔  Command: `hab pkg path core/dex` exit_status is expected to eq 0
     ✔  Command: `hab pkg path core/dex` stdout is expected not to be empty
     ✔  Command: `hab pkg path core/dex` stderr is expected to be empty
     ✔  File /hab/pkgs/core/dex/2.24.0/20200825161933/bin/dex is expected to exist
     ✔  File /hab/pkgs/core/dex/2.24.0/20200825161933/bin/dex is expected to be executable
  ✔  core-plans-dex-habservice-works: Ensure dex habitat service works as expected
     ✔  Command: `hab pkg path core/dex` exit_status is expected to eq 0
     ✔  Command: `hab pkg path core/dex` stdout is expected not to be empty
     ✔  Command: `hab pkg path core/dex` stderr is expected to be empty
     ✔  Command: `hab svc status` exit_status is expected to eq 0
     ✔  Command: `hab svc status` stdout is expected not to be empty
     ✔  Command: `hab svc status` stdout is expected to match /(?<package>core\/dex\/2.24.0\/20200825161933)\s+(?<type>standalone)\s+(?<desired>up)\s+(?<state>up)/
     ✔  Command: `hab svc status` stderr is expected to be empty
     ✔  Command: `hab pkg path core/busybox-static` exit_status is expected to eq 0
     ✔  Command: `hab pkg path core/busybox-static` stdout is expected not to be empty
     ✔  Command: `hab pkg path core/busybox-static` stderr is expected to be empty
     ✔  Command: `/hab/pkgs/core/busybox-static/1.31.0/20200306011713/bin/netstat -peanut` exit_status is expected to eq 0
     ✔  Command: `/hab/pkgs/core/busybox-static/1.31.0/20200306011713/bin/netstat -peanut` stdout is expected not to be empty
     ✔  Command: `/hab/pkgs/core/busybox-static/1.31.0/20200306011713/bin/netstat -peanut` stdout is expected to match /:(?<port>5556).*LISTEN\s+(?<program>-|\d+\/dex)/
     ✔  Command: `/hab/pkgs/core/busybox-static/1.31.0/20200306011713/bin/netstat -peanut` stderr is expected to be empty


Profile Summary: 3 successful controls, 0 control failures, 0 controls skipped
Test Summary: 26 successful, 0 failures, 0 skipped
+ set +x
[7][default:/src/dex:0]# 

Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
export this as docker since dex is a habitat service

Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
@gavindidrichsen gavindidrichsen requested a review from a team as a code owner August 26, 2020 11:20
Copy link

@davymcaleer davymcaleer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@davymcaleer davymcaleer merged commit 4c1315c into master Aug 27, 2020
@davymcaleer davymcaleer deleted the gavindidrichsen/master/pr/add_to_organization branch August 27, 2020 08:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants