Commit Graph

4839 Commits

Author SHA1 Message Date
Carlos Nihelton b5e6506852
Exception on POST if invalid username 2022-05-11 09:14:56 -03:00
Carlos Nihelton 0798f46a33
Exception instead of checking if the file exists.
reserved-usernames
2022-05-11 09:14:42 -03:00
Carlos Nihelton a8e3f9a218
Removes the comprehension expression with :=
Prevents flake8 error on Focal.
2022-05-10 09:58:59 -03:00
Carlos Nihelton f9d2d3100e
Fix set type hint for older Python versions 2022-05-10 09:31:48 -03:00
Carlos Nihelton 0dba0722ab
WSL Validates the username with the endpoint. 2022-05-10 09:17:36 -03:00
Carlos Nihelton 9cb27da947
Makes the TUI validate username with the endpoint. 2022-05-10 08:53:31 -03:00
Carlos Nihelton 46347d1bcc
Adds UI tests for the invalid cases. 2022-05-10 08:53:13 -03:00
Carlos Nihelton b06073d86d
Adds server side username validation.
- system_reserved_names populated from a reserved-names file.
- subiquity.server.IdentityController loads it on init.
- validation compares the submitted against it.
- also checks if exists on passwd database.
2022-05-10 08:52:26 -03:00
Carlos Nihelton 65a701e44b
API Test for the username validation. 2022-05-10 08:50:31 -03:00
Carlos Nihelton 8525a363e0
Adds type and endpoint for username validation.
identity is not simple_endpoint anymore.
2022-05-10 08:49:16 -03:00
Michael Hudson-Doyle 7d6d50d66d
Merge pull request #1293 from dbungert/probert-lp-1970116
probert: update for raid fix
2022-05-09 09:47:48 +12:00
Dan Bungert ef39546a08 probert: update for raid fix 2022-05-06 08:44:20 -06:00
Olivier Gayot 829dc32f42
Merge pull request #1291 from ogayot/fix-back
storage: fix crash when coming back from FS screen
2022-05-05 09:44:25 +02:00
Olivier Gayot d037c5f437 storage: fix crash when coming back from FS screen
In order to fix a screen not refreshing issue, the following patch
changed the return type of make_ui from an object to a callable in the
storage controller:

414a2235 storage: fix screen sometimes not refreshing after slow probing

The storage controller is the only one that reuses its make_ui()
coroutine internally. Unfortunately, the code that calls await make_ui()
was not updated in the storage controller.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-05-03 16:13:37 +02:00
Dan Bungert 3aa9263e73
Merge pull request #1290 from ogayot/FR-2310
curtin: pickup fix for HTTP proxy settings being discarded
2022-04-29 18:18:51 -06:00
Olivier Gayot b6c68a40b3 curtin: pickup fix for HTTP proxy settings being discarded
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-29 10:51:19 +02:00
Michael Hudson-Doyle a0906aa4ac
Merge pull request #1287 from ogayot/optional-search_drivers
source: add a default value for search_drivers in POST /source
2022-04-29 14:01:05 +12:00
Michael Hudson-Doyle e0f9ae5b22
Merge pull request #1285 from mwhudson/extended-part-display
indent logical partitions and gaps in extended partitions
2022-04-29 13:59:39 +12:00
Olivier Gayot d981029ddc source: add a default value for search_drivers in POST /source
For backward compatibility reasons with the desktop installer
implementation, we now provide a default value (i.e., false) for the new
search_drivers parameter in /source.

Added non-regressions test for it.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-28 19:34:47 +02:00
Olivier Gayot 0267f7d66f
Merge pull request #1286 from ogayot/tap-network
Add ability to pass custom -nic options to QEMU
2022-04-28 19:14:46 +02:00
Olivier Gayot e58d1d00c2 kvm-test: introduce ability to pass -nic options to QEMU
The only way we had to pass -nic options to QEMU was to specify the
number of networks using the --nets option. Depending on its value, the
option would instruct QEMU to:
 * instantiate *n* user host networks if --nets >= 1
 * instantiate no network if --nets is 0
 * instantiate a "dead" network if --nets < 0

To simulate more advanced networks (such as networks where HTTP proxy is
needed), we want to add the possibility to use TAP network interfaces.

This patch adds the ability to pass custom -nic options to QEMU.

Three new options are available:

 * The --nic option passes the argument as-is to QEMU -nic option
 * The --nic-user option passes a user host network -nic option to QEMU
   - with SSH forwarding enabled. This is just like we do when using the
     --nets >= 1 option)
 * The --net-tap takes the name of an existing tap interface and
   generates the following -nic argument:

    tap,id={ifname},ifname={ifname},script=no,downscript=no,model=e1000

In the example below:
 * the first network uses the tap0 interface.
 * the second network uses the tap1 interface (it is syntactically
   equivalent to the first one)
 * the third network uses a user host network (with SSH forwarding)

  $ kvm-test.py \
    --nic tap,id=tap0,ifname=tap0,script=no,downscript=no,model=e1000 \
    --nic-tap tap1 \
    --nic-user

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-28 14:48:51 +02:00
Michael Hudson-Doyle 31a652ae2a indent logical partitions and gaps in extended partitions 2022-04-28 15:58:03 +12:00
Olivier Gayot eb7dee2c9e kvm-test: get rid of unused import random
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-27 20:04:33 +02:00
Olivier Gayot 6165c0a423 kvm-test: don't require LIVEFS_EDITOR if not building
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-27 19:59:37 +02:00
Olivier Gayot 83dacb8c7c kvm-test: don't execute code if module is imported
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-27 19:56:42 +02:00
Olivier Gayot 9ad7ff2747
Merge pull request #1252 from ogayot/FR-2149
Revisit design for third-party drivers
2022-04-27 19:40:20 +02:00
Dan Bungert 0533a88706
Merge pull request #1267 from dbungert/use-resize
Enable resize
2022-04-26 19:28:37 -06:00
Dan Bungert 85d3a49221 resize: check supported fs types 2022-04-26 19:06:59 -06:00
Dan Bungert ce3126efb6 storage/v2: permit resize 2022-04-26 19:06:59 -06:00
Dan Bungert 942ea0f6e2 manipulator: restrict resizes to requested resizes
Example why this matters: if a disk partition is not trying to be
resized, and it's actual size is not an even multiple of what align_up
supports, then it could get a unrequested non-zero size change.
And if there is no supporting gap for that change, then we can get a
size Exception despite not having asked for a resize.
2022-04-26 15:46:58 -06:00
Dan Bungert 91440e6c4c snapcraft: newer curtin for resize support 2022-04-26 15:46:58 -06:00
Olivier Gayot caff5f7dd7 source: add support for autoinstall data
Since we added a search_drivers checkbox that is uncheckd by default,
there is no longer a way for users to install third-party drivers in an
autoinstall context.

We now implement the autoinstall support for source so that users can
specify what value they want for search_drivers.

Futhermore, to be backward compatible with existing autoinstall
configurations, we now make search_drivers default to true in
autoinstall contexts.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 8929197010 drivers: include source.search_drivers in GET /drivers
The search_drivers attribute is set at the source model level, not at
the the drivers model level.

Having said that, by adding its value in the response to GET /drivers,
we can avoid doing multiple HTTP calls in the make_ui function.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +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
Olivier Gayot 5a4b66553c drivers: add button to go back when no drivers are available
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 6a2e8b6a49 drivers: show different words when online vs offline
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot d6048a6914 drivers: use radio buttons instead of checkbox to install drivers
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 595254159e source: use lazy string interpolation
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 57d5aef575 source: prevent to skip the drivers screen but allow to go back
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 1ffff94eff drivers: show the drivers screen only if search drivers was checked
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot c76a8f23e3 source: give the option to search for third-party drivers
The source screen now includes a checkbox that makes Subiquity search
for third-party drivers in a later stage.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Michael Hudson-Doyle 800801b7d0
Merge pull request #1280 from mwhudson/v2-boot-part-plan
make "can this be a boot partition" use v2 capabilities
2022-04-26 12:45:59 +12:00
Michael Hudson-Doyle 5fcf134408 fix parameterization parameters 2022-04-26 10:47:05 +12:00
Dan Bungert 0d0a922b28
Merge pull request #1283 from dbungert/gitignore
gitignore: .tags, .mypy
2022-04-25 08:14:00 -06:00
Dan Bungert f9b851533b
Update .gitignore
Co-authored-by: Olivier Gayot <duskcoder@gmail.com>
2022-04-25 07:23:01 -06:00
Olivier Gayot f75d80911b
Merge pull request #1282 from ogayot/tests-no-sh-c
tests: consistently run Subiquity commands
2022-04-25 11:14:46 +02:00
Dan Bungert 21d1bd29e1 gitignore: .tags, .mypy 2022-04-22 14:42:22 -06:00
Olivier Gayot fdd3ffdfa8 tests: use consistent order for subiquity cmdlines
In order we place:
 * the arguments that are for client & server
 * the arguments for the client only
 * the arguments for the server only

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-22 11:41:34 +02:00
Olivier Gayot 5d3e0b4675 tests: pass the subiquity commands directly without sh -c ''
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-22 11:34:48 +02:00
Olivier Gayot 3f07ca1b1b
Merge pull request #1266 from ogayot/FR-2237
Fix storage screen sometimes not refreshing after slow probing
2022-04-22 10:52:37 +02:00