tests: add default for opts.kernel_cmdline

Ensure correct behavior in tests when kernel_cmdline is not set
correctly. Also add to the the schema cmd submodules make_app
function so that it doesn't crash when trying to read from
the kernel_cmdline in the ubuntu drivers.
This commit is contained in:
Chris Peterson 2024-03-29 14:32:13 -07:00
parent 2f92ddee53
commit 410b7326fa
2 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,7 @@ def make_schema(app):
def make_app():
parser = make_server_args_parser()
opts, unknown = parser.parse_known_args(["--dry-run"])
opts.kernel_cmdline = {}
app = SubiquityServer(opts, "")
# This is needed because the ubuntu-pro server controller accesses dr_cfg
# in the initializer.

View File

@ -45,6 +45,7 @@ def make_app(model=None):
app.prev_screen = mock.Mock()
app.hub = MessageHub()
app.opts = mock.Mock()
app.opts.kernel_cmdline = {}
app.opts.dry_run = True
app.scale_factor = 1000
app.echo_syslog_id = None