Commit Graph

158 Commits

Author SHA1 Message Date
Olivier Gayot 0c73bf9b86 source: add ability to select source in autoinstall
The source autoinstall section now supports the "id" field where the
user can supply the ID of a source, e.g., "ubuntu-server" or
"ubuntu-server-minimal".

If the field is not supplied, the installation will use the source
declared default: true (if any) in the source catalog. Otherwise, it the
first source declared will be used.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-04 10:58:59 +02:00
Dan Bungert c473a22bf1 examples: make the 'simple' mc disk bigger
Increase size of the disk in the simple machine config to 100 GiB.
This file is used heavily as a basic starting machine config and it
should be large enough for many types of tests.
2022-07-21 08:52:42 -06:00
Dan Bungert 90e7bd8389 examples: threebuntu-on-msdos
3 Ubuntu installs, of various versions, on a MSDOS partition table.
Data courtesy of jp.nurmi@canonical.com.
2022-07-11 18:17:19 -06:00
Olivier Gayot 7ebef6d609 ubuntu-pro: add subscription info in response to /ubuntu_pro/check_token
The response to /ubuntu_pro/check_token now includes information about
the subscription: the name of the contract and the "name" of the account.

Instead of returning the list of services as an optional field, we now
include the list of services in the subscription object. The
subscription object is itself marked optional. This is a backward
incompatible change.

  {
    "status": "VALID_TOKEN",
    "services": [
      {
        "name": "esm-infra",
        "description": "UA Infra: Extended Security Maintenance (ESM)",
        "auto_enabled": true
      }
    ]
  }

  =>

  {
    "status": "VALID_TOKEN",
    "subscription": {
        "account_name": "user@domain.com",
        "contract_name": "UA Apps - Essential (Virtual)",
        "services": [
          {
            "name": "esm-infra",
            "description": "UA Infra: Extended Security Maintenance (ESM)",
            "auto_enabled": true
          }
        ]
     }
  }

If the token is not valid, the subscription object will be null:

  {
    "status": "EXPIRED_TOKEN",
    "subscription": null
  }

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-30 16:31:56 +02:00
Dan Bungert b298caf83a examples: add sample with size info 2022-05-31 09:09:33 -06:00
Olivier Gayot e5017256a2 snaplist: add visual indication for starred publishers
In addition to verified publishers being indicated by a check-mark, we
now have starred publishers indicated with a circled star.

If unicode support is not available, for instance with serial
connections, we use a different number of stars to represent:

 * verified publishers: 2 stars
 * starred publishers: 1 star
 * others: no star

Because our mechanism to substitute unicode characters with ascii
equivalents expect a 1:1 mapping, we cannot simply replace the circled
start by two stars. To workaround the issue, we added a narrow
non-breakable space.

When support of unicode is available, this character shows up as a
normal space.
When support of unicode is not available, it gets replaced by a star.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-05-04 10:32:32 +02:00
Olivier Gayot 79326cf2eb source: run answers when only one source is configured
Before, we would not run answers for the source controller if only one
source was specified. The controller would automatically get marked
configured.

Since we're adding a new "search drivers" option in this screen, we need
to make it interactive in integration tests now.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Jean-Baptiste Lallement a3a21da408 Removed systemd from the UI
We won't ship systemd officially in 22.04, hence remove it from the UI.
However it's still there and distributed and can be enabled manually.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2022-04-07 10:55:30 +02:00
Olivier Gayot ad6cd6e383
Merge pull request #1196 from ogayot/FR-2077
Add client-side controller and view to install third-party drivers on server installer
2022-03-17 10:38:48 +01:00
Olivier Gayot 2bf39f02ca Merge pull request #1217 from ogayot/ua-rebranding
Rename UbuntuAdvantage -> UbuntuPro
2022-03-17 09:20:43 +01:00
Didier Roche d17cd6fc38 System-Setup: Add systemd experimental support to WSL
Grow a new API for enabling/disabling systemd experimental support. We
do this by chaining a specific command= in the boot section.
We preserve the user customized command= content when systemd
experimental support is not enabled.

Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
2022-03-16 12:24:18 +01:00
Olivier Gayot e9b2e24b1a Rename UbuntuAdvantage -> UbuntuPro but keep autoinstall compat
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-15 11:50:57 +01:00
Didier Roche 5695da5699 system-setup: Remove ubuntu-wsl-integration from API and TUI.
This project is no longer supported under WSL. Remove integration in the TUI
and API for it. Adapted tests and schema.
2022-03-14 15:58:03 +01:00
Olivier Gayot 2ec62051d4 Add basic implementation for third-party drivers GUI
[Michael Hudson Doyle]
 * Original patch

 [Olivier Gayot]
 * Make sure visible elements can be translated by using gettext _()
   construct.
 * Have GET /drivers provide the status of the checkbox (i.e. install
   drivers?) so we can restore the choice of the user when going back.
 * Store an object with an "install" boolean in the autoinstall schema ;
   instead of storing a boolean directly.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-10 09:55:58 +01:00
Dan Bungert c68a32fe42 examples: add disk with free space at end 2022-02-28 16:01:49 -07:00
Dan Bungert 9bd3ea6a6c filesystem: passphrase in answers, failing test 2022-02-11 16:19:19 -07:00
Dan Bungert d158d4e701
Merge pull request #1174 from ogayot/ua-entitled-services-only
Don't list UA services that are not entitled
2022-01-28 11:13:09 -07:00
Olivier Gayot 7dfe722686 Don't list UA services that are not entitled
Instead of only checking if a given UA service is available, we now also
check if it is entitled.

 - the available field for a service refers to its availability on the
   current machine (e.g. on Focal running on a amd64 CPU) ; whereas
 - the entitled field tells us if the contract covers the service.

Therefore, we need to make sure that we only list the services that are
both "available" and "entitled".

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-28 18:58:39 +01:00
Olivier Gayot 2bbd4fffe6 Update example states for Subiquity to cover valid token values
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-21 13:48:43 +01:00
Olivier Gayot 9e7bc5053b Add support for APT preferences through autoinstall in Subiquity
The autoinstall schema for "apt" now supports the "preferences"
configuration. Each preference element should contain the properties
described below, that 1:1 map with the keywords from apt_preferences(5):

  * package      <-> Package:
  * pin          <-> Pin:
  * pin-priority <-> Pin-Priority:

These preferences are forwarded to curtin through
subiquity-curtin-apt.conf. Support for these rules must be added to
curtin as well.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-11 18:42:40 +01:00
Dan Bungert 5ae52c000b
Merge pull request #1151 from ogayot/FR-1652
Validate UA token & list available services
2022-01-10 10:02:41 -07:00
Dan Bungert 96a53eff14
Merge pull request #1154 from dbungert/autoinstall-disable-components
apt: fix disable_components w/ autoinstall
2022-01-10 09:45:49 -07:00
Olivier Gayot f8704aa246 Merge branch 'main' into FR-1652
Resolve conflicts in PR 1151.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-10 10:53:51 +01:00
Olivier Gayot 81c67780ff Add basics checks for token validity in the autoinstall JSON schema
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-06 10:54:08 +01:00
Dan Bungert 5a2a7f5ad6 apt: fix disable_components w/ autoinstall
* The mixture of storage for disable_components in and out of the config
  dict was confusing and caused bugs, depending on the flow
* disable_components now solely lives in the dict, like other items
2022-01-05 10:35:05 -07:00
Olivier Gayot d345cf999a Use autoinstall for ubuntu-advantage in integration tests
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-04 17:58:46 +01:00
Olivier Gayot fd403ce476 Add sample outputs for ua status --simulate-with-token --format json
This commit introduces example JSON files that would simulate output of
the ua_client script, as in the following command:

  $ ubuntu-advantage status \
      --simulate-with-token "${token}" \
      --format json

Two files are added, one for each of the following scenario:
 * output when supplied a valid, non expired token
 * output when supplied a valid but expired token

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2021-12-17 17:41:45 +01:00
Olivier Gayot fe4b6fde6f Only show UA screen if running on LTS release
The UA screen is now shown only if we are running on an LTS release.
In dry-run mode, we pretend to always be on Ubuntu focal.

To implement the possibility to skip the screen, we added another POST
resource to inform the server that we are finished configuring
UbuntuAdvantage.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2021-12-16 11:06:09 +01:00
Olivier Gayot 1c9c04d55d Add initial integration of Ubuntu Advantage in subiquity
Introduce a new view, model and controllers pair to enable Ubuntu
Advantage from Subiquity. For now, we expect the user to input an
alphanumeric token and rely on cloud-init to enable the features
associated with the subscription.

This implementation comes with a number of limitations:
 * inability to validate the token before first-boot
 * inability to check what features are associated with the Ubuntu
   Advantage subscription, before first-boot
 * the user must input the token directly: there is no mechanism to
   deduce the token based on email address and password.

The new screen is placed after the identity scree. The installation
should already be running when the UA screen will be shown to the user.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2021-12-08 23:25:39 +01:00
Dan Bungert c4a9b6a1d6 examples: add os-prober to win10 2021-12-07 11:46:28 -07:00
Carlos Nihelton 7179bfb4fc Sample files for testing
Those files simulate the information generated by WSL launcher.
2021-10-28 14:16:28 -03:00
Patrick Wu ec04a6833a
system_setup: shutdown/reboot tests 2021-10-18 17:15:45 +08:00
Didier Roche deab1b0859
Merge pull request #1091 from canonical/wsl_oobe_autoinstall
WSL OOBE - properly setup autoinstall
2021-10-11 09:34:59 +02:00
Patrick Wu 7ae8e108a6
system_setup: include full autoinstall system 2021-10-11 10:20:18 +08:00
Michael Hudson-Doyle 206b7ae678
Merge pull request #1092 from dbungert/source-catalog-tests
sources: add sample source catalog
2021-10-11 12:09:25 +13:00
Dan Bungert a9bf5e004b sources: add sample source catalog
* Add sample source catalog from impish iso
* Show in dryrun
* Use in one of the runtests invocations (but not really tested yet)
2021-10-08 13:02:55 -06:00
Patrick Wu 07b0407815
system_setup: refactor the testing system
1. updating testing system with the proper autoinstall schema
2. reconf mode testing included
2021-10-08 20:49:06 +08:00
Patrick Wu c934268813 system_setup: changes and fixes
1. rebase with main and update autoinstall-system-setup.yml
2. provide a more unified indent style
3. update get_userandgroups() to the dropped one
4. fix the problematic os action
5. simply asignments
6. assign default_loader a default value
7. provide a type-to-file dict in wsl_conf
8. provide stderr info when providing error in creating user
9. update schema and example files
2021-10-06 22:13:15 +08:00
Patrick Wu 1a7274dbba system_setup: unify api names and simply WSLconfig class into function 2021-10-06 22:13:15 +08:00
Patrick Wu 225cb1bd37 system_setup: fixes for after rebasing
1. add extra logs
2. improve the answers file
3. await the self.configured in wslconf API
2021-10-06 22:13:15 +08:00
Jean-Baptiste Lallement 4966173d6c Test system setup autoinstall
It also adds an argument --ignore-tz to the schema comparison test to
not fail on system where the schema has no TZ like WSL.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2021-09-28 09:32:39 +02:00
Dan Bungert 3de314a64f fixup: snap & autoinstall 2021-09-22 17:45:58 -06:00
Jean-Baptiste Lallement ab161250e1 Removed the progress view.
On non systemd systems (ie WSL) the progress view is always empty. Thus
this view is removed and the summary (formerly overview) view becomes
the last page of the setup with the reboot button. This button is
displayed dynamically when setup is complete.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2021-09-01 19:06:50 +02:00
Jean-Baptiste Lallement 3044a1fc11 Update answer file with renamed controllers
WSL configuration controllers have been renamed, the answer file must be
updated accordingly

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2021-08-31 15:52:03 +02:00
Jean-Baptiste Lallement b0299f255f Added integration test for WSL
This tests covers the configuration of WSL on first boot.
2021-08-31 15:52:03 +02:00
Dan Bungert 0aa5e91670 Add probert output for win10 & bitlocker 2021-08-02 15:04:07 -06:00
Dan Bungert c79aa602dc Proper fix for setting timezone inappropriately in dryrun
Reenable integration test for set of timezone.
Don't set it while in dryrun.
2021-07-15 10:49:32 -06:00
Dan Bungert 4ed4e51a2e Workaround dryrun test actually setting timezone
Until a proper fix can be finished, remove the set of timezone from the
integration tests.
2021-07-14 19:02:42 -06:00
Dan Bungert 40945f1823
TimeZone: autoinstall and API (FR-1184) (#986)
* TimeZone: autoinstall and API

Add support for Get/Set timezone methods.  Get means that we inquire
with GeoIP as to which timezone is suggested.  Non-availability of
GeoIP, or a previous explicit Set, means that we return the system
timezone.  Set of timezone by Post results in set of the live system
timzeone, and queuing a set of the target system by way of cloud-init.

* Add clarifying comment about _request.
2021-07-13 06:25:03 -06:00
Michael Hudson-Doyle 916ee7516e add an imsm integration test 2021-07-07 08:40:33 +12:00