This is part of a changeset intended to have the API tests run in
parallel. I don't consider this ideal - I still see failures when
running tests in parallel - but am providing it now with the intent of
helping people who are seeing api test flakiness even when those tests
are run serially.
* check for socket existence on startup
* lengthen timeouts on shutdown
On system_setup, we always run the subiquity server. On WSL, ensure we
wipe the server-state file (no systemd fallback) before starting the
server.
Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
Those commands needs to be async to be able to still answer GET/POST
request while configure is running.
This allows showing up the summary page immediately.
Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
Shows immediately the summary page. Before, this one was making a GET
request to the server, which was stuck on any long running command in
the controller.
Now, affect correctly the identity in memory and reuse it if needed.
Show a progress message while the configuration is happening and replace
it with a "completed" text on success.
Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
We previously only went on this page when DONE or in ERROR state. Allow
now to be in any state as we switch to it as soon as possible.
Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
The progress controller was already optional in
subiquity/server/controllers/cmdlist.py. However, there was one missing
place in show_progress(). Use a similar getattr strategy.
When running the unit tests after introducing a new one in the previous commit, the following error appeared:
subiquity/subiquity/common/resources.py:36: ResourceWarning: unclosed file <_io.TextIOWrapper name='./users-and-groups' mode='r' encoding='UTF-8'>
groups = open(users_and_groups_path).read().split()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
This commit replaces a bare open() call with a context manager.
The test case validates the following:
* Main user from subiquity config + secondary users from cloud-init userdata are merged into the same list and in the
correct order
* "users" section in cloud-init userdata is still present even if the main user is not defined
The current merge_config() function from curtin does not merge lists in any way, but overwrites them. This is generally
a good idea, but in case of user-data we may want to merge lists instead.
One of the possible use cases is defining the main user in the "identity" section, and some extra users in the
user-data "users" section.
Before, the user defined in the "identity" section overwrote any users defined in user-data. With this change, the user
list can now be automatically merged, with user-data having lower priority than autoinstall configuration.
An example of such a configuration:
#cloud-config
autoinstall:
version: 1
...
identity:
hostname: testname
realname: Real Name
username: someuser
password: "$6$..."
user-data:
users:
- name: extrauser
gecos: Extra User
ssh_authorized_keys:
- "ssh-ed25519 AAAA..."
shell: /bin/bash
- With 'prefill' working, calling Powershell to find Windows locale
is not required anymore.
- Since `f21986be` subiquity's default locale controller respects
mode.selected_language initialization.
- Init method changed to accept that data, which could be None.
- If valid, user Identity and Locale are prepopulated.
- Server parses the YAML and send valid info (or None) to the Model.
- This is just a preparation for a feature which affects system_setup.
- The proposed change enables locale controller to respect the model
selected_language if initialized before LocaleController.start().
- This will be used in the feature which will allow prefilling
installation UI screens during WSL installation with information
acquired from Windows environment.