Commit Graph

5246 Commits

Author SHA1 Message Date
Dan Bungert e61a504810 boot: handle small disk case
The BIOS boot plan check assumes that there is at least one result in
the list from gaps.parts_and_gaps(), but that isn't the case if the disk
is small.

Showed up in VM testing using cloud-localds to seed the autoinstall
file.
2022-06-21 10:31:36 -06:00
Olivier Gayot c84db47247 ubuntu-pro: remove hardcoded test for jammy
During the development cycle of 22.04, jammy was not yet marked an LTS
version. To have Ubuntu Pro screen fire up on that version, we had to
explicitly make an exception for Jammy.

Since Jammy is official LTS now, we can drop this explicit check.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-21 14:40:00 +02:00
Olivier Gayot 01db706867
Merge pull request #1314 from ogayot/something-failed-label
ui: add ability to change button label in SomethingFailed message box
2022-06-20 09:30:30 +02:00
Dan Bungert ca4fa03419
Merge pull request #1323 from dbungert/autoinstall-use-gap
filesystem: autoinstall support use_gap mode
2022-06-17 17:11:14 -06:00
Dan Bungert 8e529ca1ad filesystem: check use_gap devices can be boot 2022-06-17 09:44:12 -06:00
Dan Bungert d622c383f6 filesystem: offer autoinstall use_gap
Accept a new 'mode' parameter when using autoinstall guided storage.
The default mode is 'reformat_disk', which acts as today.
A new mode of 'use_gap' is available, which does not reformat the disk.
2022-06-17 09:40:43 -06:00
Dan Bungert b2d5fffcc0 filesystem: guided_method refactoring
Update the guided_methods, particularly guided_direct.  It now does a
direct call to create_partition, bypassing the increasingly complicated
partition_disk_handler, making it more similar to guided_lvm, and making
way for guided partitioning into a gap.
2022-06-16 17:27:37 -06:00
Dan Bungert ddecd59dba
Merge pull request #1316 from dbungert/fs-sizing-tweaks
filesystem: several size related tweaks
2022-06-16 14:51:13 -06:00
Michael Hudson-Doyle a97d05bedf
Merge pull request #1320 from dbungert/fix-group-list-test
unittests: fix group check
2022-06-17 08:46:39 +12:00
Carlos Nihelton b6bb0cca5e
Merge pull request #1321 from CarlosNihelton/tcp-no-timeout
[system_setup] Avoid integration test failure due server exited
2022-06-16 17:39:39 -03:00
Carlos Nihelton c82fa43964
Merge pull request #1322 from CarlosNihelton/system-setup-help
Better help message for system setup
2022-06-16 17:36:28 -03:00
Carlos Nihelton d7697c0d0f
Without the timeout another kill is necessary
otherwise the process could stay running if the first `exit 1` after its
start was taken.
2022-06-16 17:29:44 -03:00
Carlos Nihelton 97f0f82910
Avoid integration to fail due TCP server timeout
timeout 60 might be too short for someone with lots of network
interfaces.
Since we grab the PID and run the server in the background, the timeout
is not critically necessary.
2022-06-16 16:43:44 -03:00
Carlos Nihelton 347e6e640e
Better help message for system setup 2022-06-16 16:15:16 -03:00
Dan Bungert 7f233bc09b unittests: fix group check
The recently changed group list check is a bit fragile to the exact
groups available on the system.  Mock out the list of actually existing
groups.
2022-06-16 11:00:39 -06:00
Dan Bungert 44affdf0f2
Merge pull request #1319 from blackboxsw/drop-deprecated-groups-cloud-config-schema
cloud-config: schema drop deprecated dict user.groups value type
2022-06-16 08:18:38 -06:00
Dan Bungert d616f1f345
Merge pull request #1317 from blackboxsw/fix-dev-apt-deps
deps: fix missing developer dep python3-mock for apt-deps make target
2022-06-16 08:17:39 -06:00
Chad Smith 62ad68bd76 cloud-config: schema drop deprecated dict user.groups value type
Align with latest cloud-init schema avoid using depracated
value types for users. groups definitions in cloud-config.

Also fix get_users_and_groups to return a list instead of
dict as all call sites expected it to return a list.
2022-06-15 21:48:35 -06:00
Chad Smith 36fe76a963 tests: use mock from stdlib unittest to avoid additional test dependency 2022-06-15 19:43:30 -06:00
Dan Bungert 6dffc15748 filesystem: bootfs size func takes an input size
Previously it operated on a disk, but we may want to scale based on only
part of a disk.
2022-06-15 16:34:07 -06:00
Dan Bungert 19631f04ff filesystem: create_partition size from gap
Previously it used the size from the spec
2022-06-15 16:34:07 -06:00
Dan Bungert 8a16a74d34 filesystem: send minimal gaps to create_partition
Before calling create_partition, pre-split gaps to the desired size of
the partition.
2022-06-15 16:34:07 -06:00
Olivier Gayot 2f06d30172 ubuntu-pro: don't assume an overlay is present in show_* functions
show_* functions from the UbuntuProView object always assumed that the
loading overlay was present. When called, they would therefore attempt
to close the overlay. This results in a crash if no overlay is present.

With the current design, it is fine because we never call the show_*
functions without an overlay being present.

However, with new design of Ubuntu Pro, sometimes the show_* functions
will be called without an overlay.

We now delegate the responsibility of removing the overlay by using a
callback system.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-15 14:55:12 +02:00
Olivier Gayot 2ee5550c9e ui: add ability to change button label in SomethingFailed message box
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-15 11:54:32 +02:00
Dan Bungert df1a5adf0b
Merge pull request #1313 from dbungert/largest-gap-multidisk
gaps: allow largest_gap to accept a list
2022-06-14 18:16:30 -06:00
Dan Bungert c824f971f0 gaps: operate on list of devices 2022-06-14 11:45:57 -06:00
Dan Bungert 11b77e8b2d gaps: use ValueError for split
Callers may want to catch that.
2022-06-14 11:44:53 -06:00
Olivier Gayot a93202e0a1
Merge pull request #1307 from ogayot/subforms-recurse-validation
Check child forms status when disabling/enabling Done button of a form
2022-06-14 15:23:05 +02:00
Dan Bungert ac69be188b
Merge pull request #1300 from dbungert/lp-1975629
debug shell: use a clean environment
2022-06-13 20:18:06 -06:00
Dan Bungert 1fed27f3a5
Merge pull request #1312 from dbungert/iso-ai-file
autoinstall: fix cdrom location
2022-06-13 16:11:23 -06:00
Dan Bungert a6c67bc1e5 autoinstall: fix cdrom location 2022-06-13 14:22:40 -06:00
Dan Bungert 5b30732f14 debug shell: restore orig environment 2022-06-13 14:02:32 -06:00
Dan Bungert 74e118d735 snapcraft: save env vars 2022-06-13 14:02:19 -06:00
Dan Bungert a44939e402
Merge pull request #1309 from dbungert/gap-utils
gap: several utilities
2022-06-13 13:58:49 -06:00
Dan Bungert 1aa1ee5cb0 gaps: add gaps.at_offset 2022-06-13 11:29:18 -06:00
Dan Bungert cb2d184ef2 gaps: add gap.split 2022-06-13 11:29:17 -06:00
Olivier Gayot 7f4a72a12f
Merge pull request #1311 from ogayot/pro-services-auto-enabled
ubuntu-pro: add auto_enabled property for services
2022-06-13 17:45:17 +02:00
Olivier Gayot d67c71e0ba ubuntu-pro: add auto_enabled property for services
The JSON returned by uaclient for a status request contains the
auto_enabled property for each service. This property tells whether a
given service is enabled automatically when `ua attach` is done. We will
need this information going forward so we now include it in the success
response to /ubuntu_pro/check_token:

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

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-13 16:01:39 +02:00
Dan Bungert 6933e55843 gaps: test cleanup 2022-06-10 15:45:26 -06:00
Carlos Nihelton 039f5d45c0
Merge pull request #1306 from CarlosNihelton/wsl-tcp-deeng-284
Enables TCPSite for WSL
2022-06-10 12:50:52 -03:00
Dan Bungert e6cfd6b592
Merge pull request #1308 from dbungert/fix-boot-plan-gap
boot: update plans to use a better Gap
2022-06-10 09:12:10 -06:00
Dan Bungert 03f4760e4c boot: update plans to use a better Gap
The Gap object created in boot plans had size == 0, which can cause
problems if create_partition() actually looks at this size.
2022-06-09 16:53:40 -06:00
Olivier Gayot c72e7eec87 form: use subclass of BoundFormField that overrides is_in_error
Instead of using isinstance(self.widget, SubFormWidget) in
BoundFormField.is_in_error, we now implement a BoundSubFormField
class that inherits from BoundFormField. It is meant to be instantianted
for subforms fields only.

This class overrides is_in_error() to perform the additional checks in
the forms' sub-fields.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-09 11:28:36 +02:00
Olivier Gayot 10192e9b74 guided: refresh buttons when options are checked/unchecked
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-09 11:28:36 +02:00
Olivier Gayot 348195b4d6 form: disable Done button on validation failure of a child form
When the validation of a field fails in a form, we disable the Done
button. With child forms, however, it did not work because they have
their own set of hidden buttons ; that are not the ones the users
interacts with.

This patch makes parent forms recurse on the child forms when checking
if any field is in error. Also, when a child form undertakes validation,
it now propagates to the parent, so that the done button can be
immediately enabled/disabled.

Having a validation error in a child form that is not currently enabled
should not prevent the user from moving forward, so we disable recursion
for child forms that are disabled.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-09 11:28:36 +02:00
Carlos Nihelton 0263924386
Adds testing for IPv6.
Currently IPv4 is hardcoded, meaning IPv6 should not work even for
the loopback interface.
2022-06-08 12:17:23 -03:00
Carlos Nihelton 4c9a99e9ce
Asserts that only loopback connections are allowed. 2022-06-08 12:07:58 -03:00
Carlos Nihelton 858241956f
Add a simple test for TCP connectivity. 2022-06-07 14:53:29 -03:00
Carlos Nihelton 7e94f78c0a
Enhance comment and fix typo on it. 2022-06-07 13:27:15 -03:00
Carlos Nihelton 061efddec2
Missed linter warnings. 2022-06-06 17:57:00 -03:00