Skip to content

Conversation

@talktovikas
Copy link
Member

@talktovikas talktovikas commented Nov 8, 2024

Description

This PR contains tests for chef-server inside Automate.
If the license of Automate is expired, then the requests for CS should return 403.
Also this will not impact the standalone CS.

[Please describe what this change achieves]

Issues Resolved

[List any existing issues this PR resolves, or any Discourse or
StackOverflow discussions that are relevant]

Check List

@talktovikas talktovikas requested review from a team as code owners November 8, 2024 10:06
@netlify
Copy link

netlify bot commented Nov 8, 2024

👷 Deploy Preview for chef-server processing.

Name Link
🔨 Latest commit 689772e
🔍 Latest deploy log https://app.netlify.com/sites/chef-server/deploys/6734d8373fccb6000816a2c2

@talktovikas talktovikas changed the title Pedant test for the case if automate license is expired WIP |Pedant test for the case if automate license is expired Nov 8, 2024
@talktovikas talktovikas changed the title WIP |Pedant test for the case if automate license is expired WIP | Pedant test for the case if automate license is expired Nov 8, 2024
@talktovikas talktovikas force-pushed the vikas/pedant_case_for_expired branch from 97bbc7e to bb3385d Compare November 8, 2024 22:21
@talktovikas talktovikas changed the title WIP | Pedant test for the case if automate license is expired Pedant test for the case if automate license is expired Nov 9, 2024
git clone https://github.com/chef/automate.git
cd automate
git checkout kalroy/cs_plan_changes
echo $(git branch)
Copy link
Contributor

Choose a reason for hiding this comment

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

--

end

context "when having valid license" do
it "can get all users", :smoke do
Copy link
Contributor

Choose a reason for hiding this comment

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

Better description in it

:status => 403
})
end
# it "can get status", automate: true do
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented code.

@talktovikas talktovikas changed the base branch from main to feature/CHEF-11396 November 14, 2024 07:16
@talktovikas talktovikas force-pushed the vikas/pedant_case_for_expired branch from 689772e to 4df006d Compare November 14, 2024 07:50
jashaik and others added 10 commits November 14, 2024 13:24
Signed-off-by: talktovikas <[email protected]>
Signed-off-by: talktovikas <[email protected]>

making it 403

Signed-off-by: talktovikas <[email protected]>

running cases only for automate.

Signed-off-by: talktovikas <[email protected]>

test for chef-zero

Signed-off-by: talktovikas <[email protected]>

test for /users

Signed-off-by: talktovikas <[email protected]>

adding env in docker

Signed-off-by: talktovikas <[email protected]>

fixing verify syntax.

Signed-off-by: talktovikas <[email protected]>

fixing placement of env variables.

Signed-off-by: talktovikas <[email protected]>

fixing placement of executor.

Signed-off-by: talktovikas <[email protected]>

test

Signed-off-by: talktovikas <[email protected]>
@talktovikas talktovikas force-pushed the vikas/pedant_case_for_expired branch from 4df006d to 23f53c3 Compare November 14, 2024 07:59
Signed-off-by: talktovikas <[email protected]>
Signed-off-by: talktovikas <[email protected]>
@sonarqubecloud
Copy link

@sonarqube-for-infrastructure-prod

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@jashaik jashaik merged commit 9e7fa34 into feature/CHEF-11396 Nov 14, 2024
7 of 8 checks passed
@jashaik jashaik deleted the vikas/pedant_case_for_expired branch November 14, 2024 09:31
jashaik added a commit that referenced this pull request Nov 14, 2024
* Updated chef-server-ctl to handle invalid license + Added grace period in X-Ops-License

Signed-off-by: jan shahid shaik <[email protected]>

* Added customer name in get_license method and license cache

Signed-off-by: jan shahid shaik <[email protected]>

* debug statements

Signed-off-by: talktovikas <[email protected]>

* case for expired license.

Signed-off-by: talktovikas <[email protected]>

making it 403

Signed-off-by: talktovikas <[email protected]>

running cases only for automate.

Signed-off-by: talktovikas <[email protected]>

test for chef-zero

Signed-off-by: talktovikas <[email protected]>

test for /users

Signed-off-by: talktovikas <[email protected]>

adding env in docker

Signed-off-by: talktovikas <[email protected]>

fixing verify syntax.

Signed-off-by: talktovikas <[email protected]>

fixing placement of env variables.

Signed-off-by: talktovikas <[email protected]>

fixing placement of executor.

Signed-off-by: talktovikas <[email protected]>

test

Signed-off-by: talktovikas <[email protected]>

* adding config for expired license from vault.

Signed-off-by: talktovikas <[email protected]>

* Added few puts inside success licese case.

Signed-off-by: sreepuramsudheer <[email protected]>

* Added IS_AUTOMATE into environment variables.

Signed-off-by: sreepuramsudheer <[email protected]>

* Replaced hardcoded expired license with one received from vault.

Signed-off-by: sreepuramsudheer <[email protected]>

* Updated chef-server-ctl to handle invalid license + Added grace period in X-Ops-License

Signed-off-by: jan shahid shaik <[email protected]>

* Added customer name in get_license method and license cache

Signed-off-by: jan shahid shaik <[email protected]>

* removing debug logs

Signed-off-by: talktovikas <[email protected]>

* code review changes.

Signed-off-by: talktovikas <[email protected]>

* adding comment for the test case.

Signed-off-by: talktovikas <[email protected]>

---------

Signed-off-by: jan shahid shaik <[email protected]>
Signed-off-by: talktovikas <[email protected]>
Signed-off-by: sreepuramsudheer <[email protected]>
Co-authored-by: jan shahid shaik <[email protected]>
Co-authored-by: sreepuramsudheer <[email protected]>
jashaik added a commit that referenced this pull request Nov 18, 2024
* Implementation of license enforcement application

Signed-off-by: jan shahid shaik <[email protected]>

* Fixing pipeline issues

Signed-off-by: jan shahid shaik <[email protected]>

* Fixing pipeline issues

Signed-off-by: jan shahid shaik <[email protected]>

* License Caching and Add license enforcement to all APIs (#3919)


License Caching and Add license enforcement to all APIs.

Signed-off-by: jan shahid shaik <[email protected]>

* Modified error message for license expiry case (#3926)

Signed-off-by: jan shahid shaik <[email protected]>

* Updated chef-server-ctl to handle invalid license + Added grace perio… (#3936)

* Update Gemfile.lock to fix adhoc pipeline instability

Signed-off-by: Lincoln Baker <[email protected]>

* Updated chef-server-ctl to handle invalid license + Added grace period in X-Ops-License

Signed-off-by: jan shahid shaik <[email protected]>

* Added customer name in get_license method and license cache

Signed-off-by: jan shahid shaik <[email protected]>

---------

Signed-off-by: Lincoln Baker <[email protected]>
Signed-off-by: jan shahid shaik <[email protected]>
Co-authored-by: Lincoln Baker <[email protected]>

* Change for customer Name (#3939)

* adding company name and license-id from automate license.

Signed-off-by: talktovikas <[email protected]>

removing trailing space.

Signed-off-by: talktovikas <[email protected]>

fixing tests.

Signed-off-by: talktovikas <[email protected]>

fixing license test case.

Signed-off-by: talktovikas <[email protected]>

Fixing bug in condition statement

Signed-off-by: talktovikas <[email protected]>

debug statements

Signed-off-by: talktovikas <[email protected]>

adding the server url.

Signed-off-by: talktovikas <[email protected]>

assignment in case of standalone chef-server.

Signed-off-by: talktovikas <[email protected]>

adding licenseId in case of Automate-T data.

Signed-off-by: talktovikas <[email protected]>

fixing T-test cases.

Signed-off-by: talktovikas <[email protected]>

fixing tests.

Signed-off-by: talktovikas <[email protected]>

fixing tests.

Signed-off-by: talktovikas <[email protected]>

* remove debug logs

Signed-off-by: talktovikas <[email protected]>

* code review changes.

Signed-off-by: talktovikas <[email protected]>

---------

Signed-off-by: talktovikas <[email protected]>

* Pedant test for the case if automate license is expired (#3941)

* Updated chef-server-ctl to handle invalid license + Added grace period in X-Ops-License

Signed-off-by: jan shahid shaik <[email protected]>

* Added customer name in get_license method and license cache

Signed-off-by: jan shahid shaik <[email protected]>

* debug statements

Signed-off-by: talktovikas <[email protected]>

* case for expired license.

Signed-off-by: talktovikas <[email protected]>

making it 403

Signed-off-by: talktovikas <[email protected]>

running cases only for automate.

Signed-off-by: talktovikas <[email protected]>

test for chef-zero

Signed-off-by: talktovikas <[email protected]>

test for /users

Signed-off-by: talktovikas <[email protected]>

adding env in docker

Signed-off-by: talktovikas <[email protected]>

fixing verify syntax.

Signed-off-by: talktovikas <[email protected]>

fixing placement of env variables.

Signed-off-by: talktovikas <[email protected]>

fixing placement of executor.

Signed-off-by: talktovikas <[email protected]>

test

Signed-off-by: talktovikas <[email protected]>

* adding config for expired license from vault.

Signed-off-by: talktovikas <[email protected]>

* Added few puts inside success licese case.

Signed-off-by: sreepuramsudheer <[email protected]>

* Added IS_AUTOMATE into environment variables.

Signed-off-by: sreepuramsudheer <[email protected]>

* Replaced hardcoded expired license with one received from vault.

Signed-off-by: sreepuramsudheer <[email protected]>

* Updated chef-server-ctl to handle invalid license + Added grace period in X-Ops-License

Signed-off-by: jan shahid shaik <[email protected]>

* Added customer name in get_license method and license cache

Signed-off-by: jan shahid shaik <[email protected]>

* removing debug logs

Signed-off-by: talktovikas <[email protected]>

* code review changes.

Signed-off-by: talktovikas <[email protected]>

* adding comment for the test case.

Signed-off-by: talktovikas <[email protected]>

---------

Signed-off-by: jan shahid shaik <[email protected]>
Signed-off-by: talktovikas <[email protected]>
Signed-off-by: sreepuramsudheer <[email protected]>
Co-authored-by: jan shahid shaik <[email protected]>
Co-authored-by: sreepuramsudheer <[email protected]>

* fixing the sonarQube issue.

Signed-off-by: talktovikas <[email protected]>

---------

Signed-off-by: jan shahid shaik <[email protected]>
Signed-off-by: Lincoln Baker <[email protected]>
Signed-off-by: talktovikas <[email protected]>
Signed-off-by: sreepuramsudheer <[email protected]>
Co-authored-by: Lincoln Baker <[email protected]>
Co-authored-by: Vikas Yadav <[email protected]>
Co-authored-by: sreepuramsudheer <[email protected]>
Co-authored-by: talktovikas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants