Commit Graph

194 Commits

Author SHA1 Message Date
J-P Nurmi 2764719a30 Add test source catalog for desktop variants 2023-03-30 07:53:08 -06:00
Carlos Nihelton eb08609238
Updates the autoinstall-ad example file to '-' 2023-03-03 20:21:39 -03:00
Carlos Nihelton 68b6805677
Simpler AD integration test 2023-03-02 09:50:03 -03:00
Carlos Nihelton 7062e6ad3b
Consistent naming - part 2 - longer model name
sticking with "active_directory" for clarity.
2023-03-02 09:49:24 -03:00
Carlos Nihelton 03af76d431
AD integration testing
Currently only checks if the AD model causes packages to be installed
if the autoinstall contains AD data.
2023-03-01 15:23:30 -03:00
Olivier Gayot 75f6047a6f mirror: in CI, do not run apt-get update on the host
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-02-23 18:12:24 +01:00
Olivier Gayot 58e524ae6e
Merge pull request #1552 from ogayot/fallback-mirror
Support of multiple candidates mirrors with automatic selection in autoinstall & desktop installs
2023-02-15 09:04:11 +01:00
Olivier Gayot ff46c48d60 mirror: use apt->mirror-selection instead of relying on version
We used to rely on a version key under apt autoinstall section to
specify if we want the old implementation (i.e., a single candidate
primary mirror) or the new implementation (i.e., multiple primary mirror
candidates).

Instead, we now introduce the apt->mirror-selection autoinstall section,
and move the primary section under it.

If the primary section if under apt, we want the old implementation.
If the primary section is under apt->mirror-selection, we want the new
implementation.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-02-14 19:44:57 +01:00
Olivier Gayot fe8ab8a1e8 ssh: don't run ssh-import-id as part of the CI
Running ssh-import-id as part of the CI has limitations. First it
requires that we have access to the Internet. Second, it is affected by
github and launchpad service disruptions and or rate limiting policies.

Make sure we don't call ssh-import-id as part of the CI. Instead use a
username that is configured to produce fake successful key imports.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-02-13 16:41:47 +01:00
Olivier Gayot 7dbd0177e4 mirror: add autoinstall tests for apt/mirror version 2
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-02-10 15:43:05 +01:00
Dan Bungert ec38ae9120 test/api: example of x-make-view-request 2023-01-24 16:06:37 -07:00
Olivier Gayot ec80a1cdee integration-tests: import SSH keys from LP instead of GH
As part of our integrations tests, we import mwhudson's public SSH
key(s) from GitHub. At the moment, however, the GitHub API is rate
limiting the number of queries from our CI.

Upon exceeding the rate limit, our HTTP queries are responded with a 403:

┌────────────────────────────────────────────────────────────────────────┐
│  Importing keys failed:                                                │
│                                                                        │
│  2023-01-08 23:43:40,562 ERROR GitHub REST API rate-limited this IP    │
│  address. See https://developer.github.com/v3/#rate-limiting .         │
│  status_code=403 user=mwhudson                                         │
└────────────────────────────────────────────────────────────────────────┘

Currently, upon pushing to GitHub, the CI runs the integrations tests
against 4 different Ubuntu images (focal, jammy, kinetic, lunar).

This ends up doing 4 SSH import queries at roughly the same time ; which
often exceeds the rate limit and makes some of the tests fail.

This patch makes integration tests import SSH keys from Launchpad
instead of GitHub. Maybe a better approach would be to mock the calls to
ssh-import-id in the CI instead.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-01-09 09:43:53 +01:00
Carlos Nihelton 4f0b45798b
Answers no longer relevant for wsl_setup
Integration tests on wsl_setup variant should not write wsl.conf.
2022-12-16 13:28:11 +00:00
Dan Bungert 1898224c5f examples: machine config for raid1 delete crash
To produce the crash, simply use this machine config in dry run, do
manual partition, and attempt to delete the md device.
2022-12-08 12:30:09 -07:00
Olivier Gayot c7750c7fda mixed-catalog: rework description and name of entries
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-12-06 15:08:00 +01:00
Olivier Gayot 66c82b3227 drivers: query again list of drivers if the source variant changes
The list of drivers suggested to the user may vary based on whether we
are installing a server or desktop image / source.

In the current implementation of the drivers controller, the value of
the source variant (e.g., server or desktop) is read early in the
initializer.

This is a problem because it happens before the client gets the
opportunity to tell us if we are installing a server or a desktop image.

If the source variant ever changes, we want to query again the list of
drivers to suggest.

Upon configuring the source, the drivers controller will query (again)
the list of drivers.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-12-05 11:29:07 +01:00
Olivier Gayot d74a506f98 ubuntu-pro: add ability to run magic-attach locally in dry-run mode
In dry-run mode, the 'magic_attach_run_locally' variable can now be used
to execute uaclient on the host (against the uacontracts environment
specified in /etc/ubuntu-advantage/uaclient.conf) instead of relying on
a mock mechanism.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-11-28 17:27:23 +01:00
Olivier Gayot 217ac98fc6 filesystem: mount snapd/seed/systems only if it exists
The "$source"/var/lib/snapd/seed/systems directory only exists in certain
scenarios related to TPM-backed FDE. When the directory does not exist,
attempting to bind-mount it to /var/lib/snapd/seed/systems crashes the
install with a CalledProcessError.

We now make sure the directory exists before trying to mount it. For
dry-run test cases, we added a configuration item that simulates the
presence (or the non-presence) of the systems directory on the source.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-11-25 15:50:01 +01:00
Michael Hudson-Doyle f015634b79 configure controllers tui does not support when installing desktop
A bit of a hack but probably a useful one.
2022-11-15 15:43:33 +13:00
Michael Hudson-Doyle 5dafdb916d call into snapd to set up encryption when required 2022-11-11 14:46:44 +13:00
Michael Hudson-Doyle 2bb3aab362 add sample data which will fail at the finish-install step 2022-11-10 11:48:37 +13:00
Michael Hudson-Doyle c24cfd3d04 call into snapd to finish the installation of a core boot classic system 2022-11-10 11:48:37 +13:00
Michael Hudson-Doyle 5baa7b5e5f tidy sample data slightly 2022-11-10 11:47:29 +13:00
Michael Hudson-Doyle 27953f794d fix integration test 2022-11-01 15:59:06 +01:00
Michael Hudson-Doyle f87b97bbdf add some more sample data 2022-11-01 14:39:23 +01:00
Michael Hudson-Doyle 2e05f79dc1 add example source, api output and fix some bugs 2022-11-01 13:54:36 +01:00
Olivier Gayot 561fff1d5b
Merge pull request #1336 from ogayot/password-passphrase
Refactor how we handle confirmation fields - use passphrase instead of password where relevant
2022-10-28 14:06:54 +02:00
Chad Smith 07c62876d0 examples: fix invalid user-data example since we now validate schema 2022-09-01 13:12:53 -06:00
Dan Bungert 1bf562c85a
Merge pull request #1390 from CarlosNihelton/langpack-flag
[WSL] Enables users to skip installing language packs
2022-08-26 17:17:43 -06:00
Dan Bungert 70db2a6414 filesystem: fix kname for os prober 2022-08-25 17:01:33 -06:00
Carlos Nihelton 6dd157dac7
Adding WSLSetupOptions API endpoint
Intended to receive options that affect the setup process.
and won't be written to /etc/wsl.conf
Options relative to that conf file are handled by WslConfBase and
WslConfAdvanced.
Currently only the option for skip installing language packs is
available.
2022-08-23 10:45:29 -03:00
Olivier Gayot 324ff0bc8f Merge pull request #1372 from ogayot/FR-2475
install: invoke curtin multiple times with different stages
2022-08-11 11:11:51 +02:00
Olivier Gayot 559b904f54 install: don't run curtin install for hook stage
The hook stage does not do anyting in Ubuntu. Let's skip it.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-11 09:24:09 +02:00
Olivier Gayot 4c70b78fba install: invoke curtin multiple times with different stages
We now invoke curtin install in a step-by-step mode. Before, we would
perform a single invocation of curtin install for the following stages:

 * early (but no early_commands configured)
 * partitioning
 * extract
 * curthooks
 * hook
 * late (but no late_commands configured)

We now run multiple invocations of curtin install, in 5 different steps:

 * initial: does not run any stage per se but prepares curtin
   for the next invocations (this invocation is not strictly necessary
   and could be merged with the next step but having it separate makes
   the flow easier to understand, I think)
 * partitioning: runs the partitioning stage
 * extract: runs the extract stage
 * curthooks: runs the curthooks stage

The early and late stages were dropped since they would act as no-ops.
We also dropped the hook stage since it does nothing in Ubuntu.

The configuration files for each step ends up in
/var/log/installer/curtin-install/subiquity-{step_name}.conf

The log files for each step end up in
/var/log/installer/curtin-install/{step_name}.log

If errors occur, a tarball of the necessary logs end up in
/var/log/installer/curtin-install/{step_name}-error.tar

All files (i.e. configuration files, log files, error-files) are bundled
in the apport report in case of crash.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-11 09:16:06 +02:00
Olivier Gayot 34d4acd264 hooks: execute hook scripts as builtin late commands
When executing late commands, we now start by executing run-parts over
the /etc/subiquity/postinst.d directory (by default) if it exists.

A failure in run-parts is not considered critical so any other
late_commands will run no matter what.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-09 09:47:26 +02:00
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
Olivier Gayot d63b44c014 storage: use fields named passphrase for passphrases
Because the storage views lean on the implementation of
setup_password_validation from the identity screen, we were forced to
use a form with fields named "password" and "password_confirm".

This makes the code confusing because we use the "passphrase"
terminology in the storage forms.

We now leave up to the caller to specify which fields he wants to be
part of the validation ; instead of making him provide the full form.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-24 11:37:54 +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