GLOB sdist-make: /home/lucasmoura/projects/ubuntu-advantage-client/setup.py behave-lxd-18.04 inst-nodeps: /home/lucasmoura/projects/ubuntu-advantage-client/.tox/.tmp/package/3/ubuntu-advantage-tools-20.3.zip behave-lxd-18.04 installed: adal==1.2.6,appdirs==1.4.4,applicationinsights==0.11.9,argcomplete==1.12.2,attrs==20.3.0,azure-cli-core==2.21.0,azure-cli-telemetry==1.0.6,azure-common==1.1.27,azure-core==1.12.0,azure-mgmt-compute==14.0.0,azure-mgmt-core==1.2.2,azure-mgmt-network==13.0.0,azure-mgmt-resource==12.1.0,backcall==0.2.0,bcrypt==3.2.0,behave==1.2.6,boto3==1.17.39,botocore==1.20.39,cachetools==4.2.1,certifi==2020.12.5,cffi==1.14.5,chardet==4.0.0,cliff==3.7.0,cmd2==1.5.0,colorama==0.4.4,configparser==4.0.2,coverage==5.5,cryptography==3.2.1,debtcollector==2.2.0,decorator==4.4.2,dogpile.cache==1.1.2,flake8==3.9.0,google-api-core==1.26.2,google-api-python-client==2.0.2,google-auth==1.28.0,google-auth-httplib2==0.1.0,googleapis-common-protos==1.53.0,httplib2==0.19.0,humanfriendly==9.1,idna==2.10,iniconfig==1.1.1,ipdb==0.13.7,ipython==7.22.0,ipython-genutils==0.2.0,iso8601==0.1.14,isodate==0.6.0,jedi==0.18.0,jmespath==0.10.0,jsonpatch==1.32,jsonpointer==2.1,keystoneauth1==4.3.1,knack==0.8.0rc2,mccabe==0.6.1,mock==4.0.3,msal==1.10.0,msgpack==1.0.2,msrest==0.6.21,msrestazure==0.6.4,munch==2.5.0,netaddr==0.8.0,netifaces==0.10.9,oauthlib==3.1.0,oci==2.34.0,openstacksdk==0.55.0,os-service-types==1.7.0,osc-lib==2.3.1,oslo.config==8.5.0,oslo.i18n==5.0.1,oslo.serialization==4.1.0,oslo.utils==4.8.0,packaging==20.9,paramiko==2.7.2,parse==1.19.0,parse-type==0.5.2,parso==0.8.1,pbr==5.5.1,pexpect==4.8.0,pickleshare==0.7.5,pkginfo==1.7.0,pluggy==0.13.1,portalocker==1.7.1,prettytable==2.1.0,prompt-toolkit==3.0.18,protobuf==3.15.6,psutil==5.8.0,ptyprocess==0.7.0,py==1.10.0,pyasn1==0.4.8,pyasn1-modules==0.2.8,pycloudlib @ git+https://github.com/canonical/pycloudlib.git@21ff1bd5d442eb946a9c910176c3d2f18c5bdf54,pycodestyle==2.7.0,pycparser==2.20,pyflakes==2.3.1,Pygments==2.8.1,PyHamcrest==2.0.2,PyJWT==1.7.1,PyNaCl==1.4.0,pyOpenSSL==19.1.0,pyparsing==2.4.7,pyperclip==1.8.2,pytest==6.2.2,pytest-cov==2.11.1,python-cinderclient==7.4.0,python-dateutil==2.8.1,python-keystoneclient==4.2.0,python-novaclient==17.4.0,python-openstackclient==5.5.0,python-simplestreams @ git+https://git.launchpad.net/simplestreams@21c5bba2a5413c51e6b9131fc450e96f6b46090d,pytz==2021.1,PyYAML==5.4.1,requests==2.25.1,requests-oauthlib==1.3.0,requestsexceptions==1.4.0,rfc3986==1.4.0,rsa==4.7.2,s3transfer==0.3.6,simplejson==3.17.2,six==1.15.0,stevedore==3.3.0,tabulate==0.8.9,toml==0.10.2,traitlets==5.0.5,ubuntu-advantage-tools @ file:///home/lucasmoura/projects/ubuntu-advantage-client/.tox/.tmp/package/3/ubuntu-advantage-tools-20.3.zip,uritemplate==3.0.1,urllib3==1.26.4,wcwidth==0.2.5,wrapt==1.12.1 behave-lxd-18.04 run-test-pre: PYTHONHASHSEED='367568781' behave-lxd-18.04 run-test: commands[0] | behave -v --tags=series.bionic,series.all '--tags=~upgrade' Loading config defaults from "./tox.ini" Using defaults: color True show_snippets True show_skipped False dry_run False show_source True show_timings True stdout_capture False stderr_capture False log_capture False logging_format %(levelname)s:%(name)s:%(message)s logging_level info steps_catalog False summary True junit True stage None userdata {} default_format pretty default_tags scenario_outline_annotation_schema {name} -- @{row.id} {examples.name} more_formatters {} Using default path "./features" Trying base directory: /home/lucasmoura/projects/ubuntu-advantage-client/features --- Ignoring aws_access_key_id because machine_type is lxd.container --- Ignoring aws_secret_access_key because machine_type is lxd.container --- Ignoring az_client_id because machine_type is lxd.container --- Ignoring az_client_secret because machine_type is lxd.container --- Ignoring az_tenant_id because machine_type is lxd.container --- Ignoring az_subscription_id because machine_type is lxd.container --- Ignoring gcp_credentials_path because machine_type is lxd.container --- Ignoring gcp_project because machine_type is lxd.container --- job suffix: None Config options: build_pr = False image_clean = True destroy_instances = True aws_access_key_id = None aws_secret_access_key = None az_client_id = None az_client_secret = None az_tenant_id = None az_subscription_id = None gcp_credentials_path = None gcp_project = None contract_token = contract_token_staging = machine_type = lxd.container private_key_file = None private_key_name = uaclient-integration reuse_image = None debs_path = None artifact_dir = None ppa = ppa:ua-client/staging ppa_keyid = 6C0BC933 Feature: Command behaviour when trying to attach a machine to an Ubuntu # features/attach_invalidtoken.feature:1 Advantage subscription using an invalid token @series.all Scenario Outline: Attach command in a machine -- @1.1 ubuntu release # features/attach_invalidtoken.feature:19 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua attach INVALID_TOKEN` `with sudo` exits `1` # None Then stderr matches regexp # None """ Invalid token. See https://ubuntu.com/advantage """ When I verify that running `ua attach INVALID_TOKEN` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ @series.all Scenario Outline: Attach command in a machine -- @1.2 ubuntu release # features/attach_invalidtoken.feature:20 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua attach INVALID_TOKEN` `with sudo` exits `1` # None Then stderr matches regexp # None """ Invalid token. See https://ubuntu.com/advantage """ When I verify that running `ua attach INVALID_TOKEN` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ @series.all Scenario Outline: Attach command in a machine -- @1.3 ubuntu release # features/attach_invalidtoken.feature:21 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua attach INVALID_TOKEN` `with sudo` exits `1` # features/steps/steps.py:365 Then stderr matches regexp # features/steps/steps.py:312 """ Invalid token. See https://ubuntu.com/advantage """ When I verify that running `ua attach INVALID_TOKEN` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ @series.all Scenario Outline: Attach command in a machine -- @1.4 ubuntu release # features/attach_invalidtoken.feature:22 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua attach INVALID_TOKEN` `with sudo` exits `1` # None Then stderr matches regexp # None """ Invalid token. See https://ubuntu.com/advantage """ When I verify that running `ua attach INVALID_TOKEN` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ @uses.config.contract_token Feature: Command behaviour when attaching a machine to an Ubuntu Advantage # features/attach_validtoken.feature:2 subscription using a valid token @series.xenial @series.bionic @series.focal @uses.config.machine_type.lxd.container Scenario Outline: Attach command in a ubuntu lxd container -- @1.1 ubuntu release packages # features/attach_validtoken.feature:116 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `apt-get update` with sudo, retrying exit [100] # None And I run `apt-get install -y libgit2-0=0.19.0-2` with sudo, retrying exit [100] # None And I run `run-parts /etc/update-motd.d/` with sudo # None Then if `trusty` in `xenial or bionic` and stdout matches regexp # None """ \d+ package(s)? can be updated. \d+ of these updates (is a|are) security update(s)?. """ Then if `trusty` in `focal` and stdout matches regexp # None """ \d+ update(s)? can be installed immediately. \d+ of these updates (is a|are) security update(s)?. """ When I attach `contract_token` with sudo # None Then stdout matches regexp # None """ UA Infra: ESM enabled """ And stdout matches regexp # None """ This machine is now attached to """ And stdout matches regexp # None """ SERVICE ENTITLED STATUS DESCRIPTION esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) fips +yes +n/a +NIST-certified FIPS modules fips-updates +yes +n/a +Uncertified security updates to FIPS modules livepatch +yes +n/a +Canonical Livepatch service """ And stderr matches regexp # None """ Enabling default service esm-infra """ When I append the following on uaclient config # None """ features: allow_beta: true """ And I run `apt update` with sudo # None And I run `python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py` with sudo # None And I run `apt install update-motd` with sudo, retrying exit [100] # None And I run `update-motd` with sudo # None Then if `trusty` in `focal` and stdout matches regexp # None """ \* Introducing Extended Security Maintenance for Applications. +Receive updates to over 30,000 software packages with your +Ubuntu Advantage subscription. Free for personal use. +https:\/\/ubuntu.com\/esm UA (Infra:|Infrastructure) Extended Security Maintenance \(ESM\) is enabled. \d+ update(s)? can be installed immediately. \d+ of these updates (is|are) (fixed|provided) through UA (Infra:|Infrastructure) ESM. \d+ of these updates (is a|are) security update(s)?. To see these additional updates run: apt list --upgradable """ Then if `trusty` in `xenial or bionic` and stdout matches regexp # None """ \* Introducing Extended Security Maintenance for Applications. +Receive updates to over 30,000 software packages with your +Ubuntu Advantage subscription. Free for personal use. +https:\/\/ubuntu.com\/esm UA Infra: Extended Security Maintenance \(ESM\) is enabled. \d+ package(s)? can be updated. \d+ of these updates (is a|are) security update(s)?. To see these additional updates run: apt list --upgradable """ When I update contract to use `effectiveTo` as `days=-20` # None And I run `python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py` with sudo # None And I run `update-motd` with sudo # None Then if `trusty` in `xenial or bionic` and stdout matches regexp # None """ \*Your UA Infra: ESM subscription has EXPIRED\* \d+ additional security update\(s\) could have been applied via UA Infra: ESM. Renew your UA services at https:\/\/ubuntu.com\/esm """ Then if `trusty` in `xenial` and stdout matches regexp # None """ Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. """ When I run `apt upgrade --dry-run` with sudo # None Then if `trusty` in `xenial` and stdout matches regexp # None """ \*Your UA Infra: ESM subscription has EXPIRED\* Enabling UA Infra: ESM service would provide security updates for following packages: libkrad0 1 esm-infra security update\(s\) NOT APPLIED. Renew your UA services at https:\/\/ubuntu.com\/advantage """ @series.xenial @series.bionic @series.focal @uses.config.machine_type.lxd.container Scenario Outline: Attach command in a ubuntu lxd container -- @1.2 ubuntu release packages # features/attach_validtoken.feature:117 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `apt-get update` with sudo, retrying exit [100] # None And I run `apt-get install -y libkrad0=1.13.2+dfsg-5` with sudo, retrying exit [100] # None And I run `run-parts /etc/update-motd.d/` with sudo # None Then if `xenial` in `xenial or bionic` and stdout matches regexp # None """ \d+ package(s)? can be updated. \d+ of these updates (is a|are) security update(s)?. """ Then if `xenial` in `focal` and stdout matches regexp # None """ \d+ update(s)? can be installed immediately. \d+ of these updates (is a|are) security update(s)?. """ When I attach `contract_token` with sudo # None Then stdout matches regexp # None """ UA Infra: ESM enabled """ And stdout matches regexp # None """ This machine is now attached to """ And stdout matches regexp # None """ SERVICE ENTITLED STATUS DESCRIPTION esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) fips +yes +n/a +NIST-certified FIPS modules fips-updates +yes +n/a +Uncertified security updates to FIPS modules livepatch +yes +n/a +Canonical Livepatch service """ And stderr matches regexp # None """ Enabling default service esm-infra """ When I append the following on uaclient config # None """ features: allow_beta: true """ And I run `apt update` with sudo # None And I run `python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py` with sudo # None And I run `apt install update-motd` with sudo, retrying exit [100] # None And I run `update-motd` with sudo # None Then if `xenial` in `focal` and stdout matches regexp # None """ \* Introducing Extended Security Maintenance for Applications. +Receive updates to over 30,000 software packages with your +Ubuntu Advantage subscription. Free for personal use. +https:\/\/ubuntu.com\/esm UA (Infra:|Infrastructure) Extended Security Maintenance \(ESM\) is enabled. \d+ update(s)? can be installed immediately. \d+ of these updates (is|are) (fixed|provided) through UA (Infra:|Infrastructure) ESM. \d+ of these updates (is a|are) security update(s)?. To see these additional updates run: apt list --upgradable """ Then if `xenial` in `xenial or bionic` and stdout matches regexp # None """ \* Introducing Extended Security Maintenance for Applications. +Receive updates to over 30,000 software packages with your +Ubuntu Advantage subscription. Free for personal use. +https:\/\/ubuntu.com\/esm UA Infra: Extended Security Maintenance \(ESM\) is enabled. \d+ package(s)? can be updated. \d+ of these updates (is a|are) security update(s)?. To see these additional updates run: apt list --upgradable """ When I update contract to use `effectiveTo` as `days=-20` # None And I run `python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py` with sudo # None And I run `update-motd` with sudo # None Then if `xenial` in `xenial or bionic` and stdout matches regexp # None """ \*Your UA Infra: ESM subscription has EXPIRED\* \d+ additional security update\(s\) could have been applied via UA Infra: ESM. Renew your UA services at https:\/\/ubuntu.com\/esm """ Then if `xenial` in `xenial` and stdout matches regexp # None """ Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. """ When I run `apt upgrade --dry-run` with sudo # None Then if `xenial` in `xenial` and stdout matches regexp # None """ \*Your UA Infra: ESM subscription has EXPIRED\* Enabling UA Infra: ESM service would provide security updates for following packages: libkrad0 1 esm-infra security update\(s\) NOT APPLIED. Renew your UA services at https:\/\/ubuntu.com\/advantage """ @series.xenial @series.bionic @series.focal @uses.config.machine_type.lxd.container Scenario Outline: Attach command in a ubuntu lxd container -- @1.3 ubuntu release packages # features/attach_validtoken.feature:118 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `apt-get update` with sudo, retrying exit [100] # features/steps/steps.py:109 And I run `apt-get install -y libkrad0=1.16-2build1` with sudo, retrying exit [100] # features/steps/steps.py:109 And I run `run-parts /etc/update-motd.d/` with sudo # features/steps/steps.py:130 Then if `bionic` in `xenial or bionic` and stdout matches regexp # features/steps/steps.py:286 """ \d+ package(s)? can be updated. \d+ of these updates (is a|are) security update(s)?. """ Then if `bionic` in `focal` and stdout matches regexp # features/steps/steps.py:286 """ \d+ update(s)? can be installed immediately. \d+ of these updates (is a|are) security update(s)?. """ When I attach `contract_token` with sudo # features/steps/steps.py:216 Then stdout matches regexp # features/steps/steps.py:300 """ UA Infra: ESM enabled """ And stdout matches regexp # features/steps/steps.py:300 """ This machine is now attached to """ And stdout matches regexp # features/steps/steps.py:300 """ SERVICE ENTITLED STATUS DESCRIPTION esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) fips +yes +n/a +NIST-certified FIPS modules fips-updates +yes +n/a +Uncertified security updates to FIPS modules livepatch +yes +n/a +Canonical Livepatch service """ And stderr matches regexp # features/steps/steps.py:312 """ Enabling default service esm-infra """ When I append the following on uaclient config # features/steps/steps.py:245 """ features: allow_beta: true """ And I run `apt update` with sudo # features/steps/steps.py:130 And I run `python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py` with sudo # features/steps/steps.py:130 And I run `apt install update-motd` with sudo, retrying exit [100] # features/steps/steps.py:109 And I run `update-motd` with sudo # features/steps/steps.py:130 Then if `bionic` in `focal` and stdout matches regexp # features/steps/steps.py:286 """ \* Introducing Extended Security Maintenance for Applications. +Receive updates to over 30,000 software packages with your +Ubuntu Advantage subscription. Free for personal use. +https:\/\/ubuntu.com\/esm UA (Infra:|Infrastructure) Extended Security Maintenance \(ESM\) is enabled. \d+ update(s)? can be installed immediately. \d+ of these updates (is|are) (fixed|provided) through UA (Infra:|Infrastructure) ESM. \d+ of these updates (is a|are) security update(s)?. To see these additional updates run: apt list --upgradable """ Then if `bionic` in `xenial or bionic` and stdout matches regexp # features/steps/steps.py:286 """ \* Introducing Extended Security Maintenance for Applications. +Receive updates to over 30,000 software packages with your +Ubuntu Advantage subscription. Free for personal use. +https:\/\/ubuntu.com\/esm UA Infra: Extended Security Maintenance \(ESM\) is enabled. \d+ package(s)? can be updated. \d+ of these updates (is a|are) security update(s)?. To see these additional updates run: apt list --upgradable """ When I update contract to use `effectiveTo` as `days=-20` # features/steps/steps.py:195 And I run `python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py` with sudo # features/steps/steps.py:130 And I run `update-motd` with sudo # features/steps/steps.py:130 Then if `bionic` in `xenial or bionic` and stdout matches regexp # features/steps/steps.py:286 """ \*Your UA Infra: ESM subscription has EXPIRED\* \d+ additional security update\(s\) could have been applied via UA Infra: ESM. Renew your UA services at https:\/\/ubuntu.com\/esm """ Then if `bionic` in `xenial` and stdout matches regexp # features/steps/steps.py:286 """ Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. """ When I run `apt upgrade --dry-run` with sudo # features/steps/steps.py:130 Then if `bionic` in `xenial` and stdout matches regexp # features/steps/steps.py:286 """ \*Your UA Infra: ESM subscription has EXPIRED\* Enabling UA Infra: ESM service would provide security updates for following packages: libkrad0 1 esm-infra security update\(s\) NOT APPLIED. Renew your UA services at https:\/\/ubuntu.com\/advantage """ @series.xenial @series.bionic @series.focal @uses.config.machine_type.lxd.container Scenario Outline: Attach command in a ubuntu lxd container -- @1.4 ubuntu release packages # features/attach_validtoken.feature:119 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 SKIP Scenario Attach command in an generic AWS Ubuntu VM -- @1.1 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: aws.generic SKIP Scenario Attach command in an generic AWS Ubuntu VM -- @1.2 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: aws.generic SKIP Scenario Attach command in an generic AWS Ubuntu VM -- @1.3 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: aws.generic SKIP Scenario Attach command in an generic AWS Ubuntu VM -- @1.4 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: aws.generic SKIP Scenario Attach command in a ubuntu lxd container -- @1.1 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: azure.generic SKIP Scenario Attach command in a ubuntu lxd container -- @1.2 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: azure.generic SKIP Scenario Attach command in a ubuntu lxd container -- @1.3 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: azure.generic SKIP Scenario Attach command in a ubuntu lxd container -- @1.4 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: azure.generic SKIP Scenario Attach command in a ubuntu lxd container -- @1.1 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: gcp.generic SKIP Scenario Attach command in a ubuntu lxd container -- @1.2 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: gcp.generic SKIP Scenario Attach command in a ubuntu lxd container -- @1.3 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: gcp.generic SKIP Scenario Attach command in a ubuntu lxd container -- @1.4 ubuntu release livepatch status: Skipped: machine type lxd.container was not found in tags: gcp.generic SKIP Scenario Attached enable of vm-based services in an ubuntu lxd vm -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: azure.generic SKIP Scenario Attached enable of vm-based services in an ubuntu lxd vm -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: aws.generic SKIP Scenario Attached enable of fips services in an ubuntu gcp vm -- @1.1 fips: Skipped: machine type lxd.container was not found in tags: gcp.generic SKIP Scenario Attached enable of fips services in an ubuntu gcp vm -- @1.2 fips: Skipped: machine type lxd.container was not found in tags: gcp.generic SKIP Scenario Attached enable of fips services in an ubuntu gcp vm -- @1.3 fips: Skipped: machine type lxd.container was not found in tags: gcp.generic SKIP Scenario Attached enable of fips services in an ubuntu gcp vm -- @1.4 fips: Skipped: machine type lxd.container was not found in tags: gcp.generic When I run `apt-get update` with sudo, retrying exit [100] # None And I run `apt-get install -y hello=2.10-2ubuntu2` with sudo, retrying exit [100] # None And I run `run-parts /etc/update-motd.d/` with sudo # None Then if `focal` in `xenial or bionic` and stdout matches regexp # None """ \d+ package(s)? can be updated. \d+ of these updates (is a|are) security update(s)?. """ Then if `focal` in `focal` and stdout matches regexp # None """ \d+ update(s)? can be installed immediately. \d+ of these updates (is a|are) security update(s)?. """ When I attach `contract_token` with sudo # None Then stdout matches regexp # None """ UA Infra: ESM enabled """ And stdout matches regexp # None """ This machine is now attached to """ And stdout matches regexp # None """ SERVICE ENTITLED STATUS DESCRIPTION esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) fips +yes +n/a +NIST-certified FIPS modules fips-updates +yes +n/a +Uncertified security updates to FIPS modules livepatch +yes +n/a +Canonical Livepatch service """ And stderr matches regexp # None """ Enabling default service esm-infra """ When I append the following on uaclient config # None """ features: allow_beta: true """ And I run `apt update` with sudo # None And I run `python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py` with sudo # None And I run `apt install update-motd` with sudo, retrying exit [100] # None And I run `update-motd` with sudo # None Then if `focal` in `focal` and stdout matches regexp # None """ \* Introducing Extended Security Maintenance for Applications. +Receive updates to over 30,000 software packages with your +Ubuntu Advantage subscription. Free for personal use. +https:\/\/ubuntu.com\/esm UA (Infra:|Infrastructure) Extended Security Maintenance \(ESM\) is enabled. \d+ update(s)? can be installed immediately. \d+ of these updates (is|are) (fixed|provided) through UA (Infra:|Infrastructure) ESM. \d+ of these updates (is a|are) security update(s)?. To see these additional updates run: apt list --upgradable """ Then if `focal` in `xenial or bionic` and stdout matches regexp # None """ \* Introducing Extended Security Maintenance for Applications. +Receive updates to over 30,000 software packages with your +Ubuntu Advantage subscription. Free for personal use. +https:\/\/ubuntu.com\/esm UA Infra: Extended Security Maintenance \(ESM\) is enabled. \d+ package(s)? can be updated. \d+ of these updates (is a|are) security update(s)?. To see these additional updates run: apt list --upgradable """ When I update contract to use `effectiveTo` as `days=-20` # None And I run `python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py` with sudo # None And I run `update-motd` with sudo # None Then if `focal` in `xenial or bionic` and stdout matches regexp # None """ \*Your UA Infra: ESM subscription has EXPIRED\* \d+ additional security update\(s\) could have been applied via UA Infra: ESM. Renew your UA services at https:\/\/ubuntu.com\/esm """ Then if `focal` in `xenial` and stdout matches regexp # None """ Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. """ When I run `apt upgrade --dry-run` with sudo # None Then if `focal` in `xenial` and stdout matches regexp # None """ \*Your UA Infra: ESM subscription has EXPIRED\* Enabling UA Infra: ESM service would provide security updates for following packages: libkrad0 1 esm-infra security update\(s\) NOT APPLIED. Renew your UA services at https:\/\/ubuntu.com\/advantage """ @uses.config.contract_token Feature: Command behaviour when attached to an UA subscription # features/attached_commands.feature:2 @series.all Scenario Outline: Attached refresh in a ubuntu machine -- @1.1 ubuntu release # features/attached_commands.feature:21 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua refresh` `as non-root` exits `1` # features/steps/steps.py:355 And stderr matches regexp # features/steps/steps.py:312 """ This command must be run as root \(try using sudo\). """ When I run `ua refresh` with sudo # features/steps/steps.py:130 Then I will see the following on stdout # features/steps/steps.py:281 """ Successfully refreshed your subscription. """ @series.all Scenario Outline: Attached refresh in a ubuntu machine -- @1.2 ubuntu release # features/attached_commands.feature:22 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua refresh` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua refresh` with sudo # None Then I will see the following on stdout # None """ Successfully refreshed your subscription. """ @series.all Scenario Outline: Attached refresh in a ubuntu machine -- @1.3 ubuntu release # features/attached_commands.feature:23 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua refresh` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua refresh` with sudo # None Then I will see the following on stdout # None """ Successfully refreshed your subscription. """ @series.all Scenario Outline: Attached refresh in a ubuntu machine -- @1.4 ubuntu release # features/attached_commands.feature:24 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua refresh` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua refresh` with sudo # None Then I will see the following on stdout # None """ Successfully refreshed your subscription. """ @series.all Scenario Outline: Attached disable of an already disabled service in a ubuntu machine -- @1.1 ubuntu release # features/attached_commands.feature:44 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua disable livepatch` `as non-root` exits `1` # features/steps/steps.py:355 And stderr matches regexp # features/steps/steps.py:312 """ This command must be run as root \(try using sudo\). """ And I verify that running `ua disable livepatch` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ Livepatch is not currently enabled See: sudo ua status """ @series.all Scenario Outline: Attached disable of an already disabled service in a ubuntu machine -- @1.2 ubuntu release # features/attached_commands.feature:45 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua disable livepatch` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ And I verify that running `ua disable livepatch` `with sudo` exits `1` # None And I will see the following on stdout # None """ Livepatch is not currently enabled See: sudo ua status """ @series.all Scenario Outline: Attached disable of an already disabled service in a ubuntu machine -- @1.3 ubuntu release # features/attached_commands.feature:46 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua disable livepatch` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ And I verify that running `ua disable livepatch` `with sudo` exits `1` # None And I will see the following on stdout # None """ Livepatch is not currently enabled See: sudo ua status """ @series.all Scenario Outline: Attached disable of an already disabled service in a ubuntu machine -- @1.4 ubuntu release # features/attached_commands.feature:47 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua disable livepatch` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ And I verify that running `ua disable livepatch` `with sudo` exits `1` # None And I will see the following on stdout # None """ Livepatch is not currently enabled See: sudo ua status """ @series.all Scenario Outline: Attached disable of a service in a ubuntu machine -- @1.1 ubuntu release # features/attached_commands.feature:83 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua disable foobar` `as non-root` exits `1` # features/steps/steps.py:355 And stderr matches regexp # features/steps/steps.py:312 """ This command must be run as root \(try using sudo\). """ And I verify that running `ua disable foobar` `with sudo` exits `1` # features/steps/steps.py:355 And stderr matches regexp # features/steps/steps.py:312 """ Cannot disable unknown service 'foobar'. Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua disable esm-infra` `as non-root` exits `1` # features/steps/steps.py:355 And stderr matches regexp # features/steps/steps.py:312 """ This command must be run as root \(try using sudo\). """ When I run `ua disable esm-infra` with sudo # features/steps/steps.py:130 Then I will see the following on stdout # features/steps/steps.py:281 """ Updating package lists """ When I run `ua status` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\) """ And I verify that running `apt update` `with sudo` exits `0` # features/steps/steps.py:355 @series.all Scenario Outline: Attached disable of a service in a ubuntu machine -- @1.2 ubuntu release # features/attached_commands.feature:84 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua disable foobar` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ And I verify that running `ua disable foobar` `with sudo` exits `1` # None And stderr matches regexp # None """ Cannot disable unknown service 'foobar'. Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua disable esm-infra` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua disable esm-infra` with sudo # None Then I will see the following on stdout # None """ Updating package lists """ When I run `ua status` with sudo # None Then stdout matches regexp # None """ esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\) """ And I verify that running `apt update` `with sudo` exits `0` # None @series.all Scenario Outline: Attached disable of a service in a ubuntu machine -- @1.3 ubuntu release # features/attached_commands.feature:85 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua disable foobar` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ And I verify that running `ua disable foobar` `with sudo` exits `1` # None And stderr matches regexp # None """ Cannot disable unknown service 'foobar'. Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua disable esm-infra` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua disable esm-infra` with sudo # None Then I will see the following on stdout # None """ Updating package lists """ When I run `ua status` with sudo # None Then stdout matches regexp # None """ esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\) """ And I verify that running `apt update` `with sudo` exits `0` # None @series.all Scenario Outline: Attached detach in a trusty machine -- @1.1 ubuntu release # features/attached_commands.feature:124 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua detach` `as non-root` exits `1` # features/steps/steps.py:355 And stderr matches regexp # features/steps/steps.py:312 """ This command must be run as root \(try using sudo\). """ When I run `ua detach --assume-yes` with sudo # features/steps/steps.py:130 Then I will see the following on stdout # features/steps/steps.py:281 """ Detach will disable the following service: esm-infra Updating package lists This machine is now detached. """ When I run `ua status --all` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ SERVICE AVAILABLE DESCRIPTION cc-eal +no +Common Criteria EAL2 Provisioning Packages cis +yes +Center for Internet Security Audit Tools esm-apps +yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra +yes +UA Infra: Extended Security Maintenance \(ESM\) fips +yes +NIST-certified FIPS modules fips-updates +yes +Uncertified security updates to FIPS modules livepatch +yes +Canonical Livepatch service """ And stdout matches regexp # features/steps/steps.py:300 """ This machine is not attached to a UA subscription. """ And I verify that running `apt update` `with sudo` exits `0` # features/steps/steps.py:355 @series.all Scenario Outline: Attached detach in a trusty machine -- @1.2 ubuntu release # features/attached_commands.feature:125 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua detach` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua detach --assume-yes` with sudo # None Then I will see the following on stdout # None """ Detach will disable the following service: esm-infra Updating package lists This machine is now detached. """ When I run `ua status --all` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal +no +Common Criteria EAL2 Provisioning Packages cis +no +Center for Internet Security Audit Tools esm-apps +yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra +yes +UA Infra: Extended Security Maintenance \(ESM\) fips +no +NIST-certified FIPS modules fips-updates +no +Uncertified security updates to FIPS modules livepatch +yes +Canonical Livepatch service """ And stdout matches regexp # None """ This machine is not attached to a UA subscription. """ And I verify that running `apt update` `with sudo` exits `0` # None @series.all Scenario Outline: Attached detach in a trusty machine -- @1.3 ubuntu release # features/attached_commands.feature:126 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua detach` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua detach --assume-yes` with sudo # None Then I will see the following on stdout # None """ Detach will disable the following service: esm-infra Updating package lists This machine is now detached. """ When I run `ua status --all` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal +no +Common Criteria EAL2 Provisioning Packages cis +no +Center for Internet Security Audit Tools esm-apps +no +UA Apps: Extended Security Maintenance \(ESM\) esm-infra +yes +UA Infra: Extended Security Maintenance \(ESM\) fips +no +NIST-certified FIPS modules fips-updates +no +Uncertified security updates to FIPS modules livepatch +yes +Canonical Livepatch service """ And stdout matches regexp # None """ This machine is not attached to a UA subscription. """ And I verify that running `apt update` `with sudo` exits `0` # None @series.all Scenario Outline: Attached detach in a trusty machine -- @1.4 ubuntu release # features/attached_commands.feature:127 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua detach` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua detach --assume-yes` with sudo # None Then I will see the following on stdout # None """ Detach will disable the following service: esm-infra Updating package lists This machine is now detached. """ When I run `ua status --all` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal +yes +Common Criteria EAL2 Provisioning Packages cis +yes +Center for Internet Security Audit Tools esm-apps +yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra +yes +UA Infra: Extended Security Maintenance \(ESM\) fips +yes +NIST-certified FIPS modules fips-updates +yes +Uncertified security updates to FIPS modules livepatch +yes +Canonical Livepatch service """ And stdout matches regexp # None """ This machine is not attached to a UA subscription. """ And I verify that running `apt update` `with sudo` exits `0` # None @series.all Scenario Outline: Attached auto-attach in a ubuntu machine -- @1.1 ubuntu release # features/attached_commands.feature:146 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua auto-attach` `as non-root` exits `1` # features/steps/steps.py:355 And stderr matches regexp # features/steps/steps.py:312 """ This command must be run as root \(try using sudo\). """ When I run `ua auto-attach` with sudo # features/steps/steps.py:130 Then stderr matches regexp # features/steps/steps.py:312 """ This machine is already attached """ @series.all Scenario Outline: Attached auto-attach in a ubuntu machine -- @1.2 ubuntu release # features/attached_commands.feature:147 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua auto-attach` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua auto-attach` with sudo # None Then stderr matches regexp # None """ This machine is already attached """ @series.all Scenario Outline: Attached auto-attach in a ubuntu machine -- @1.3 ubuntu release # features/attached_commands.feature:148 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua auto-attach` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua auto-attach` with sudo # None Then stderr matches regexp # None """ This machine is already attached """ @series.all Scenario Outline: Attached auto-attach in a ubuntu machine -- @1.4 ubuntu release # features/attached_commands.feature:149 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua auto-attach` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua auto-attach` with sudo # None Then stderr matches regexp # None """ This machine is already attached """ @series.all Scenario Outline: Attached show version in a ubuntu machine -- @1.1 ubuntu release # features/attached_commands.feature:166 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 And I run `ua version` as non-root # features/steps/steps.py:130 Then I will see the uaclient version on stdout # features/steps/steps.py:322 When I run `ua version` with sudo # features/steps/steps.py:130 Then I will see the uaclient version on stdout # features/steps/steps.py:322 When I run `ua --version` as non-root # features/steps/steps.py:130 Then I will see the uaclient version on stdout # features/steps/steps.py:322 When I run `ua --version` with sudo # features/steps/steps.py:130 Then I will see the uaclient version on stdout # features/steps/steps.py:322 @series.all Scenario Outline: Attached show version in a ubuntu machine -- @1.2 ubuntu release # features/attached_commands.feature:167 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua version` as non-root # None Then I will see the uaclient version on stdout # None When I run `ua version` with sudo # None Then I will see the uaclient version on stdout # None When I run `ua --version` as non-root # None Then I will see the uaclient version on stdout # None When I run `ua --version` with sudo # None Then I will see the uaclient version on stdout # None @series.all Scenario Outline: Attached show version in a ubuntu machine -- @1.3 ubuntu release # features/attached_commands.feature:168 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua version` as non-root # None Then I will see the uaclient version on stdout # None When I run `ua version` with sudo # None Then I will see the uaclient version on stdout # None When I run `ua --version` as non-root # None Then I will see the uaclient version on stdout # None When I run `ua --version` with sudo # None Then I will see the uaclient version on stdout # None @series.all Scenario Outline: Attached show version in a ubuntu machine -- @1.4 ubuntu release # features/attached_commands.feature:169 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua version` as non-root # None Then I will see the uaclient version on stdout # None When I run `ua version` with sudo # None Then I will see the uaclient version on stdout # None When I run `ua --version` as non-root # None Then I will see the uaclient version on stdout # None When I run `ua --version` with sudo # None Then I will see the uaclient version on stdout # None @series.all Scenario Outline: Unattached status in a ubuntu machine with feature overrides -- @1.1 ubuntu release # features/attached_commands.feature:215 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I create the file `/tmp/machine-token-overlay.json` with the following # features/steps/steps.py:256 """ { "machineTokenInfo": { "contractInfo": { "resourceEntitlements": [ { "type": "cc-eal", "entitled": false } ] } } } """ And I append the following on uaclient config # features/steps/steps.py:245 """ features: machine_token_overlay: "/tmp/machine-token-overlay.json" disable_auto_attach: true other: false """ And I attach `contract_token` with sudo # features/steps/steps.py:216 And I run `ua status --all` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ SERVICE ENTITLED STATUS DESCRIPTION cc-eal no """ When I run `ua --version` as non-root # features/steps/steps.py:130 Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` # features/steps/steps.py:335 When I run `ua version` as non-root # features/steps/steps.py:130 Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` # features/steps/steps.py:335 When I run `ua auto-attach` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ Skipping auto-attach. Config disable_auto_attach is set. """ @series.all Scenario Outline: Unattached status in a ubuntu machine with feature overrides -- @1.2 ubuntu release # features/attached_commands.feature:216 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I create the file `/tmp/machine-token-overlay.json` with the following # None """ { "machineTokenInfo": { "contractInfo": { "resourceEntitlements": [ { "type": "cc-eal", "entitled": false } ] } } } """ And I append the following on uaclient config # None """ features: machine_token_overlay: "/tmp/machine-token-overlay.json" disable_auto_attach: true other: false """ And I attach `contract_token` with sudo # None And I run `ua status --all` with sudo # None Then stdout matches regexp # None """ SERVICE ENTITLED STATUS DESCRIPTION cc-eal no """ When I run `ua --version` as non-root # None Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` # None When I run `ua version` as non-root # None Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` # None When I run `ua auto-attach` with sudo # None Then stdout matches regexp # None """ Skipping auto-attach. Config disable_auto_attach is set. """ @series.all Scenario Outline: Unattached status in a ubuntu machine with feature overrides -- @1.3 ubuntu release # features/attached_commands.feature:217 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I create the file `/tmp/machine-token-overlay.json` with the following # None """ { "machineTokenInfo": { "contractInfo": { "resourceEntitlements": [ { "type": "cc-eal", "entitled": false } ] } } } """ And I append the following on uaclient config # None """ features: machine_token_overlay: "/tmp/machine-token-overlay.json" disable_auto_attach: true other: false """ And I attach `contract_token` with sudo # None And I run `ua status --all` with sudo # None Then stdout matches regexp # None """ SERVICE ENTITLED STATUS DESCRIPTION cc-eal no """ When I run `ua --version` as non-root # None Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` # None When I run `ua version` as non-root # None Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` # None When I run `ua auto-attach` with sudo # None Then stdout matches regexp # None """ Skipping auto-attach. Config disable_auto_attach is set. """ @series.all Scenario Outline: Unattached status in a ubuntu machine with feature overrides -- @1.4 ubuntu release # features/attached_commands.feature:218 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I create the file `/tmp/machine-token-overlay.json` with the following # None """ { "machineTokenInfo": { "contractInfo": { "resourceEntitlements": [ { "type": "cc-eal", "entitled": false } ] } } } """ And I append the following on uaclient config # None """ features: machine_token_overlay: "/tmp/machine-token-overlay.json" disable_auto_attach: true other: false """ And I attach `contract_token` with sudo # None And I run `ua status --all` with sudo # None Then stdout matches regexp # None """ SERVICE ENTITLED STATUS DESCRIPTION cc-eal no """ When I run `ua --version` as non-root # None Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` # None When I run `ua version` as non-root # None Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` # None When I run `ua auto-attach` with sudo # None Then stdout matches regexp # None """ Skipping auto-attach. Config disable_auto_attach is set. """ @series.all Scenario Outline: Attached disable of different services in a ubuntu machine -- @1.1 ubuntu release # features/attached_commands.feature:249 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua disable esm-infra livepatch foobar` `as non-root` exits `1` # features/steps/steps.py:355 And stderr matches regexp # features/steps/steps.py:312 """ This command must be run as root \(try using sudo\) """ And I verify that running `ua disable esm-infra livepatch foobar` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ Updating package lists Livepatch is not currently enabled See: sudo ua status """ And stderr matches regexp # features/steps/steps.py:312 """ Cannot disable unknown service 'foobar'. Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch. """ When I run `ua status` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\) """ @series.all Scenario Outline: Attached disable of different services in a ubuntu machine -- @1.2 ubuntu release # features/attached_commands.feature:250 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua disable esm-infra livepatch foobar` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\) """ And I verify that running `ua disable esm-infra livepatch foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ Updating package lists Livepatch is not currently enabled See: sudo ua status """ And stderr matches regexp # None """ Cannot disable unknown service 'foobar'. Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch. """ When I run `ua status` with sudo # None Then stdout matches regexp # None """ esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\) """ @series.all Scenario Outline: Attached disable of different services in a ubuntu machine -- @1.3 ubuntu release # features/attached_commands.feature:251 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua disable esm-infra livepatch foobar` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\) """ And I verify that running `ua disable esm-infra livepatch foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ Updating package lists Livepatch is not currently enabled See: sudo ua status """ And stderr matches regexp # None """ Cannot disable unknown service 'foobar'. Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch. """ When I run `ua status` with sudo # None Then stdout matches regexp # None """ esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\) """ @series.all Scenario Outline: Attached disable of different services in a ubuntu machine -- @1.4 ubuntu release # features/attached_commands.feature:252 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua disable esm-infra livepatch foobar` `as non-root` exits `1` # None And stderr matches regexp # None """ This command must be run as root \(try using sudo\) """ And I verify that running `ua disable esm-infra livepatch foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ Updating package lists Livepatch is not currently enabled See: sudo ua status """ And stderr matches regexp # None """ Cannot disable unknown service 'foobar'. Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch. """ When I run `ua status` with sudo # None Then stdout matches regexp # None """ esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\) """ @series.all Scenario Outline: Help command on an attached machine -- @1.1 ubuntu release # features/attached_commands.feature:378 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 And I run `ua help esm-infra` with sudo # features/steps/steps.py:130 Then I will see the following on stdout # features/steps/steps.py:281 """ Name: esm-infra Entitled: yes Status: enabled Help: esm-infra provides access to a private ppa which includes available high and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main repository between the end of the standard Ubuntu LTS security maintenance and its end of life. It is enabled by default with Extended Security Maintenance (ESM) for UA Apps and UA Infra. You can find our more about the esm service at https://ubuntu.com/security/esm """ When I run `ua help esm-infra --format json` with sudo # features/steps/steps.py:130 Then I will see the following on stdout # features/steps/steps.py:281 """ {"name": "esm-infra", "entitled": "yes", "status": "enabled", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"} """ And I verify that running `ua help invalid-service` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stderr # features/steps/steps.py:317 """ No help available for 'invalid-service' """ When I run `ua --help` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ Client to manage Ubuntu Advantage services on a machine. - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ When I run `ua help` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ Client to manage Ubuntu Advantage services on a machine. - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ When I run `ua help --all` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ Client to manage Ubuntu Advantage services on a machine. - cc-eal: Common Criteria EAL2 Provisioning Packages \(https://ubuntu.com/cc-eal\) - cis: Center for Internet Security Audit Tools \(https://ubuntu.com/security/certifications#cis\) - esm-apps: UA Apps: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ @series.all Scenario Outline: Help command on an attached machine -- @1.2 ubuntu release # features/attached_commands.feature:379 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua help esm-infra` with sudo # None Then I will see the following on stdout # None """ Name: esm-infra Entitled: yes Status: enabled Help: esm-infra provides access to a private ppa which includes available high and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main repository between the end of the standard Ubuntu LTS security maintenance and its end of life. It is enabled by default with Extended Security Maintenance (ESM) for UA Apps and UA Infra. You can find our more about the esm service at https://ubuntu.com/security/esm """ When I run `ua help esm-infra --format json` with sudo # None Then I will see the following on stdout # None """ {"name": "esm-infra", "entitled": "yes", "status": "enabled", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"} """ And I verify that running `ua help invalid-service` `with sudo` exits `1` # None And I will see the following on stderr # None """ No help available for 'invalid-service' """ When I run `ua --help` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ When I run `ua help` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ When I run `ua help --all` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - cc-eal: Common Criteria EAL2 Provisioning Packages \(https://ubuntu.com/cc-eal\) - cis: Center for Internet Security Audit Tools \(https://ubuntu.com/security/certifications#cis\) - esm-apps: UA Apps: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ @series.all Scenario Outline: Help command on an attached machine -- @1.3 ubuntu release # features/attached_commands.feature:380 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua help esm-infra` with sudo # None Then I will see the following on stdout # None """ Name: esm-infra Entitled: yes Status: enabled Help: esm-infra provides access to a private ppa which includes available high and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main repository between the end of the standard Ubuntu LTS security maintenance and its end of life. It is enabled by default with Extended Security Maintenance (ESM) for UA Apps and UA Infra. You can find our more about the esm service at https://ubuntu.com/security/esm """ When I run `ua help esm-infra --format json` with sudo # None Then I will see the following on stdout # None """ {"name": "esm-infra", "entitled": "yes", "status": "enabled", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"} """ And I verify that running `ua help invalid-service` `with sudo` exits `1` # None And I will see the following on stderr # None """ No help available for 'invalid-service' """ When I run `ua --help` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ When I run `ua help` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ When I run `ua help --all` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - cc-eal: Common Criteria EAL2 Provisioning Packages \(https://ubuntu.com/cc-eal\) - cis: Center for Internet Security Audit Tools \(https://ubuntu.com/security/certifications#cis\) - esm-apps: UA Apps: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ @series.all Scenario Outline: Help command on an attached machine -- @1.4 ubuntu release # features/attached_commands.feature:381 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua help esm-infra` with sudo # None Then I will see the following on stdout # None """ Name: esm-infra Entitled: yes Status: enabled Help: esm-infra provides access to a private ppa which includes available high and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main repository between the end of the standard Ubuntu LTS security maintenance and its end of life. It is enabled by default with Extended Security Maintenance (ESM) for UA Apps and UA Infra. You can find our more about the esm service at https://ubuntu.com/security/esm """ When I run `ua help esm-infra --format json` with sudo # None Then I will see the following on stdout # None """ {"name": "esm-infra", "entitled": "yes", "status": "enabled", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"} """ And I verify that running `ua help invalid-service` `with sudo` exits `1` # None And I will see the following on stderr # None """ No help available for 'invalid-service' """ When I run `ua --help` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ When I run `ua help` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ When I run `ua help --all` as non-root # None Then stdout matches regexp # None """ Client to manage Ubuntu Advantage services on a machine. - cc-eal: Common Criteria EAL2 Provisioning Packages \(https://ubuntu.com/cc-eal\) - cis: Center for Internet Security Audit Tools \(https://ubuntu.com/security/certifications#cis\) - esm-apps: UA Apps: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - esm-infra: UA Infra: Extended Security Maintenance \(ESM\) \(https://ubuntu.com/security/esm\) - fips-updates: Uncertified security updates to FIPS modules \(https://ubuntu.com/security/certifications#fips\) - fips: NIST-certified FIPS modules \(https://ubuntu.com/security/certifications#fips\) - livepatch: Canonical Livepatch service \(https://ubuntu.com/security/livepatch\) """ @series.all Scenario Outline: Purge package after attaching it to a machine -- @1.1 ubuntu release # features/attached_commands.feature:408 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 And I run `touch /etc/apt/preferences.d/ubuntu-esm-infra` with sudo # features/steps/steps.py:130 Then I verify that files exist matching `/var/log/ubuntu-advantage.log` # features/steps/steps.py:382 And I verify that running `test -d /var/lib/ubuntu-advantage` `with sudo` exits `0` # features/steps/steps.py:355 And I verify that files exist matching `/etc/apt/auth.conf.d/90ubuntu-advantage` # features/steps/steps.py:382 And I verify that files exist matching `/etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg` # features/steps/steps.py:382 And I verify that files exist matching `/etc/apt/sources.list.d/ubuntu-esm-infra.list` # features/steps/steps.py:382 And I verify that files exist matching `/etc/apt/preferences.d/ubuntu-esm-infra` # features/steps/steps.py:382 When I run `apt-get purge ubuntu-advantage-tools -y` with sudo, retrying exit [100] # features/steps/steps.py:109 Then stdout matches regexp # features/steps/steps.py:300 """ Purging configuration files for ubuntu-advantage-tools """ And I verify that no files exist matching `/var/log/ubuntu-advantage.log` # features/steps/steps.py:391 And I verify that no files exist matching `/var/lib/ubuntu-advantage` # features/steps/steps.py:391 And I verify that no files exist matching `/etc/apt/auth.conf.d/90ubuntu-advantage` # features/steps/steps.py:391 And I verify that no files exist matching `/etc/apt/sources.list.d/ubuntu-*` # features/steps/steps.py:391 And I verify that no files exist matching `/etc/apt/trusted.gpg.d/ubuntu-advantage-*` # features/steps/steps.py:391 And I verify that no files exist matching `/etc/apt/preferences.d/ubuntu-*` # features/steps/steps.py:391 @series.all Scenario Outline: Purge package after attaching it to a machine -- @1.2 ubuntu release # features/attached_commands.feature:409 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `touch /etc/apt/preferences.d/ubuntu-esm-infra` with sudo # None Then I verify that files exist matching `/var/log/ubuntu-advantage.log` # None And I verify that running `test -d /var/lib/ubuntu-advantage` `with sudo` exits `0` # None And I verify that files exist matching `/etc/apt/auth.conf.d/90ubuntu-advantage` # None And I verify that files exist matching `/etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg` # None And I verify that files exist matching `/etc/apt/sources.list.d/ubuntu-esm-infra.list` # None And I verify that files exist matching `/etc/apt/preferences.d/ubuntu-esm-infra` # None When I run `apt-get purge ubuntu-advantage-tools -y` with sudo, retrying exit [100] # None Then stdout matches regexp # None """ Purging configuration files for ubuntu-advantage-tools """ And I verify that no files exist matching `/var/log/ubuntu-advantage.log` # None And I verify that no files exist matching `/var/lib/ubuntu-advantage` # None And I verify that no files exist matching `/etc/apt/auth.conf.d/90ubuntu-advantage` # None And I verify that no files exist matching `/etc/apt/sources.list.d/ubuntu-*` # None And I verify that no files exist matching `/etc/apt/trusted.gpg.d/ubuntu-advantage-*` # None And I verify that no files exist matching `/etc/apt/preferences.d/ubuntu-*` # None @series.all Scenario Outline: Purge package after attaching it to a machine -- @1.3 ubuntu release # features/attached_commands.feature:410 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `touch /etc/apt/preferences.d/ubuntu-esm-infra` with sudo # None Then I verify that files exist matching `/var/log/ubuntu-advantage.log` # None And I verify that running `test -d /var/lib/ubuntu-advantage` `with sudo` exits `0` # None And I verify that files exist matching `/etc/apt/auth.conf.d/90ubuntu-advantage` # None And I verify that files exist matching `/etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg` # None And I verify that files exist matching `/etc/apt/sources.list.d/ubuntu-esm-infra.list` # None And I verify that files exist matching `/etc/apt/preferences.d/ubuntu-esm-infra` # None When I run `apt-get purge ubuntu-advantage-tools -y` with sudo, retrying exit [100] # None Then stdout matches regexp # None """ Purging configuration files for ubuntu-advantage-tools """ And I verify that no files exist matching `/var/log/ubuntu-advantage.log` # None And I verify that no files exist matching `/var/lib/ubuntu-advantage` # None And I verify that no files exist matching `/etc/apt/auth.conf.d/90ubuntu-advantage` # None And I verify that no files exist matching `/etc/apt/sources.list.d/ubuntu-*` # None And I verify that no files exist matching `/etc/apt/trusted.gpg.d/ubuntu-advantage-*` # None And I verify that no files exist matching `/etc/apt/preferences.d/ubuntu-*` # None @series.all Scenario Outline: Purge package after attaching it to a machine -- @1.4 ubuntu release # features/attached_commands.feature:411 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `touch /etc/apt/preferences.d/ubuntu-esm-infra` with sudo # None Then I verify that files exist matching `/var/log/ubuntu-advantage.log` # None And I verify that running `test -d /var/lib/ubuntu-advantage` `with sudo` exits `0` # None And I verify that files exist matching `/etc/apt/auth.conf.d/90ubuntu-advantage` # None And I verify that files exist matching `/etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg` # None And I verify that files exist matching `/etc/apt/sources.list.d/ubuntu-esm-infra.list` # None And I verify that files exist matching `/etc/apt/preferences.d/ubuntu-esm-infra` # None When I run `apt-get purge ubuntu-advantage-tools -y` with sudo, retrying exit [100] # None Then stdout matches regexp # None """ Purging configuration files for ubuntu-advantage-tools """ And I verify that no files exist matching `/var/log/ubuntu-advantage.log` # None And I verify that no files exist matching `/var/lib/ubuntu-advantage` # None And I verify that no files exist matching `/etc/apt/auth.conf.d/90ubuntu-advantage` # None And I verify that no files exist matching `/etc/apt/sources.list.d/ubuntu-*` # None And I verify that no files exist matching `/etc/apt/trusted.gpg.d/ubuntu-advantage-*` # None And I verify that no files exist matching `/etc/apt/preferences.d/ubuntu-*` # None @series.all Scenario Outline: Enable command with invalid repositories in user machine -- @1.1 ubuntu release # features/attached_commands.feature:433 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua disable esm-infra` with sudo # None And I run `add-apt-repository ppa:ua-client/staging -y` with sudo, retrying exit [1] # None And I run `apt update` with sudo # None And I run `sed -i 's/ubuntu/ubun/' /etc/apt/sources.list.d/ua-client-staging-trusty.list` with sudo # None And I run `ua enable esm-infra` with sudo # None Then stdout matches regexp # None """ One moment, checking your subscription first Updating package lists APT update failed. APT update failed to read APT config for the following URL: - http://ppa.launchpad.net/ua-client/staging/ubun """ @series.all Scenario Outline: Enable command with invalid repositories in user machine -- @1.2 ubuntu release # features/attached_commands.feature:434 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua disable esm-infra` with sudo # None And I run `add-apt-repository ppa:ua-client/staging -y` with sudo, retrying exit [1] # None And I run `apt update` with sudo # None And I run `sed -i 's/ubuntu/ubun/' /etc/apt/sources.list.d/ua-client-ubuntu-staging-xenial.list` with sudo # None And I run `ua enable esm-infra` with sudo # None Then stdout matches regexp # None """ One moment, checking your subscription first Updating package lists APT update failed. APT update failed to read APT config for the following URL: - http://ppa.launchpad.net/ua-client/staging/ubun """ @series.all Scenario Outline: Enable command with invalid repositories in user machine -- @1.3 ubuntu release # features/attached_commands.feature:435 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 And I run `ua disable esm-infra` with sudo # features/steps/steps.py:130 And I run `add-apt-repository ppa:ua-client/staging -y` with sudo, retrying exit [1] # features/steps/steps.py:109 And I run `apt update` with sudo # features/steps/steps.py:130 And I run `sed -i 's/ubuntu/ubun/' /etc/apt/sources.list.d/ua-client-ubuntu-staging-bionic.list` with sudo # features/steps/steps.py:130 And I run `ua enable esm-infra` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ One moment, checking your subscription first Updating package lists APT update failed. APT update failed to read APT config for the following URL: - http://ppa.launchpad.net/ua-client/staging/ubun """ Assertion Failed: Expected: a string matching 'One moment, checking your subscription first Updating package lists APT update failed. APT update failed to read APT config for the following URL: - http://ppa.launchpad.net/ua-client/staging/ubun' but: was 'One moment, checking your subscription first\nUpdating package lists\nUA Infra: ESM enabled' Captured stdout: --- Launching Lxd Container image local:ubuntu-behave-image-build--bionic1619714626290668-snapshot(bionic) ['lxc', 'init', 'local:ubuntu-behave-image-build--bionic1619714626290668-snapshot', 'ubuntu-behave-test-bionic-1619715543747387', '--config', 'user.meta-data=public-keys: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDAH++Mu9ZMPBhyzVZBOQUAOMD0bR2BDWF55sQZ3RAyCSAnZ0vLkFY6YqRcPneSlt8V7UoMa+h1snq/7fJCDASDAY5FjilHUVLgpbBmamx5KCotWHJHjhDCjQ1MWpU472uJn1CA/AcQoAHWRZ3pGkjQRzBMUFo49bCg3MYbBYaAWeLfULM6yVyu7lyte+1iydE3aole2ApFWtAQ9GCuGAizPXVFIy+wvoz1SR/8xm4zA8EzwPilmwec1ba8a5TnXk6ekTYYaJ8tbDPZilZBPUYKM25ii/v1v7BsTW5jrBhqN/5so76W3E6ADMY1gZ/eUw2bGCpK6WhYw04UEzxnCiP7R9Pef4tIxdtsXUjr3k/x3vvapS6vBG1XmC8i/cERuyDyjd8lK6kfTBKEadc42OVeRIe00iZhIgxHUtxmjpLmu4Db8xyRAAVXk4/bAkEeP/MjH19QeP0jCScESPMmH3UA+QNhRHpAKYmAJEGD1/C3NTxWU37GjzzbOdj+Lz9MCFkTn+gsimkA/jp/bLYG0dkhS80u0yOwm2CxhOorpqclf0zghlggcNJCs7YJF/gmqLDzEtfUyTQUnrKLoLi0PU86SVLXR92otNvOfeyoOxdvCX+BPmL7muCx9bs4R26V0j4CtrZ5KPS4MKxfg/wqBg37IYpKsoW35YCQlWSUVYKGSw=='] --- lxd-container instance launched: ubuntu-behave-test-bionic-1619715543747387. Waiting for ssh access --- cloud-init succeeded --- instance ip: 10.121.212.31 -- pull instance:/etc/ubuntu-advantage/uaclient.log artifacts/attached_commands.feature_422/uaclient.log -- pull instance:/var/log/cloud-init.log artifacts/attached_commands.feature_422/cloud-init.log -- pull instance:/var/log/ubuntu-advantage.log artifacts/attached_commands.feature_422/ubuntu-advantage.log -- pull instance:/var/lib/cloud/instance/user-data.txt artifacts/attached_commands.feature_422/user-data.txt -- pull instance:/var/lib/cloud/instance/vendor-data.txt artifacts/attached_commands.feature_422/vendor-data.txt Captured logging: INFO:pycloudlib.instance:executing: sh -c whoami INFO:pycloudlib.instance:[Errno None] Unable to connect to port 22 on 10.121.212.31 Retrying SSH connection to ubuntu@10.121.212.31:22 (597s left) INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_7.6p1) INFO:paramiko.transport:Authentication (publickey) successful! INFO:pycloudlib.instance:executing: sh -c 'cloud-init status --help' INFO:pycloudlib.instance:executing: cloud-init status --wait --long INFO:pycloudlib.instance:executing: sh -c whoami INFO:pycloudlib.instance:executing: sh -c 'cloud-init status --help' INFO:pycloudlib.instance:executing: cloud-init status --wait --long INFO:pycloudlib.instance:executing: cloud-init status --wait --long WARNING:root:--- instance ip: 10.121.212.31 INFO:pycloudlib.instance:executing: sudo ua attach INFO:pycloudlib.instance:executing: sudo ua disable esm-infra INFO:pycloudlib.instance:executing: sudo add-apt-repository ppa:ua-client/staging -y INFO:pycloudlib.instance:executing: sudo apt update INFO:pycloudlib.instance:executing: sudo sed -i s/ubuntu/ubun/ /etc/apt/sources.list.d/ua-client-ubuntu-staging-bionic.list INFO:pycloudlib.instance:executing: sudo ua enable esm-infra INFO:pycloudlib.instance:executing: sudo -- cat /etc/ubuntu-advantage/uaclient.log INFO:pycloudlib.instance:executing: sudo -- cat /var/log/cloud-init.log INFO:pycloudlib.instance:executing: sudo -- cat /var/log/ubuntu-advantage.log INFO:pycloudlib.instance:executing: sudo -- cat /var/lib/cloud/instance/user-data.txt INFO:pycloudlib.instance:executing: sudo -- cat /var/lib/cloud/instance/vendor-data.txt INFO:pycloudlib.instance:executing: sudo -- ua version INFO:pycloudlib.instance:executing: sudo -- cloud-init analyze show INFO:pycloudlib.instance:executing: sudo -- cloud-init status --long INFO:pycloudlib.instance:executing: sudo -- ua status --all --format=json INFO:pycloudlib.instance:executing: sudo -- journalctl -b 0 INFO:pycloudlib.instance:executing: sudo -- systemd-analyze blame INFO:pycloudlib.instance:executing: sudo -- systemctl status INFO:pycloudlib.instance:executing: sudo -- systemctl status ua-auto-attach.service INFO:pycloudlib.instance:executing: sudo -- systemctl status ua-reboot-cmds.service @series.all Scenario Outline: Enable command with invalid repositories in user machine -- @1.4 ubuntu release # features/attached_commands.feature:436 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None And I run `ua disable esm-infra` with sudo # None And I run `add-apt-repository ppa:ua-client/staging -y` with sudo, retrying exit [1] # None And I run `apt update` with sudo # None And I run `sed -i 's/ubuntu/ubun/' /etc/apt/sources.list.d/ua-client-ubuntu-staging-focal.list` with sudo # None And I run `ua enable esm-infra` with sudo # None Then stdout matches regexp # None """ One moment, checking your subscription first Updating package lists APT update failed. APT update failed to read APT config for the following URL: - http://ppa.launchpad.net/ua-client/staging/ubun """ @uses.config.contract_token Feature: Enable command behaviour when attached to an UA subscription # features/attached_enable.feature:2 @series.all Scenario Outline: Attached enable Common Criteria service in a ubuntu machine -- @1.1 ubuntu release # features/attached_enable.feature:32 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua enable cc-eal` `as non-root` exits `1` # features/steps/steps.py:355 And I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ And I verify that running `ua enable cc-eal --beta` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first CC EAL2 is not available for Ubuntu 18.04 LTS (Bionic Beaver). """ And I verify that running `ua enable cc-eal` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first """ And stderr matches regexp # features/steps/steps.py:312 """ Cannot enable unknown service 'cc-eal'. Try esm-infra, fips, fips-updates, livepatch. """ @series.all Scenario Outline: Attached enable Common Criteria service in a ubuntu machine -- @1.2 ubuntu release # features/attached_enable.feature:33 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable cc-eal` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable cc-eal --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first CC EAL2 is not available for Ubuntu 20.04 LTS (Focal Fossa). """ And I verify that running `ua enable cc-eal` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first """ And stderr matches regexp # None """ Cannot enable unknown service 'cc-eal'. Try esm-infra, fips, fips-updates, livepatch. """ @series.all Scenario Outline: Attached enable Common Criteria service in a ubuntu machine -- @1.3 ubuntu release # features/attached_enable.feature:34 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable cc-eal` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable cc-eal --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first CC EAL2 is not available for Ubuntu 14.04 LTS (Trusty Tahr). """ And I verify that running `ua enable cc-eal` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first """ And stderr matches regexp # None """ Cannot enable unknown service 'cc-eal'. Try esm-infra, fips, fips-updates, livepatch. """ @series.all Scenario Outline: Attached enable of a service in a ubuntu machine -- @1.1 ubuntu release # features/attached_enable.feature:88 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua enable foobar` `as non-root` exits `1` # features/steps/steps.py:355 And I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ And I verify that running `ua enable foobar` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first """ And stderr matches regexp # features/steps/steps.py:312 """ Cannot enable unknown service 'foobar'. Try esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua enable cc-eal foobar` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first """ And stderr matches regexp # features/steps/steps.py:312 """ Cannot enable unknown service 'foobar, cc-eal'. Try esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua enable esm-infra` `with sudo` exits `1` # features/steps/steps.py:355 Then I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first UA Infra: ESM is already enabled. See: sudo ua status """ When I run `apt-cache policy` with sudo # features/steps/steps.py:130 Then apt-cache policy for the following url has permission `500` # features/steps/steps.py:374 """ https://esm.ubuntu.com/infra/ubuntu bionic-infra-updates/main amd64 Packages """ And I verify that running `apt update` `with sudo` exits `0` # features/steps/steps.py:355 When I run `apt install -y libkrad0` with sudo, retrying exit [100] # features/steps/steps.py:109 And I run `apt-cache policy libkrad0` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ \s*500 https://esm.ubuntu.com/infra/ubuntu bionic-infra-security/main amd64 Packages \s*500 https://esm.ubuntu.com/infra/ubuntu bionic-infra-updates/main amd64 Packages """ @series.all Scenario Outline: Attached enable of a service in a ubuntu machine -- @1.2 ubuntu release # features/attached_enable.feature:89 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable foobar` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first """ And stderr matches regexp # None """ Cannot enable unknown service 'foobar'. Try esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua enable cc-eal foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first """ And stderr matches regexp # None """ Cannot enable unknown service 'foobar, cc-eal'. Try esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua enable esm-infra` `with sudo` exits `1` # None Then I will see the following on stdout # None """ One moment, checking your subscription first UA Infra: ESM is already enabled. See: sudo ua status """ When I run `apt-cache policy` with sudo # None Then apt-cache policy for the following url has permission `500` # None """ https://esm.ubuntu.com/infra/ubuntu focal-infra-updates/main amd64 Packages """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt install -y hello` with sudo, retrying exit [100] # None And I run `apt-cache policy hello` as non-root # None Then stdout matches regexp # None """ \s*500 https://esm.ubuntu.com/infra/ubuntu focal-infra-security/main amd64 Packages \s*500 https://esm.ubuntu.com/infra/ubuntu focal-infra-updates/main amd64 Packages """ @series.all Scenario Outline: Attached enable of a service in a ubuntu machine -- @1.3 ubuntu release # features/attached_enable.feature:90 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable foobar` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first """ And stderr matches regexp # None """ Cannot enable unknown service 'foobar'. Try esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua enable cc-eal foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first """ And stderr matches regexp # None """ Cannot enable unknown service 'foobar, cc-eal'. Try esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua enable esm-infra` `with sudo` exits `1` # None Then I will see the following on stdout # None """ One moment, checking your subscription first UA Infra: ESM is already enabled. See: sudo ua status """ When I run `apt-cache policy` with sudo # None Then apt-cache policy for the following url has permission `500` # None """ https://esm.ubuntu.com/ubuntu/ trusty-infra-updates/main amd64 Packages """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt install -y libgit2-0` with sudo, retrying exit [100] # None And I run `apt-cache policy libgit2-0` as non-root # None Then stdout matches regexp # None """ \s*500 https://esm.ubuntu.com/ubuntu/ trusty-infra-security/main amd64 Packages \s*500 https://esm.ubuntu.com/ubuntu/ trusty-infra-updates/main amd64 Packages """ @series.all Scenario Outline: Attached enable of a service in a ubuntu machine -- @1.4 ubuntu release # features/attached_enable.feature:91 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable foobar` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first """ And stderr matches regexp # None """ Cannot enable unknown service 'foobar'. Try esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua enable cc-eal foobar` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first """ And stderr matches regexp # None """ Cannot enable unknown service 'foobar, cc-eal'. Try esm-infra, fips, fips-updates, livepatch. """ And I verify that running `ua enable esm-infra` `with sudo` exits `1` # None Then I will see the following on stdout # None """ One moment, checking your subscription first UA Infra: ESM is already enabled. See: sudo ua status """ When I run `apt-cache policy` with sudo # None Then apt-cache policy for the following url has permission `500` # None """ https://esm.ubuntu.com/infra/ubuntu xenial-infra-updates/main amd64 Packages """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt install -y libkrad0` with sudo, retrying exit [100] # None And I run `apt-cache policy libkrad0` as non-root # None Then stdout matches regexp # None """ \s*500 https://esm.ubuntu.com/infra/ubuntu xenial-infra-security/main amd64 Packages \s*500 https://esm.ubuntu.com/infra/ubuntu xenial-infra-updates/main amd64 Packages """ @series.all @uses.config.machine_type.lxd.container Scenario Outline: Attached enable of non-container services in a ubuntu lxd container -- @1.1 Un-supported services in containers # features/attached_enable.feature:124 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua enable livepatch` `as non-root` exits `1` # features/steps/steps.py:355 And I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ And I verify that running `ua enable livepatch` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first Cannot install Livepatch on a container. """ And I verify that running `ua enable fips --assume-yes` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first Cannot install FIPS on a container. """ And I verify that running `ua enable fips-updates --assume-yes` `with sudo` exits `1` # features/steps/steps.py:355 And I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first Cannot install FIPS Updates on a container. """ @series.all @uses.config.machine_type.lxd.container Scenario Outline: Attached enable of non-container services in a ubuntu lxd container -- @1.2 Un-supported services in containers # features/attached_enable.feature:125 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable livepatch` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable livepatch` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install Livepatch on a container. """ And I verify that running `ua enable fips --assume-yes` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install FIPS on a container. """ And I verify that running `ua enable fips-updates --assume-yes` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install FIPS Updates on a container. """ @series.all @uses.config.machine_type.lxd.container Scenario Outline: Attached enable of non-container services in a ubuntu lxd container -- @1.3 Un-supported services in containers # features/attached_enable.feature:126 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable livepatch` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable livepatch` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install Livepatch on a container. """ And I verify that running `ua enable fips --assume-yes` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install FIPS on a container. """ And I verify that running `ua enable fips-updates --assume-yes` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install FIPS Updates on a container. """ @series.all @uses.config.machine_type.lxd.container Scenario Outline: Attached enable of non-container services in a ubuntu lxd container -- @1.4 Un-supported services in containers # features/attached_enable.feature:127 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable livepatch` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable livepatch` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install Livepatch on a container. """ And I verify that running `ua enable fips --assume-yes` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install FIPS on a container. """ And I verify that running `ua enable fips-updates --assume-yes` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first Cannot install FIPS Updates on a container. """ @series.all Scenario Outline: Attached enable not entitled service in a ubuntu machine -- @1.1 not entitled services # features/attached_enable.feature:155 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # features/steps/steps.py:216 Then I verify that running `ua enable ` `as non-root` exits `1` # features/steps/steps.py:355 And I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ And I verify that running `ua enable cis --beta` `with sudo` exits `1` # features/steps/steps.py:355 Traceback (most recent call last): File "/home/lucasmoura/projects/ubuntu-advantage-client/.tox/behave-lxd-18.04/lib/python3.8/site-packages/behave/model.py", line 1329, in run match.run(runner.context) File "/home/lucasmoura/projects/ubuntu-advantage-client/.tox/behave-lxd-18.04/lib/python3.8/site-packages/behave/matchers.py", line 98, in run self.func(context, *args, **kwargs) File "features/steps/steps.py", line 362, in then_i_verify_that_running_cmd_with_spec_exits_with_codes assert str(context.process.returncode) in expected_codes AssertionError Captured stdout: --- Launching Lxd Container image local:ubuntu-behave-image-build--bionic1619714626290668-snapshot(bionic) ['lxc', 'init', 'local:ubuntu-behave-image-build--bionic1619714626290668-snapshot', 'ubuntu-behave-test-bionic-1619715870485390', '--config', 'user.meta-data=public-keys: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDAH++Mu9ZMPBhyzVZBOQUAOMD0bR2BDWF55sQZ3RAyCSAnZ0vLkFY6YqRcPneSlt8V7UoMa+h1snq/7fJCDASDAY5FjilHUVLgpbBmamx5KCotWHJHjhDCjQ1MWpU472uJn1CA/AcQoAHWRZ3pGkjQRzBMUFo49bCg3MYbBYaAWeLfULM6yVyu7lyte+1iydE3aole2ApFWtAQ9GCuGAizPXVFIy+wvoz1SR/8xm4zA8EzwPilmwec1ba8a5TnXk6ekTYYaJ8tbDPZilZBPUYKM25ii/v1v7BsTW5jrBhqN/5so76W3E6ADMY1gZ/eUw2bGCpK6WhYw04UEzxnCiP7R9Pef4tIxdtsXUjr3k/x3vvapS6vBG1XmC8i/cERuyDyjd8lK6kfTBKEadc42OVeRIe00iZhIgxHUtxmjpLmu4Db8xyRAAVXk4/bAkEeP/MjH19QeP0jCScESPMmH3UA+QNhRHpAKYmAJEGD1/C3NTxWU37GjzzbOdj+Lz9MCFkTn+gsimkA/jp/bLYG0dkhS80u0yOwm2CxhOorpqclf0zghlggcNJCs7YJF/gmqLDzEtfUyTQUnrKLoLi0PU86SVLXR92otNvOfeyoOxdvCX+BPmL7muCx9bs4R26V0j4CtrZ5KPS4MKxfg/wqBg37IYpKsoW35YCQlWSUVYKGSw=='] --- lxd-container instance launched: ubuntu-behave-test-bionic-1619715870485390. Waiting for ssh access --- cloud-init succeeded --- instance ip: 10.121.212.72 -- pull instance:/etc/ubuntu-advantage/uaclient.log artifacts/attached_enable.feature_138/uaclient.log -- pull instance:/var/log/cloud-init.log artifacts/attached_enable.feature_138/cloud-init.log -- pull instance:/var/log/ubuntu-advantage.log artifacts/attached_enable.feature_138/ubuntu-advantage.log -- pull instance:/var/lib/cloud/instance/user-data.txt artifacts/attached_enable.feature_138/user-data.txt -- pull instance:/var/lib/cloud/instance/vendor-data.txt artifacts/attached_enable.feature_138/vendor-data.txt Captured logging: INFO:pycloudlib.instance:executing: sh -c whoami INFO:pycloudlib.instance:[Errno None] Unable to connect to port 22 on 10.121.212.72 Retrying SSH connection to ubuntu@10.121.212.72:22 (597s left) INFO:pycloudlib.instance:[Errno None] Unable to connect to port 22 on 10.121.212.72 Retrying SSH connection to ubuntu@10.121.212.72:22 (596s left) INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_7.6p1) INFO:paramiko.transport:Authentication (publickey) successful! INFO:pycloudlib.instance:executing: sh -c 'cloud-init status --help' INFO:pycloudlib.instance:executing: cloud-init status --wait --long INFO:pycloudlib.instance:executing: sh -c whoami INFO:pycloudlib.instance:executing: sh -c 'cloud-init status --help' INFO:pycloudlib.instance:executing: cloud-init status --wait --long INFO:pycloudlib.instance:executing: cloud-init status --wait --long WARNING:root:--- instance ip: 10.121.212.72 INFO:pycloudlib.instance:executing: sudo ua attach INFO:pycloudlib.instance:executing: ua enable '' INFO:pycloudlib.instance:executing: sudo ua enable cis --beta INFO:pycloudlib.instance:executing: sudo -- cat /etc/ubuntu-advantage/uaclient.log INFO:pycloudlib.instance:executing: sudo -- cat /var/log/cloud-init.log INFO:pycloudlib.instance:executing: sudo -- cat /var/log/ubuntu-advantage.log INFO:pycloudlib.instance:executing: sudo -- cat /var/lib/cloud/instance/user-data.txt INFO:pycloudlib.instance:executing: sudo -- cat /var/lib/cloud/instance/vendor-data.txt INFO:pycloudlib.instance:executing: sudo -- ua version INFO:pycloudlib.instance:executing: sudo -- cloud-init analyze show INFO:pycloudlib.instance:executing: sudo -- cloud-init status --long INFO:pycloudlib.instance:executing: sudo -- ua status --all --format=json INFO:pycloudlib.instance:executing: sudo -- journalctl -b 0 INFO:pycloudlib.instance:executing: sudo -- systemd-analyze blame INFO:pycloudlib.instance:executing: sudo -- systemctl status INFO:pycloudlib.instance:executing: sudo -- systemctl status ua-auto-attach.service INFO:pycloudlib.instance:executing: sudo -- systemctl status ua-reboot-cmds.service And I will see the following on stdout # None """ One moment, checking your subscription first This subscription is not entitled to CIS Audit For more information see: https://ubuntu.com/advantage. """ And I verify that running `ua enable esm-apps --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first This subscription is not entitled to UA Apps: ESM For more information see: https://ubuntu.com/advantage. """ @series.all Scenario Outline: Attached enable not entitled service in a ubuntu machine -- @1.2 not entitled services # features/attached_enable.feature:156 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable ` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable cis --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first This subscription is not entitled to CIS Audit For more information see: https://ubuntu.com/advantage. """ And I verify that running `ua enable esm-apps --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first This subscription is not entitled to UA Apps: ESM For more information see: https://ubuntu.com/advantage. """ @series.all Scenario Outline: Attached enable not entitled service in a ubuntu machine -- @1.3 not entitled services # features/attached_enable.feature:157 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token` with sudo # None Then I verify that running `ua enable ` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable cis --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first This subscription is not entitled to CIS Audit For more information see: https://ubuntu.com/advantage. """ And I verify that running `ua enable esm-apps --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first This subscription is not entitled to UA Apps: ESM For more information see: https://ubuntu.com/advantage. """ @series.all Scenario Outline: Attached enable not entitled service in a ubuntu machine -- @1.4 not entitled services # features/attached_enable.feature:158 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 SKIP Scenario Attached enable of vm-based services in a bionic lxd vm -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable of vm-based services in a bionic lxd vm -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable livepatch on a machine with fips active -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable livepatch on a machine with fips active -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable fips on a machine with livepatch active: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable livepatch on a machine with fips active: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable fips on a machine with livepatch active -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable fips on a machine with livepatch active -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable fips on a machine with fips-updates active -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable fips on a machine with fips-updates active -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm When I attach `contract_token` with sudo # None Then I verify that running `ua enable ` `as non-root` exits `1` # None And I will see the following on stderr # None """ This command must be run as root (try using sudo). """ And I verify that running `ua enable cis --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first This subscription is not entitled to CIS Audit For more information see: https://ubuntu.com/advantage. """ And I verify that running `ua enable esm-apps --beta` `with sudo` exits `1` # None And I will see the following on stdout # None """ One moment, checking your subscription first This subscription is not entitled to UA Apps: ESM For more information see: https://ubuntu.com/advantage. """ @uses.config.contract_token_staging Feature: Enable command behaviour when attached to an UA staging subscription # features/staging_commands.feature:2 @series.xenial @series.bionic @series.focal Scenario Outline: Attached enable esm-apps on a machine -- @1.1 ubuntu release # features/staging_commands.feature:100 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token_staging` with sudo # features/steps/steps.py:216 And I run `ua status --all` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ esm-apps yes enabled UA Apps: Extended Security Maintenance \(ESM\) """ And I verify that running `apt update` `with sudo` exits `0` # features/steps/steps.py:355 When I run `apt-cache policy` as non-root # features/steps/steps.py:130 Then apt-cache policy for the following url has permission `500` # features/steps/steps.py:374 """ https://esm.staging.ubuntu.com/apps/ubuntu bionic-apps-updates/main amd64 Packages """ And apt-cache policy for the following url has permission `500` # features/steps/steps.py:374 """ https://esm.staging.ubuntu.com/apps/ubuntu bionic-apps-security/main amd64 Packages """ And I verify that running `apt update` `with sudo` exits `0` # features/steps/steps.py:355 When I run `apt install -y bundler` with sudo, retrying exit [100] # features/steps/steps.py:109 And I run `apt-cache policy bundler` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ Version table: \s*\*\*\* .* 500 \s*500 https://esm.staging.ubuntu.com/apps/ubuntu bionic-apps-security/main amd64 Packages """ When I run `mkdir -p /var/lib/ubuntu-advantage/messages` with sudo # features/steps/steps.py:130 When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-infra.tmpl` with the following # features/steps/steps.py:256 """ esm-infra-no {ESM_INFRA_PKG_COUNT}:{ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl` with the following # features/steps/steps.py:256 """ esm-infra {ESM_INFRA_PKG_COUNT}:{ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps.tmpl` with the following # features/steps/steps.py:256 """ esm-apps {ESM_APPS_PKG_COUNT}:{ESM_APPS_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-apps.tmpl` with the following # features/steps/steps.py:256 """ esm-apps-no {ESM_APPS_PKG_COUNT}:{ESM_APPS_PACKAGES} """ When I run `/usr/lib/ubuntu-advantage/apt-esm-hook process-templates` with sudo # features/steps/steps.py:130 When I run `cat /var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ esm-apps(-no)? \d+:(.*)? """ When I run `cat /var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ esm-infra(-no)? \d+:(.*)? """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl` with the following # features/steps/steps.py:256 """ esm-infra {ESM_INFRA_PKG_COUNT} {ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-infra.tmpl` with the following # features/steps/steps.py:256 """ esm-infra-no {ESM_INFRA_PKG_COUNT} {ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps.tmpl` with the following # features/steps/steps.py:256 """ esm-apps {ESM_APPS_PKG_COUNT} {ESM_APPS_PACKAGES} """ When I run `apt upgrade --dry-run` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ esm-apps(-no)? \d+.* esm-infra(-no)? \d+.* """ @series.xenial @series.bionic @series.focal Scenario Outline: Attached enable esm-apps on a machine -- @1.2 ubuntu release # features/staging_commands.feature:101 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token_staging` with sudo # None And I run `ua status --all` as non-root # None Then stdout matches regexp # None """ esm-apps yes enabled UA Apps: Extended Security Maintenance \(ESM\) """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt-cache policy` as non-root # None Then apt-cache policy for the following url has permission `500` # None """ https://esm.staging.ubuntu.com/apps/ubuntu focal-apps-updates/main amd64 Packages """ And apt-cache policy for the following url has permission `500` # None """ https://esm.staging.ubuntu.com/apps/ubuntu focal-apps-security/main amd64 Packages """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt install -y ant` with sudo, retrying exit [100] # None And I run `apt-cache policy ant` as non-root # None Then stdout matches regexp # None """ Version table: \s*\*\*\* .* 500 \s*500 https://esm.staging.ubuntu.com/apps/ubuntu focal-apps-security/main amd64 Packages """ When I run `mkdir -p /var/lib/ubuntu-advantage/messages` with sudo # None When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-infra.tmpl` with the following # None """ esm-infra-no {ESM_INFRA_PKG_COUNT}:{ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl` with the following # None """ esm-infra {ESM_INFRA_PKG_COUNT}:{ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps.tmpl` with the following # None """ esm-apps {ESM_APPS_PKG_COUNT}:{ESM_APPS_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-apps.tmpl` with the following # None """ esm-apps-no {ESM_APPS_PKG_COUNT}:{ESM_APPS_PACKAGES} """ When I run `/usr/lib/ubuntu-advantage/apt-esm-hook process-templates` with sudo # None When I run `cat /var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps` with sudo # None Then stdout matches regexp # None """ esm-apps(-no)? \d+:(.*)? """ When I run `cat /var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra` with sudo # None Then stdout matches regexp # None """ esm-infra(-no)? \d+:(.*)? """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl` with the following # None """ esm-infra {ESM_INFRA_PKG_COUNT} {ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-infra.tmpl` with the following # None """ esm-infra-no {ESM_INFRA_PKG_COUNT} {ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps.tmpl` with the following # None """ esm-apps {ESM_APPS_PKG_COUNT} {ESM_APPS_PACKAGES} """ When I run `apt upgrade --dry-run` with sudo # None Then stdout matches regexp # None """ esm-apps(-no)? \d+.* esm-infra(-no)? \d+.* """ @series.xenial @series.bionic @series.focal Scenario Outline: Attached enable esm-apps on a machine -- @1.3 ubuntu release # features/staging_commands.feature:102 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token_staging` with sudo # None And I run `ua status --all` as non-root # None Then stdout matches regexp # None """ esm-apps yes enabled UA Apps: Extended Security Maintenance \(ESM\) """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt-cache policy` as non-root # None Then apt-cache policy for the following url has permission `500` # None """ https://esm.staging.ubuntu.com/apps/ubuntu trusty-apps-updates/main amd64 Packages """ And apt-cache policy for the following url has permission `500` # None """ https://esm.staging.ubuntu.com/apps/ubuntu trusty-apps-security/main amd64 Packages """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt install -y ant` with sudo, retrying exit [100] # None And I run `apt-cache policy ant` as non-root # None Then stdout matches regexp # None """ Version table: \s*\*\*\* .* 500 \s*500 https://esm.staging.ubuntu.com/apps/ubuntu trusty-apps-security/main amd64 Packages """ When I run `mkdir -p /var/lib/ubuntu-advantage/messages` with sudo # None When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-infra.tmpl` with the following # None """ esm-infra-no {ESM_INFRA_PKG_COUNT}:{ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl` with the following # None """ esm-infra {ESM_INFRA_PKG_COUNT}:{ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps.tmpl` with the following # None """ esm-apps {ESM_APPS_PKG_COUNT}:{ESM_APPS_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-apps.tmpl` with the following # None """ esm-apps-no {ESM_APPS_PKG_COUNT}:{ESM_APPS_PACKAGES} """ When I run `/usr/lib/ubuntu-advantage/apt-esm-hook process-templates` with sudo # None When I run `cat /var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps` with sudo # None Then stdout matches regexp # None """ esm-apps(-no)? \d+:(.*)? """ When I run `cat /var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra` with sudo # None Then stdout matches regexp # None """ esm-infra(-no)? \d+:(.*)? """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl` with the following # None """ esm-infra {ESM_INFRA_PKG_COUNT} {ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-infra.tmpl` with the following # None """ esm-infra-no {ESM_INFRA_PKG_COUNT} {ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps.tmpl` with the following # None """ esm-apps {ESM_APPS_PKG_COUNT} {ESM_APPS_PACKAGES} """ When I run `apt upgrade --dry-run` with sudo # None Then stdout matches regexp # None """ esm-apps(-no)? \d+.* esm-infra(-no)? \d+.* """ @series.xenial @series.bionic @series.focal Scenario Outline: Attached enable esm-apps on a machine -- @1.4 ubuntu release # features/staging_commands.feature:103 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 SKIP Scenario Attached enable of vm-based services in an ubuntu lxd vm -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable of vm-based services in an ubuntu lxd vm -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable of vm-based services in an ubuntu lxd vm -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable of vm-based services in an ubuntu lxd vm -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm When I attach `contract_token_staging` with sudo # None And I run `ua status --all` as non-root # None Then stdout matches regexp # None """ esm-apps yes enabled UA Apps: Extended Security Maintenance \(ESM\) """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt-cache policy` as non-root # None Then apt-cache policy for the following url has permission `500` # None """ https://esm.staging.ubuntu.com/apps/ubuntu xenial-apps-updates/main amd64 Packages """ And apt-cache policy for the following url has permission `500` # None """ https://esm.staging.ubuntu.com/apps/ubuntu xenial-apps-security/main amd64 Packages """ And I verify that running `apt update` `with sudo` exits `0` # None When I run `apt install -y jq` with sudo, retrying exit [100] # None And I run `apt-cache policy jq` as non-root # None Then stdout matches regexp # None """ Version table: \s*\*\*\* .* 500 \s*500 https://esm.staging.ubuntu.com/apps/ubuntu xenial-apps-security/main amd64 Packages """ When I run `mkdir -p /var/lib/ubuntu-advantage/messages` with sudo # None When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-infra.tmpl` with the following # None """ esm-infra-no {ESM_INFRA_PKG_COUNT}:{ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl` with the following # None """ esm-infra {ESM_INFRA_PKG_COUNT}:{ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps.tmpl` with the following # None """ esm-apps {ESM_APPS_PKG_COUNT}:{ESM_APPS_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-apps.tmpl` with the following # None """ esm-apps-no {ESM_APPS_PKG_COUNT}:{ESM_APPS_PACKAGES} """ When I run `/usr/lib/ubuntu-advantage/apt-esm-hook process-templates` with sudo # None When I run `cat /var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps` with sudo # None Then stdout matches regexp # None """ esm-apps(-no)? \d+:(.*)? """ When I run `cat /var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra` with sudo # None Then stdout matches regexp # None """ esm-infra(-no)? \d+:(.*)? """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl` with the following # None """ esm-infra {ESM_INFRA_PKG_COUNT} {ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-no-packages-infra.tmpl` with the following # None """ esm-infra-no {ESM_INFRA_PKG_COUNT} {ESM_INFRA_PACKAGES} """ When I create the file `/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-apps.tmpl` with the following # None """ esm-apps {ESM_APPS_PKG_COUNT} {ESM_APPS_PACKAGES} """ When I run `apt upgrade --dry-run` with sudo # None Then stdout matches regexp # None """ esm-apps(-no)? \d+.* esm-infra(-no)? \d+.* """ @series.xenial @series.bionic Scenario Outline: Attached enable of cis service in a ubuntu machine -- @1.1 not entitled services # features/staging_commands.feature:375 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I attach `contract_token_staging` with sudo # features/steps/steps.py:216 And I verify that running `ua enable cis --beta` `with sudo` exits `0` # features/steps/steps.py:365 Then I will see the following on stdout # features/steps/steps.py:281 """ One moment, checking your subscription first Updating package lists Installing CIS Audit packages CIS Audit enabled """ When I run `apt-cache policy usg-cisbenchmark` as non-root # features/steps/steps.py:130 Then stdout does not match regexp # features/steps/steps.py:305 """ .*Installed: \(none\) """ And stdout matches regexp # features/steps/steps.py:300 """ \s* 500 https://esm.staging.ubuntu.com/cis/ubuntu bionic/main amd64 Packages """ When I run `apt-cache policy usg-common` as non-root # features/steps/steps.py:130 Then stdout does not match regexp # features/steps/steps.py:305 """ .*Installed: \(none\) """ And stdout matches regexp # features/steps/steps.py:300 """ \s* 500 https://esm.staging.ubuntu.com/cis/ubuntu bionic/main amd64 Packages """ @series.xenial @series.bionic Scenario Outline: Attached enable of cis service in a ubuntu machine -- @1.2 not entitled services # features/staging_commands.feature:376 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 SKIP Scenario Attached enable fips-updates on fips enabled vm -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm SKIP Scenario Attached enable fips-updates on fips enabled vm -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: lxd.vm When I attach `contract_token_staging` with sudo # None And I verify that running `ua enable cis --beta` `with sudo` exits `0` # None Then I will see the following on stdout # None """ One moment, checking your subscription first Updating package lists Installing CIS Audit packages CIS Audit enabled """ When I run `apt-cache policy usg-cisbenchmark` as non-root # None Then stdout does not match regexp # None """ .*Installed: \(none\) """ And stdout matches regexp # None """ \s* 500 https://esm.staging.ubuntu.com/cis/ubuntu xenial/main amd64 Packages """ When I run `apt-cache policy usg-common` as non-root # None Then stdout does not match regexp # None """ .*Installed: \(none\) """ And stdout matches regexp # None """ \s* 500 https://esm.staging.ubuntu.com/cis/ubuntu xenial/main amd64 Packages """ Feature: Command behaviour when attached to an UA subscription # features/ubuntu_pro.feature:1 SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: aws.pro SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: aws.pro SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.3 ubuntu release: Skipped: machine type lxd.container was not found in tags: aws.pro SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: azure.pro SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: azure.pro SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.3 ubuntu release: Skipped: machine type lxd.container was not found in tags: azure.pro SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.1 ubuntu release: Skipped: machine type lxd.container was not found in tags: gcp.pro SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.2 ubuntu release: Skipped: machine type lxd.container was not found in tags: gcp.pro SKIP Scenario Attached refresh in an Ubuntu PRO machine -- @1.3 ubuntu release: Skipped: machine type lxd.container was not found in tags: gcp.pro Feature: Command behaviour when unattached # features/unattached_commands.feature:1 @series.all Scenario Outline: Unattached auto-attach does nothing in a ubuntu machine -- @1.1 ubuntu release # features/unattached_commands.feature:20 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua auto-attach` `as non-root` exits `1` # features/steps/steps.py:365 Then stderr matches regexp # features/steps/steps.py:312 """ This command must be run as root \(try using sudo\). """ When I run `ua auto-attach` with sudo # features/steps/steps.py:130 Then stderr matches regexp # features/steps/steps.py:312 """ Auto-attach image support is not available on lxd See: https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached auto-attach does nothing in a ubuntu machine -- @1.2 ubuntu release # features/unattached_commands.feature:21 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua auto-attach` `as non-root` exits `1` # None Then stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua auto-attach` with sudo # None Then stderr matches regexp # None """ Auto-attach image support is not available on lxd See: https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached auto-attach does nothing in a ubuntu machine -- @1.3 ubuntu release # features/unattached_commands.feature:22 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua auto-attach` `as non-root` exits `1` # None Then stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua auto-attach` with sudo # None Then stderr matches regexp # None """ Auto-attach image support is not available on nocloudnet See: https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached auto-attach does nothing in a ubuntu machine -- @1.4 ubuntu release # features/unattached_commands.feature:23 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua auto-attach` `as non-root` exits `1` # None Then stderr matches regexp # None """ This command must be run as root \(try using sudo\). """ When I run `ua auto-attach` with sudo # None Then stderr matches regexp # None """ Auto-attach image support is not available on lxd See: https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached commands that requires enabled user in a ubuntu machine -- @1.1 ua commands # features/unattached_commands.feature:122 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua detach` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ When I verify that running `ua detach` `with sudo` exits `1` # features/steps/steps.py:365 Then stderr matches regexp # features/steps/steps.py:312 """ This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached commands that requires enabled user in a ubuntu machine -- @1.2 ua commands # features/unattached_commands.feature:123 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua refresh` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ When I verify that running `ua refresh` `with sudo` exits `1` # features/steps/steps.py:365 Then stderr matches regexp # features/steps/steps.py:312 """ This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached commands that requires enabled user in a ubuntu machine -- @1.3 ua commands # features/unattached_commands.feature:124 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua detach` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua detach` `with sudo` exits `1` # None Then stderr matches regexp # None """ This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached commands that requires enabled user in a ubuntu machine -- @1.4 ua commands # features/unattached_commands.feature:125 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua refresh` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua refresh` `with sudo` exits `1` # None Then stderr matches regexp # None """ This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached commands that requires enabled user in a ubuntu machine -- @1.5 ua commands # features/unattached_commands.feature:126 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua detach` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua detach` `with sudo` exits `1` # None Then stderr matches regexp # None """ This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached commands that requires enabled user in a ubuntu machine -- @1.6 ua commands # features/unattached_commands.feature:127 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua refresh` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua refresh` `with sudo` exits `1` # None Then stderr matches regexp # None """ This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached commands that requires enabled user in a ubuntu machine -- @1.7 ua commands # features/unattached_commands.feature:128 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua detach` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua detach` `with sudo` exits `1` # None Then stderr matches regexp # None """ This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached commands that requires enabled user in a ubuntu machine -- @1.8 ua commands # features/unattached_commands.feature:129 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua refresh` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua refresh` `with sudo` exits `1` # None Then stderr matches regexp # None """ This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.1 ua commands # features/unattached_commands.feature:149 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua enable livepatch` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ When I verify that running `ua enable livepatch` `with sudo` exits `1` # features/steps/steps.py:365 Then stderr matches regexp # features/steps/steps.py:312 """ To use 'livepatch' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.2 ua commands # features/unattached_commands.feature:150 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua disable livepatch` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ When I verify that running `ua disable livepatch` `with sudo` exits `1` # features/steps/steps.py:365 Then stderr matches regexp # features/steps/steps.py:312 """ To use 'livepatch' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.3 ua commands # features/unattached_commands.feature:151 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua enable unknown` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ When I verify that running `ua enable unknown` `with sudo` exits `1` # features/steps/steps.py:365 Then stderr matches regexp # features/steps/steps.py:312 """ To use 'unknown' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.4 ua commands # features/unattached_commands.feature:152 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua disable unknown` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ This command must be run as root (try using sudo). """ When I verify that running `ua disable unknown` `with sudo` exits `1` # features/steps/steps.py:365 Then stderr matches regexp # features/steps/steps.py:312 """ To use 'unknown' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.5 ua commands # features/unattached_commands.feature:153 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua enable livepatch` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua enable livepatch` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'livepatch' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.6 ua commands # features/unattached_commands.feature:154 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua disable livepatch` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua disable livepatch` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'livepatch' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.7 ua commands # features/unattached_commands.feature:155 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua enable unknown` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua enable unknown` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'unknown' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.8 ua commands # features/unattached_commands.feature:156 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua disable unknown` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua disable unknown` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'unknown' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.9 ua commands # features/unattached_commands.feature:157 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua enable livepatch` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua enable livepatch` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'livepatch' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.10 ua commands # features/unattached_commands.feature:158 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua disable livepatch` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua disable livepatch` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'livepatch' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.11 ua commands # features/unattached_commands.feature:159 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua enable unknown` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua enable unknown` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'unknown' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.12 ua commands # features/unattached_commands.feature:160 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua disable unknown` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua disable unknown` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'unknown' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.13 ua commands # features/unattached_commands.feature:161 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua enable livepatch` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua enable livepatch` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'livepatch' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.14 ua commands # features/unattached_commands.feature:162 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua disable livepatch` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua disable livepatch` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'livepatch' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.15 ua commands # features/unattached_commands.feature:163 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua enable unknown` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua enable unknown` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'unknown' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached command known and unknown services in a ubuntu machine -- @1.16 ua commands # features/unattached_commands.feature:164 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua disable unknown` `as non-root` exits `1` # None Then I will see the following on stderr # None """ This command must be run as root (try using sudo). """ When I verify that running `ua disable unknown` `with sudo` exits `1` # None Then stderr matches regexp # None """ To use 'unknown' you need an Ubuntu Advantage subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/advantage """ @series.all Scenario Outline: Help command on an unattached machine -- @1.1 ubuntu release # features/unattached_commands.feature:200 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `ua help esm-infra` as non-root # features/steps/steps.py:130 Then I will see the following on stdout # features/steps/steps.py:281 """ Name: esm-infra Available: yes Help: esm-infra provides access to a private ppa which includes available high and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main repository between the end of the standard Ubuntu LTS security maintenance and its end of life. It is enabled by default with Extended Security Maintenance (ESM) for UA Apps and UA Infra. You can find our more about the esm service at https://ubuntu.com/security/esm """ When I run `ua help esm-infra --format json` with sudo # features/steps/steps.py:130 Then I will see the following on stdout # features/steps/steps.py:281 """ {"name": "esm-infra", "available": "yes", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"} """ When I verify that running `ua help invalid-service` `with sudo` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ No help available for 'invalid-service' """ @series.all Scenario Outline: Help command on an unattached machine -- @1.2 ubuntu release # features/unattached_commands.feature:201 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `ua help esm-infra` as non-root # None Then I will see the following on stdout # None """ Name: esm-infra Available: yes Help: esm-infra provides access to a private ppa which includes available high and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main repository between the end of the standard Ubuntu LTS security maintenance and its end of life. It is enabled by default with Extended Security Maintenance (ESM) for UA Apps and UA Infra. You can find our more about the esm service at https://ubuntu.com/security/esm """ When I run `ua help esm-infra --format json` with sudo # None Then I will see the following on stdout # None """ {"name": "esm-infra", "available": "yes", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"} """ When I verify that running `ua help invalid-service` `with sudo` exits `1` # None Then I will see the following on stderr # None """ No help available for 'invalid-service' """ @series.all Scenario Outline: Help command on an unattached machine -- @1.3 ubuntu release # features/unattached_commands.feature:202 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `ua help esm-infra` as non-root # None Then I will see the following on stdout # None """ Name: esm-infra Available: yes Help: esm-infra provides access to a private ppa which includes available high and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main repository between the end of the standard Ubuntu LTS security maintenance and its end of life. It is enabled by default with Extended Security Maintenance (ESM) for UA Apps and UA Infra. You can find our more about the esm service at https://ubuntu.com/security/esm """ When I run `ua help esm-infra --format json` with sudo # None Then I will see the following on stdout # None """ {"name": "esm-infra", "available": "yes", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"} """ When I verify that running `ua help invalid-service` `with sudo` exits `1` # None Then I will see the following on stderr # None """ No help available for 'invalid-service' """ @series.all Scenario Outline: Help command on an unattached machine -- @1.4 ubuntu release # features/unattached_commands.feature:203 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `ua help esm-infra` as non-root # None Then I will see the following on stdout # None """ Name: esm-infra Available: yes Help: esm-infra provides access to a private ppa which includes available high and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main repository between the end of the standard Ubuntu LTS security maintenance and its end of life. It is enabled by default with Extended Security Maintenance (ESM) for UA Apps and UA Infra. You can find our more about the esm service at https://ubuntu.com/security/esm """ When I run `ua help esm-infra --format json` with sudo # None Then I will see the following on stdout # None """ {"name": "esm-infra", "available": "yes", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"} """ When I verify that running `ua help invalid-service` `with sudo` exits `1` # None Then I will see the following on stderr # None """ No help available for 'invalid-service' """ @series.bionic Scenario: Fix command on an unattached machine # features/unattached_commands.feature:425 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I verify that running `ua fix CVE-1800-123456` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ Error: CVE-1800-123456 not found. """ When I verify that running `ua fix USN-12345-12` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ Error: USN-12345-12 not found. """ When I verify that running `ua fix CVE-12345678-12` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ Error: issue "CVE-12345678-12" is not recognized. Usage: "ua fix CVE-yyyy-nnnn" or "ua fix USN-nnnn" """ When I verify that running `ua fix USN-12345678-12` `as non-root` exits `1` # features/steps/steps.py:365 Then I will see the following on stderr # features/steps/steps.py:317 """ Error: issue "USN-12345678-12" is not recognized. Usage: "ua fix CVE-yyyy-nnnn" or "ua fix USN-nnnn" """ When I run `apt install -y libawl-php` with sudo # features/steps/steps.py:130 And I run `ua fix USN-4539-1` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ USN-4539-1: AWL vulnerability Found CVEs: https://ubuntu.com/security/CVE-2020-11728 1 affected package is installed: awl \(1/1\) awl: Ubuntu security engineers are investigating this issue. 1 package is still affected: awl .*✘.* USN-4539-1 is not resolved. """ When I run `ua fix CVE-2020-28196` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ CVE-2020-28196: Kerberos vulnerability https://ubuntu.com/security/CVE-2020-28196 1 affected package is installed: krb5 \(1/1\) krb5: A fix is available in Ubuntu standard updates. The update is already installed. .*✔.* CVE-2020-28196 is resolved. """ When I run `apt-get install xterm=330-1ubuntu2 -y` with sudo # features/steps/steps.py:130 And I run `ua fix CVE-2021-27135` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ CVE-2021-27135: xterm vulnerability https://ubuntu.com/security/CVE-2021-27135 1 affected package is installed: xterm \(1/1\) xterm: A fix is available in Ubuntu standard updates. Package fixes cannot be installed. To install them, run this command as root \(try using sudo\) 1 package is still affected: xterm .*✘.* CVE-2021-27135 is not resolved. """ When I run `ua fix CVE-2021-27135` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ CVE-2021-27135: xterm vulnerability https://ubuntu.com/security/CVE-2021-27135 1 affected package is installed: xterm \(1/1\) xterm: A fix is available in Ubuntu standard updates. .*\{ apt update && apt install --only-upgrade -y xterm \}.* .*✔.* CVE-2021-27135 is resolved. """ When I run `ua fix CVE-2021-27135` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ CVE-2021-27135: xterm vulnerability https://ubuntu.com/security/CVE-2021-27135 1 affected package is installed: xterm \(1/1\) xterm: A fix is available in Ubuntu standard updates. The update is already installed. .*✔.* CVE-2021-27135 is resolved. """ Feature: Unattached status # features/unattached_status.feature:1 @series.all Scenario Outline: Unattached status in a ubuntu machine -- @1.1 ubuntu release # features/unattached_status.feature:83 Given a `bionic` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `ua status` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ SERVICE AVAILABLE DESCRIPTION esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status --all` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis yes +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ SERVICE AVAILABLE DESCRIPTION esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status --all` with sudo # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis yes +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I append the following on uaclient config # features/steps/steps.py:245 """ features: allow_beta: true """ And I run `ua status` as non-root # features/steps/steps.py:130 Then stdout matches regexp # features/steps/steps.py:300 """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis yes +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached status in a ubuntu machine -- @1.2 ubuntu release # features/unattached_status.feature:84 Given a `focal` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `ua status` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status --all` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis no +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status` with sudo # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status --all` with sudo # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis no +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I append the following on uaclient config # None """ features: allow_beta: true """ And I run `ua status` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis no +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached status in a ubuntu machine -- @1.3 ubuntu release # features/unattached_status.feature:85 Given a `trusty` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `ua status` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status --all` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis no +Center for Internet Security Audit Tools esm-apps no +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status` with sudo # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status --all` with sudo # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis no +Center for Internet Security Audit Tools esm-apps no +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I append the following on uaclient config # None """ features: allow_beta: true """ And I run `ua status` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal no +Common Criteria EAL2 Provisioning Packages cis no +Center for Internet Security Audit Tools esm-apps no +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips no +NIST-certified FIPS modules fips-updates no +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @series.all Scenario Outline: Unattached status in a ubuntu machine -- @1.4 ubuntu release # features/unattached_status.feature:86 Given a `xenial` machine with ubuntu-advantage-tools installed # features/steps/steps.py:27 When I run `ua status` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status --all` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal yes +Common Criteria EAL2 Provisioning Packages cis yes +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status` with sudo # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I run `ua status --all` with sudo # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal yes +Common Criteria EAL2 Provisioning Packages cis yes +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ When I append the following on uaclient config # None """ features: allow_beta: true """ And I run `ua status` as non-root # None Then stdout matches regexp # None """ SERVICE AVAILABLE DESCRIPTION cc-eal yes +Common Criteria EAL2 Provisioning Packages cis yes +Center for Internet Security Audit Tools esm-apps yes +UA Apps: Extended Security Maintenance \(ESM\) esm-infra yes UA Infra: Extended Security Maintenance \(ESM\) fips yes +NIST-certified FIPS modules fips-updates yes +Uncertified security updates to FIPS modules livepatch yes Canonical Livepatch service This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ Failing scenarios: features/attached_commands.feature:435 Enable command with invalid repositories in user machine -- @1.3 ubuntu release features/attached_enable.feature:155 Attached enable not entitled service in a ubuntu machine -- @1.1 not entitled services 5 features passed, 2 failed, 2 skipped 27 scenarios passed, 2 failed, 141 skipped 293 steps passed, 2 failed, 1737 skipped, 0 undefined Took 31m25.559s ERROR: InvocationError for command /home/lucasmoura/projects/ubuntu-advantage-client/.tox/behave-lxd-18.04/bin/behave -v --tags=series.bionic,series.all '--tags=~upgrade' (exited with code 1) ___________________________________ summary ____________________________________ ERROR: behave-lxd-18.04: commands failed