-
Notifications
You must be signed in to change notification settings - Fork 75
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
pro enable landscape (SC-1508) #2656
Conversation
Jira: SC-1508 GitHub Issues: No GitHub issues are fixed by this PR. (No commits have Fixes: #### references) Launchpad Bugs: No Launchpad bugs are fixed by this PR. (No commits have LP: #### references) Documentation: Documentation changes addressed in #2674 👍 this comment to confirm that this is correct. |
a0b6004
to
47ef7d0
Compare
2ce3c52
to
4f70bb1
Compare
@lucasmoura @renanrodrigo not all unit tests or integration tests are updated and passing, but this PR is ready for a preliminary implementation/functional review |
I'm having some timeout issues when testing manually - integration tests are working fine though. It might be my environment somehow - I'll look into it more tomorrow. |
While testing this manually, I have found out this scenario here:
Which is generating this entry on the logs:
|
Same error if you provide invalid credentials and try to register the machine:
|
Ah yep this is from the change to use |
b549260
to
2637a4b
Compare
@lucasmoura that issue is now fixed but I'm still having what seem to be network problems from landscape-config only when running manually in a lxd container :( |
Okay the problem with my manual test is solved. I was setting So I recommended that landscape catch json decode errors when parsing our output, but this is not an actual problem with |
2637a4b
to
35a3a3c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think once we have the unittest and integration tests ready, we can merge this PR
When I run `sudo pro disable landscape` with sudo | ||
|
||
# cleanup | ||
Then I reject all pending computers on Landscape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd specify on the Landscape server
here for explicity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm going to move this to a "after_all" hook or something so that it cleans up even if the test fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do this in a followup: #2676
@@ -48,34 +50,55 @@ def then_not_in_conditional_stdout_does_not_match_regexp( | |||
def then_stream_does_not_match_regexp(context, stream): | |||
text = process_template_vars(context, context.text) | |||
content = getattr(context.process, stream).strip() | |||
assert_that(content, not_(matches_regexp(text))) | |||
if re.compile(text).search(content) is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question on this - what do we win from moving away from hamcrest here? Is there a benefit not to rely on the functions we were using before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hamcrest gave errors that look like this:
Assertion Failed:
Expected: a string matching 'SERVICE +ENTITLED +STATUS +DESCRIPTION
cc-eal +yes +n/a +Common Criteria EAL2 Provisioning Packages
esm-apps +yes +enabled +Expanded Security Maintenance for Applications
esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
fips +yes +n/a +NIST-certified core packages
fips-updates +yes +n/a +NIST-certified core packages with priority security updates
livepatch +yes +n/a +Canonical Livepatch service
realtime-kernel +yes +n/a +Ubuntu kernel with PREEMPT_RT patches integrated
ros +yes +n/a +Security Updates for the Robot Operating System
ros-updates +yes +n/a +All Updates for the Robot Operating System
usg +yes +disabled +Security compliance and audit tools
Enable services with: pro enable <service>'
but: was 'SERVICE ENTITLED STATUS DESCRIPTION\ncc-eal yes n/a Common Criteria EAL2 Provisioning Packages\nesm-apps yes enabled Expanded Security Maintenance for Applications\nesm-infra yes enabled Expanded Security Maintenance for Infrastructure\nfips yes n/a NIST-certified core packages\nfips-updates yes n/a NIST-certified core packages with priority security updates\nlivepatch yes n/a Canonical Livepatch service\nrealtime-kernel yes n/a Ubuntu kernel with PREEMPT_RT patches integrated\n├ generic yes n/a Generic version of the RT kernel (default)\n└ intel-iotg yes n/a RT kernel optimized for Intel IOTG platform\nros yes n/a Security Updates for the Robot Operating System\nros-updates yes n/a All Updates for the Robot Operating System\nusg yes disabled Security compliance and audit tools\n\nEnable services with: pro enable <service>\n\n Account: UA Client Test\n Subscription: server-team-ua-client-ci-uaa\n Valid until: Fri Dec 31 00:00:00 9999 UTC\nTechnical support level: essential'
The problem I was facing is that it is hard to read that really long line at the bottom even when it's wrapped.
The new assertions here will give errors that look like this:
Assertion Failed: Expected to match regexp:
SERVICE +ENTITLED +STATUS +DESCRIPTION
cc-eal +yes +n/a +Common Criteria EAL2 Provisioning Packages
esm-apps +yes +enabled +Expanded Security Maintenance for Applications
esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
fips +yes +n/a +NIST-certified core packages
fips-updates +yes +n/a +NIST-certified core packages with priority security updates
livepatch +yes +n/a +Canonical Livepatch service
realtime-kernel +yes +n/a +Ubuntu kernel with PREEMPT_RT patches integrated
ros +yes +n/a +Security Updates for the Robot Operating System
ros-updates +yes +n/a +All Updates for the Robot Operating System
usg +yes +disabled +Security compliance and audit tools
Enable services with: pro enable <service>
But got:
SERVICE ENTITLED STATUS DESCRIPTION
cc-eal yes n/a Common Criteria EAL2 Provisioning Packages
esm-apps yes enabled Expanded Security Maintenance for Applications
esm-infra yes enabled Expanded Security Maintenance for Infrastructure
fips yes n/a NIST-certified core packages
fips-updates yes n/a NIST-certified core packages with priority security updates
livepatch yes n/a Canonical Livepatch service
realtime-kernel yes n/a Ubuntu kernel with PREEMPT_RT patches integrated
├ generic yes n/a Generic version of the RT kernel (default)
└ intel-iotg yes n/a RT kernel optimized for Intel IOTG platform
ros yes n/a Security Updates for the Robot Operating System
ros-updates yes n/a All Updates for the Robot Operating System
usg yes disabled Security compliance and audit tools
Enable services with: pro enable <service>
Which I find a lot easier to spot the difference in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love this
305ee43
to
2cc2764
Compare
c30a64c
to
e8cec25
Compare
The shown argument should be True when the result will be displayed in the test output. When shown is True, secret config values are not replaced.
I didn't notice we already had an implementation for this and wrote a new one. Then I realized we already had one and decided to combine the new and old implementation in a small refactor.
e8cec25
to
24e78e4
Compare
24e78e4
to
16681ba
Compare
CI fails are unrelated |
TODO:
Why is this needed?
This is
pro enable landscape
as spec-ed with the landscape team.Test Steps
The new integration tests require some new secrets
Also try it out manually
Checklist
Does this PR require extra reviews?