Skip to content

Commit

Permalink
Added automate tag in spec.
Browse files Browse the repository at this point in the history
Signed-off-by: sreepuramsudheer <ssudheer@progress.com>
  • Loading branch information
sreepuramsudheer committed Oct 24, 2024
1 parent 176467e commit 85bf6ee
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions .expeditor/automate_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CA

git clone https://github.com/chef/automate.git
cd automate
git checkout ssudheer/cs_license_test

RESOLVED_RESULTS_DIR=$(realpath results/)
export DO_CHECK=true
Expand Down
11 changes: 10 additions & 1 deletion .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ steps:
A2_LICENSE:
path: secret/a2/license
field: license
A2_EXPIRED_LICENSE:
path: secret/a2/license
field: expLicense

- label: "chef server only"
command:
Expand All @@ -236,6 +239,9 @@ steps:
A2_LICENSE:
path: secret/a2/license
field: license
A2_EXPIRED_LICENSE:
path: secret/a2/license
field: expLicense

- label: "ha chef server"
command:
Expand All @@ -249,4 +255,7 @@ steps:
secrets:
A2_LICENSE:
path: secret/a2/license
field: license
field: license
A2_EXPIRED_LICENSE:
path: secret/a2/license
field: expLicense
23 changes: 16 additions & 7 deletions oc-chef-pedant/spec/api/server_license_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
require 'pedant/rspec/common'

describe "server licence testing", :license do
describe "server license testing", :license do

# Pedant has configurable test users.
# Selects Pedant users that are marked as associated
Expand All @@ -24,30 +24,39 @@
}
end

context "when having valid licence" do
it "can get all users" do
context "when having valid license" do
it "can get all users", automate: true do
get(request_url, platform.superuser).should look_like({
:status => 200,
:body => users_body
})
end

it "can get status" do
it "can get status", automate: true do
get(status_url, platform.superuser).should look_like({
:status => 200
})
end
end

# context "failure case", automate: true do
context "failure case" do
it "returns 403" do
context "when not having valid license" do
before(:all) do
system("chef-automate license apply \"$A2_EXPIRED_LICENSE\"")
system("sleep 30")
end
after(:all) do
system("chef-automate license apply \"$A2_LICENSE\"")
system("sleep 30")
end

it "returns 403", automate: true do
puts get(request_url, platform.superuser)
get(request_url, platform.superuser).should look_like({
:status => 403
})
end
it "can get status" do
it "can get status", automate: true do
get(status_url, platform.superuser).should look_like({
:status => 200
})
Expand Down

0 comments on commit 85bf6ee

Please sign in to comment.