github.com/go-chef/chef@v0.30.1/test_chef_server/test/integration/default/inspec/clientkeys_spec.rb (about)

     1  # Inspec tests for the client chef api go module
     2  #
     3  
     4  describe command('/go/src/github.com/go-chef/chef/testapi/bin/clientkeys') do
     5    its('stderr') { should_not match(/error|no such file|cannot find|not used|undefined/) }
     6    its('stderr') do
     7      should match(%r{Error displaying key detail GET https://testhost/organizations/test/clients/clnt1/keys/default: 404})
     8    end
     9    its('stdout') do
    10      should match(%r{^List initial client clnt1 keys \[\{Name:default Uri:https://testhost/organizations/test/clients/clnt1/keys/default Expired:false\}\]})
    11    end
    12    its('stdout') { should match(/^List initial client clnt3 keys \[\]/) }
    13    its('stdout') do
    14      should match(%r{^Add clnt1 key \{Name: Uri:https://testhost/organizations/test/clients/clnt1/keys/newkey Expired:false\}})
    15    end
    16    its('stdout') { should match(/^List after add clnt1 keys \[\{(?=.*newkey)(?=.*default).*\}\]/) }
    17    its('stdout') do
    18      should match(%r{^Add clnt3 key \{Name: Uri:https://testhost/organizations/test/clients/clnt3/keys/default Expired:false\}})
    19    end
    20    its('stdout') { should match(/^List after add clnt3 keys \[\{(?=.*default).*\}\]/) }
    21    its('stdout') { should match(/^Key detail clnt1 default \{Name:default/) }
    22    its('stdout') { should match(/^Key update output clnt1 default \{Name:default .*N0AIhUh7Fw1\+gQtR\+.*\}/) }
    23    its('stdout') { should match(/^Updated key detail clnt1 default \{Name:default .*N0AIhUh7Fw1\+gQtR\+.*\}/) }
    24    its('stdout') { should match(/^List delete result clnt1 keys \{Name:default .*N0AIhUh7Fw1\+gQtR\+.*\}/) }
    25  end