Skip to content

Commit

Permalink
landscape: support enabling and disabling landscape-client
Browse files Browse the repository at this point in the history
  • Loading branch information
orndorffgrant committed Jul 27, 2023
1 parent 3ab862f commit c30a64c
Show file tree
Hide file tree
Showing 23 changed files with 965 additions and 63 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ jobs:
UACLIENT_BEHAVE_CONTRACT_TOKEN: '${{ secrets.UACLIENT_BEHAVE_CONTRACT_TOKEN }}'
UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING: '${{ secrets.UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING }}'
UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING_EXPIRED: '${{ secrets.UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING_EXPIRED }}'
UACLIENT_BEHAVE_LANDSCAPE_REGISTRATION_KEY: '${{ secrets.UACLIENT_BEHAVE_LANDSCAPE_REGISTRATION_KEY }}'
UACLIENT_BEHAVE_LANDSCAPE_API_ACCESS_KEY: '${{ secrets.UACLIENT_BEHAVE_LANDSCAPE_API_ACCESS_KEY }}'
UACLIENT_BEHAVE_LANDSCAPE_API_SECRET_KEY: '${{ secrets.UACLIENT_BEHAVE_LANDSCAPE_API_SECRET_KEY }}'
run: |
PYCLOUDLIB_CONFIG="$(mktemp --tmpdir="${{ runner.temp }}" pycloudlib.toml.XXXXXXXXXX)"
GCE_CREDENTIALS_PATH="$(mktemp --tmpdir="${{ runner.temp }}" gcloud.json.XXXXXXXXXX)"
Expand Down
37 changes: 25 additions & 12 deletions features/attached_commands.feature
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription

Examples: ubuntu release
| release | valid_services |
| xenial | anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| bionic | anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| focal | anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| jammy | anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| xenial | anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| bionic | anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| focal | anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |
| jammy | anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |

@series.lts
@uses.config.machine_type.lxd-container
Expand Down Expand Up @@ -176,10 +176,10 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription

Examples: ubuntu release
| release | msg |
| xenial | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| bionic | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| focal | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| jammy | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| xenial | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| bionic | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| focal | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |
| jammy | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |

@series.lts
@uses.config.machine_type.lxd-container
Expand Down Expand Up @@ -219,6 +219,7 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription
esm-infra +yes +Expanded Security Maintenance for Infrastructure
fips +<fips> +NIST-certified core packages
fips-updates +<fips> +NIST-certified core packages with priority security updates
landscape +(yes|no) +Management and administration tool for Ubuntu
livepatch +(yes|no) +(Canonical Livepatch service|Current kernel is not supported)
realtime-kernel +<realtime-kernel> +Ubuntu kernel with PREEMPT_RT patches integrated
ros +<ros> +Security Updates for the Robot Operating System
Expand Down Expand Up @@ -428,10 +429,10 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription

Examples: ubuntu release
| release | msg |
| xenial | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| bionic | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| focal | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| jammy | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| xenial | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| bionic | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| focal | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |
| jammy | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |

@series.xenial
@series.bionic
Expand Down Expand Up @@ -488,6 +489,8 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription
\(https://ubuntu.com/security/certifications#fips\)
- fips: NIST-certified core packages
\(https://ubuntu.com/security/certifications#fips\)
- landscape: Management and administration tool for Ubuntu
\(https://ubuntu.com/landscape\)
- livepatch: Canonical Livepatch service
\(https://ubuntu.com/security/livepatch\)
"""
Expand All @@ -508,6 +511,8 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription
\(https://ubuntu.com/security/certifications#fips\)
- fips: NIST-certified core packages
\(https://ubuntu.com/security/certifications#fips\)
- landscape: Management and administration tool for Ubuntu
\(https://ubuntu.com/landscape\)
- livepatch: Canonical Livepatch service
\(https://ubuntu.com/security/livepatch\)
"""
Expand All @@ -528,6 +533,8 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription
\(https://ubuntu.com/security/certifications#fips\)
- fips: NIST-certified core packages
\(https://ubuntu.com/security/certifications#fips\)
- landscape: Management and administration tool for Ubuntu
\(https://ubuntu.com/landscape\)
- livepatch: Canonical Livepatch service
\(https://ubuntu.com/security/livepatch\)
- realtime-kernel: Ubuntu kernel with PREEMPT_RT patches integrated
Expand Down Expand Up @@ -596,6 +603,8 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription
\(https://ubuntu.com/security/certifications#fips\)
- fips: NIST-certified core packages
\(https://ubuntu.com/security/certifications#fips\)
- landscape: Management and administration tool for Ubuntu
\(https://ubuntu.com/landscape\)
- livepatch: Canonical Livepatch service
\(https://ubuntu.com/security/livepatch\)
- realtime-kernel: Ubuntu kernel with PREEMPT_RT patches integrated
Expand All @@ -622,6 +631,8 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription
\(https://ubuntu.com/security/certifications#fips\)
- fips: NIST-certified core packages
\(https://ubuntu.com/security/certifications#fips\)
- landscape: Management and administration tool for Ubuntu
\(https://ubuntu.com/landscape\)
- livepatch: Canonical Livepatch service
\(https://ubuntu.com/security/livepatch\)
- realtime-kernel: Ubuntu kernel with PREEMPT_RT patches integrated
Expand All @@ -648,6 +659,8 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription
\(https://ubuntu.com/security/certifications#fips\)
- fips: NIST-certified core packages
\(https://ubuntu.com/security/certifications#fips\)
- landscape: Management and administration tool for Ubuntu
\(https://ubuntu.com/landscape\)
- livepatch: Canonical Livepatch service
\(https://ubuntu.com/security/livepatch\)
- realtime-kernel: Ubuntu kernel with PREEMPT_RT patches integrated
Expand Down
14 changes: 7 additions & 7 deletions features/attached_enable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ Feature: Enable command behaviour when attached to an Ubuntu Pro subscription

Examples: ubuntu release
| release | valid_services |
| xenial | anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| bionic | anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| focal | anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| jammy | anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| xenial | anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| bionic | anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| focal | anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |
| jammy | anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |

@series.lts
@uses.config.machine_type.lxd-container
Expand Down Expand Up @@ -247,9 +247,9 @@ Feature: Enable command behaviour when attached to an Ubuntu Pro subscription

Examples: ubuntu release
| release | infra-pkg | esm-infra-url | msg |
| xenial | libkrad0 | https://esm.ubuntu.com/infra/ubuntu | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| bionic | libkrad0 | https://esm.ubuntu.com/infra/ubuntu | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlivepatch, realtime-kernel, ros, ros-updates. |
| focal | hello | https://esm.ubuntu.com/infra/ubuntu | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates, usg. |
| xenial | libkrad0 | https://esm.ubuntu.com/infra/ubuntu | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| bionic | libkrad0 | https://esm.ubuntu.com/infra/ubuntu | Try anbox-cloud, cc-eal, cis, esm-apps, esm-infra, fips, fips-updates,\nlandscape, livepatch, realtime-kernel, ros, ros-updates. |
| focal | hello | https://esm.ubuntu.com/infra/ubuntu | Try anbox-cloud, cc-eal, esm-apps, esm-infra, fips, fips-updates, landscape,\nlivepatch, realtime-kernel, ros, ros-updates, usg. |

@series.all
@uses.config.machine_type.lxd-container
Expand Down
12 changes: 12 additions & 0 deletions features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class UAClientBehaveConfig:
"contract_token",
"contract_token_staging",
"contract_token_staging_expired",
"landscape_registration_key",
"landscape_api_access_key",
"landscape_api_secret_key",
"machine_type",
"private_key_file",
"private_key_name",
Expand All @@ -102,6 +105,9 @@ class UAClientBehaveConfig:
"contract_token",
"contract_token_staging",
"contract_token_staging_expired",
"landscape_registration_key",
"landscape_api_access_key",
"landscape_api_secret_key",
]

# This variable is used in .from_environ() but also to emit the "Config
Expand All @@ -124,6 +130,9 @@ def __init__(
contract_token: Optional[str] = None,
contract_token_staging: Optional[str] = None,
contract_token_staging_expired: Optional[str] = None,
landscape_registration_key: Optional[str] = None,
landscape_api_access_key: Optional[str] = None,
landscape_api_secret_key: Optional[str] = None,
artifact_dir: str = "artifacts",
install_from: InstallationSource = InstallationSource.LOCAL,
custom_ppa: Optional[str] = None,
Expand All @@ -141,6 +150,9 @@ def __init__(
self.contract_token = contract_token
self.contract_token_staging = contract_token_staging
self.contract_token_staging_expired = contract_token_staging_expired
self.landscape_registration_key = landscape_registration_key
self.landscape_api_access_key = landscape_api_access_key
self.landscape_api_secret_key = landscape_api_secret_key
self.image_clean = image_clean
self.destroy_instances = destroy_instances
self.machine_type = machine_type
Expand Down
Loading

0 comments on commit c30a64c

Please sign in to comment.