Commit Graph

235 Commits

Author SHA1 Message Date
Michael Hudson-Doyle 545d77eeab
Merge pull request #1006 from mwhudson/lp-1936248
fix "make check" on uefi systems
2021-07-15 13:18:46 +12:00
Dan Bungert 4ed4e51a2e Workaround dryrun test actually setting timezone
Until a proper fix can be finished, remove the set of timezone from the
integration tests.
2021-07-14 19:02:42 -06:00
Michael Hudson-Doyle 18c651343d fix "make check" on uefi systems
an ESP can be on a RAID now. Also always run the integration tests in UEFI mode.
2021-07-15 08:49:10 +10:00
Dan Bungert 9f1478cd96
Add new schema comparison, robust to timezone changes (#1002)
* Add new schema comparison, robust to timezone changes

Improve the schema comparison - mostly I'm worried about the
non-timezone items, spot check the timezone list for a few that should
be there.

* Incorporate feedback - pop
2021-07-13 18:13:46 -06:00
Dan Bungert 502c1193fd
Temp disable schema check on Impish (#1000)
Impish is adding more timezones, which is cool, but breaks my schema
check, so disable this there for now and come back later with a better
answer.

Also schema check seems to need curtin.
2021-07-13 11:17:55 -06:00
Dan Bungert 40945f1823
TimeZone: autoinstall and API (FR-1184) (#986)
* TimeZone: autoinstall and API

Add support for Get/Set timezone methods.  Get means that we inquire
with GeoIP as to which timezone is suggested.  Non-availability of
GeoIP, or a previous explicit Set, means that we return the system
timezone.  Set of timezone by Post results in set of the live system
timzeone, and queuing a set of the target system by way of cloud-init.

* Add clarifying comment about _request.
2021-07-13 06:25:03 -06:00
Michael Hudson-Doyle cf931f673f update script to update exsting checkout 2021-07-05 09:23:39 +12:00
Michael Hudson-Doyle f9410e4e86 install probert and curtin via Makefile for testing
rather than pip or apt respectively
2021-07-02 13:49:40 +12:00
Michael Hudson-Doyle 50ce450f2a add a gitdeps target to Makefile that checks out probert and curtin
This uses a silly python script to get the exact version that the
snapcraft.yaml specifies.
2021-07-02 13:48:49 +12:00
Dan Bungert 90b1bb9eed
Refactor - drop external_temp_file (#985)
Move unattended-upgrades to part of postinstall, so it can be done
before the restore_apt_config umount, which lets us get rid of the
redundant external_temp_file logic.
2021-06-28 17:11:49 -06:00
Michael Hudson-Doyle 6ab29c5868 install packages with -o APT::Get::Always-Include-Phased-Updates=true
to work around bug #1925745 in apt until it is SRUed.
2021-06-17 10:37:35 +12:00
Dan Bungert 21058464fd
make_cloudconfig - start moving cloud config generation to models (#975)
Add make_cloudconfig as a function that models should offer that allows
for generation of the cloud-config snippet.
Move snaplist and locale to this mechanism.
Add a test for snaplist output.
2021-06-08 16:54:29 -06:00
Michael Hudson-Doyle e812202869 wait for cloud-init in test-in-lxd.sh 2021-06-09 10:07:32 +12:00
Dan Bungert 1d42f897a1
test-in-lxd: remove privileged container usage (#974)
* test-in-lxd: remove privileged container usage

* Don't assume certain home directory name

* Try enabling groovy
2021-06-07 14:36:37 -06:00
Dan Bungert 4f9de12556
Split unit / integration tests a bit (#956)
Unit tests should be quick and run frequently.
Integration tests can be longer and run less often.
Split them up.
2021-05-17 07:31:29 -06:00
Michael Hudson-Doyle 1da1ead19c add a integation test for non-rich mode 2021-05-04 12:44:41 +12:00
Michael Hudson-Doyle 3b60666495
Merge pull request #925 from mwhudson/lp-1885644-again
add all documented fields to filesystem model classes
2021-04-12 11:24:23 +12:00
Michael Hudson-Doyle 5dbd872919 add test of mount options being propagated 2021-04-06 09:16:55 +12:00
Dan Bungert a0e2e244bd
add setting policy for post-install updates via autoinstall (#920)
* Add element updates (non-UI)

This can be controlled with autoinstall
updates: security or all

Also an API for controlling this:
curl --silent --unix-socket .subiquity/socket a/updates ->
"security"
curl -d '"all"' --unix-socket .subiquity/socket a/updates

* Automated tests - log grep for default/none/all states

* Enforce possible values on Updates controller

Route all the various get/set thru 2 common functions.
Validate incoming data.
2021-03-31 13:57:53 -06:00
Michael Hudson-Doyle fb649bf7d5 pre-process keyboard auto detection steps into API friendly format
Continuing the theme of previous work, this branch parses pc105.tree
into API-friendly attr-based classes at snap build time (which also lets
us check some constraints then and not at run time).
2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle 5d93eb824a process keyboard data into api friendly format when building snap
This is a bit sideways from the real thing I'm working on which is
moving most of the logic of keyboard handling to the server side but
anyway. This also lets me check some assumptions while processing the
data rather than in the view code.
2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle b25d899f7c use rsync instead of git archive to get uncommitted changes 2021-03-10 09:05:15 +13:00
Michael Hudson-Doyle d645ca1642 add a couple of super hacky scripts for quickly testing subiquity changes
The first of these scripts mashes the current branch's code over that of
a pre-existing subiquity snap.

The second uses the first to mash the current branch's code over the
subiquity snap from an ISO and then creates a new ISO with this new
snap.

It's all a bit terrifying but being able to get your changes into a
bootable ISO in about 30s is quite a large improvement on building the
snap from scratch.
2021-03-09 17:34:59 +13:00
Dan Bungert 2c6474f3cb Lock in current schema
Accidental schema updates are unintended, so enforce that.  Schema
updates that don't break API are fine, we can handle that by manually
regenerating the schema at such time.
2021-03-03 11:31:04 -07:00
Paride Legovini 8bfa0d705c inject-subiquity-snap: log xorriso errors
In command substitution stderr is not grabbed, so it's safe to drop the
/dev/null redirect to log it.
2021-02-23 13:11:54 +01:00
Michael Hudson-Doyle 2bdddd7858 update zfs service override 2021-02-19 09:36:17 +13:00
Michael Hudson-Doyle 7ce8bdfa81 fix github action, apparently we are running on 20.04 now
this worked yesterday, I promise!
2021-02-19 09:24:20 +13:00
Michael Hudson-Doyle 4f241d830b
Merge pull request #892 from mwhudson/lp-1914587
fail if -report_el_torito fails
2021-02-19 09:14:27 +13:00
Michael Hudson-Doyle d1afc54389 switch to github actions 2021-02-18 13:01:45 +13:00
Michael Hudson-Doyle 047a903353 fail if -report_el_torito fails 2021-02-12 15:42:31 +13:00
Michael Hudson-Doyle d39c52e4c4 put a full locale (language/location/codeset) in languagelist
the location is the default location for a language in
localechooser-data.
2021-02-12 15:03:10 +13:00
Michael Hudson-Doyle 565a570328 tidy code slightly and add a comment 2021-02-10 14:28:51 +13:00
Michael Hudson-Doyle f6b70096df restore special case for kab, as iso-codes in bionic is too old 2021-02-10 14:28:04 +13:00
Dimitri John Ledkov ff4a578308
scripts: fix lookup of languages without 639-3 translations
Fixes https://github.com/CanonicalLtd/subiquity/pull/886
2021-02-04 14:53:16 +00:00
Dimitri John Ledkov bb98d57fa0
scripts: fix make-language-lists for non-languagelist languages
Fixes #885
2021-02-04 14:39:54 +00:00
Michael Hudson-Doyle ef78e7d01c re-run snap-preseed in inject-subiquity-snap.sh 2021-01-06 14:04:50 +13:00
Michael Hudson-Doyle 7381df63d5
Merge pull request #859 from mwhudson/lp-1896497
use -report_el_torito as_mkisofs option of xorriso to find command to repack ISO
2020-11-04 15:30:26 +13:00
Michael Hudson-Doyle 449ad839aa update integration tests 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle d7a070962b fix shell quoting 2020-11-04 09:30:52 +13:00
Michael Hudson-Doyle 8987ab792c use -report_el_torito as_mkisofs option of xorriso to find command to repack ISO 2020-10-28 16:32:24 +13:00
Lucas Kanashiro 8cfa8c64d4 scripts/test-this-branch.sh: install needed dependencies 2020-08-22 14:11:52 -03:00
Foster "Forst" Snowhill dca298a815
inject-subiquity-snap: recalculate MD5 for installer.squashfs
The inject-subiquity-snap.sh script rebuilds the installer.squashfs filesystem, but does not recalculate its MD5 hash.
This leads to an error message during bootup process, complaining about one of the files being damaged, that file
being installer.squashfs.

This commit introduces an extra step to recalculate the MD5 hash of the installer.squashfs and write it into
md5sum.txt, as well as to remove the GPG signature of the installer filesystem, since it's invalid anyway.
2020-08-02 18:05:34 +02:00
Michael Hudson-Doyle d9cea264f1 clean up the xorriso arguments in inject-subiquity-snap a bit 2020-07-22 15:06:29 +12:00
Michael Hudson-Doyle bbfcdd7b25 sort installer cloud config after 90_dpkg.cfg 2020-06-16 13:55:30 +12:00
Michael Hudson-Doyle 2ddde49a43 use the "None" datasource for on-first-boot configuration
Using the NoCloud source meant that a filesystem label of "cidata"
(probably containing autoinstall config) could override the cloud-init
nocloud seed subiquity wrote and then users would not get created. So
instead write cloud config directly that hardcodes using the
DataSourceNone source and config for it.

https://bugs.launchpad.net/subiquity/+bug/1879103
2020-06-15 15:07:03 +12:00
Michael Hudson-Doyle 99ad097306 snapcraft.yaml fixery 2020-05-21 11:54:49 +12:00
Michael Hudson-Doyle a6d98f29e6 change languagelist format a bit, add some special cases 2020-05-21 11:54:49 +12:00
Michael Hudson-Doyle 5cb37acefc make some language lists at snap build time 2020-05-21 11:54:49 +12:00
Michael Hudson-Doyle 3c98f68fcf use a real locale in examples/autoinstall.yaml 2020-05-21 10:49:42 +12:00
Dimitri John Ledkov 2e85a2ecd6 i18n: add scripts to help with translation updates.
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
2020-05-06 13:22:13 +01:00
Michael Hudson-Doyle ba106bbbed tests 2020-05-05 23:05:59 +12:00
Michael Hudson-Doyle f814d9514f use more general context machinery to feed install events to progress view 2020-05-04 19:05:42 +12:00
Michael Hudson-Doyle 4564871ad2 fix tests 2020-05-04 15:28:42 +12:00
Michael Hudson-Doyle 8a84e470c5 make sure the size of a partition gets set to int 2020-05-04 14:16:03 +12:00
Michael Hudson-Doyle f8eef1d16a fix Subiquity.restart dry-run path now we actually hit that in runtests.sh 2020-04-29 19:46:17 +12:00
Michael Hudson-Doyle 05ca96d7ba run netplan generate --root .subiquity after each integration test 2020-04-29 19:39:10 +12:00
Michael Hudson-Doyle 670c9c838a add test for locale: in autoinstall file 2020-04-20 20:34:08 +12:00
Michael Hudson-Doyle 18e4d977e9 fix autoinstall refresh code to (a) match docs (b) work 2020-04-19 22:48:27 +12:00
Michael Hudson-Doyle e91f8bbf89 fix for omitting identity section when passing user-data 2020-04-19 21:44:09 +12:00
Michael Hudson-Doyle e3ec05a6c1 always include partition number in curtin config 2020-04-14 10:21:29 +12:00
Michael Hudson-Doyle 96a6dfd010 add integration-style test for reusing an existing partitions 2020-04-14 09:50:56 +12:00
Michael Hudson-Doyle be146972da fix travis 2020-04-07 21:37:42 +12:00
Michael Hudson-Doyle b0302484d2 fix tty check for autoinstalls 2020-04-07 20:34:38 +12:00
Michael Hudson-Doyle 467257ff9a hack for testing in lxd 2020-04-02 11:11:25 +13:00
Michael Hudson-Doyle 9a68ce91c1 fix not supplying snaps in autoinstall, oops 2020-04-02 10:47:47 +13:00
Michael Hudson-Doyle c1c33dee03 add a simple integration test for autoinstall 2020-04-02 10:22:08 +13:00
Dimitri John Ledkov 897fe56213 Try overriding zfs-mount.service 2020-03-05 16:53:35 +00:00
Dimitri John Ledkov cbaab430a3 Switch script to use python3, as python is no longer available
I guess good luck to the Jenkins CI?
2020-01-29 18:00:54 +00:00
Michael Hudson-Doyle 683d1932ac have replayed curtin runs create a log file too 2019-11-21 14:55:23 +13:00
Michael Hudson-Doyle ae033101e6 code for uploading to daisy 2019-11-21 14:54:35 +13:00
Michael Hudson-Doyle e8a9cdf4f8 have dry-run install failures replay events from a real failure 2019-11-21 11:25:43 +13:00
Michael Hudson-Doyle 0141defa01 changes suggested in review 2019-11-08 09:47:34 +13:00
Michael Hudson-Doyle 65a961be1a do not run the 100T raid tests, mdadm fails with SIGPIPE 2019-11-08 09:31:51 +13:00
Michael Hudson-Doyle 5d8c983448 make raid-size-tests.py a tiny bit friendlier 2019-11-08 09:31:51 +13:00
Michael Hudson-Doyle fde1c53141 sort raid devices consistently when computing size and when serializing 2019-11-08 09:30:22 +13:00
Michael Hudson-Doyle 233965b376 fix raid size calculation when sizes of devices in array vary
It turns out mdadm computes the headroom based on the first device in
the array, which means that the order of the devices matters!
2019-11-08 09:22:59 +13:00
Michael Hudson-Doyle 6b5e7adcf6 add some explanation to raid-size-tests.py 2019-11-08 09:22:59 +13:00
Michael Hudson-Doyle 5da663fede raid-size-tests.py: run in tmpfs, clean up better
ext4 limits files to a measly 16TiB!
2019-11-08 09:22:59 +13:00
Michael Hudson-Doyle 679b611077 add tests of get_raid_size against reality 2019-11-08 09:22:59 +13:00
Michael Hudson-Doyle ca02972195 add a controlled way to make various things fail
In dry-run mode, treat SUBIQUITY_DEBUG as a comma-separated list of
things to fail:

 * install-fail: curtin install fails
 * copy-logs-fail: the postinstall copying of logs fails
 * bpfail-full: full block device probing fails
 * bpfail-restricted: restricted block device probing fails

In addition, control-u makes the UI crash in dry-run mode.

(This is all for testing of crash report generation but does not depend
on that).
2019-11-04 10:43:29 +13:00
Paride Legovini 0501a1d33b inject-subiquity-snap: fix the ppc64 edge iso volume name 2019-10-08 11:29:31 +02:00
Paride Legovini 627ecadf6b inject-subiquity-snap: add support for ppc64 iso images 2019-10-08 10:37:12 +02:00
Michael Hudson-Doyle fb6ea590a5 still create a subiquity-debug.log symlink 2019-09-30 16:21:42 +13:00
Michael Hudson-Doyle 7c1154b758 create one log file per invocation
Log to subiquity-debug.log.$PID instead of just subiquity-debug.log.

When we implement error reports we'll obviously attach the log to the
error report. There's no point adding log messages from previous runs of
subiquity.
2019-09-30 13:47:56 +13:00
Paride Legovini a23c554af3 test-this-branch.sh: fix the ISO file name 2019-08-22 14:41:38 +02:00
Michael Hudson-Doyle 588c933505 use the xenial travis build environment 2019-07-18 09:40:03 +12:00
Dimitri John Ledkov 90bbad44c1 Enable -proposed for testing 2019-07-02 13:43:00 +01:00
Dimitri John Ledkov 94de7dc522 Merge remote-tracking branch 'origin/pull/500/head'
Merge using existing partitions. Revert to using archive
curtin/deps/etc.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
2019-07-02 13:18:46 +01:00
Dimitri John Ledkov dac6f12c0f Basic zdev view 2019-06-06 16:15:15 +01:00
Michael Hudson-Doyle 9ef3ce19a1 add ppa:mwhudson/devirt to get newer version of curtin for now 2019-05-30 15:38:09 +12:00
Michael Hudson-Doyle 0c55149c31 run integration tests with simple sample data 2019-05-30 15:33:59 +12:00
Michael Hudson-Doyle 0873225ad6 Flags that do not indicate a bootloader partition are ok_for_raid
Existing partitions can turn up with flags like "linux" and these are
fine to put into a RAID. I also checked all the other places we inspect
flag to check they weren't being over strict and they seem fine.
2019-05-02 10:45:57 +12:00
Michael Hudson-Doyle 27b49c9849 use yaml.safe_load instead of yaml.load 2019-03-26 13:59:38 +13:00
Michael Hudson-Doyle b94dfd719c fix inject-subiquity-snap for a local snap again 2019-03-23 21:44:06 +13:00
Michael Hudson-Doyle c1f8c10091 answers support for refresh screen 2019-03-12 11:49:03 +13:00
Michael Hudson-Doyle cb2203be10 allow specifying a track to follow in inject-subiquity-snap.sh 2019-03-06 15:15:01 +13:00
Michael Hudson-Doyle 18ff7f6973 seed subiquity with an assertion if one is there 2019-03-01 13:20:17 +13:00
Michael Hudson-Doyle 8365b5d507 add options to inject-subiquity-snap to allow a custom snapd and store url 2019-03-01 09:13:05 +13:00
Michael Hudson-Doyle 8892e027e9 make sure that dmcrypt passphrase does not end up in log 2019-02-28 11:55:44 +13:00
Michael Hudson-Doyle ee9956671e fix inject-subiquity-snap.sh to not exit 1 on non s390x 2019-02-22 12:13:13 +01:00
Michael Hudson-Doyle 8409c6e62e set DEBIAN_FRONTEND=noninteractive when setting up the lxd 2019-02-21 11:08:00 +01:00
Michael Hudson-Doyle b77aa9499e make sure all delays during replaying answers repsect SUBIQUITY_REPLAY_TIMESCALE 2019-02-21 11:07:54 +01:00
Michael Hudson-Doyle 0e844ccffa fix inject-subiquity-snap.sh now that installer overlay does not necessarily contain core snap 2018-12-19 12:23:05 +13:00
Dimitri John Ledkov 5041731ff7 scripts: add s390x support to inject-subiquity-snap 2018-11-23 01:45:15 +00:00
Michael Hudson-Doyle 0457985208 fixup tests 2018-07-11 14:55:41 +12:00
Michael Hudson-Doyle 569700864a a guided option that uses LVM 2018-07-07 21:41:30 +12:00
Michael Hudson-Doyle 32b7d785cd answers support for lvm and some related fixes 2018-07-07 20:59:47 +12:00
Michael Hudson-Doyle 1cdfea174d add some validation of curtin config generated from answers 2018-06-19 11:43:59 +12:00
Scott Moser af94275618 Make tox and Makefile more similar.
This does a few things with the end goal of making simplifying and
making consistent tox and 'make' methods of test or check.

Things here:
 * move python programs out of bin and into their own main.  Use
   entry_points to get scripts written for them.  One gain here is
   that we no longer have python programs that are not named .py.
   flake8 and friends would not check those programs by default.
 * install scripts in bin/ using the setup.py scripts and adjust
   snapcraft.yaml and debian packaging for that.
 * declare and use PYTHON in Makefile to avoid repeating 'python3'
 * declare and use CHECK_DIRS in Makefile for list of dirs to check.
 * no longer run 'flake8' from 'make check' by default.
 * remove the old tests/ directory.
2018-06-05 22:19:17 -04:00
Michael Hudson-Doyle 43f581bca4 update travis jobs: test on cosmic, run make lint 2018-05-25 10:56:01 +12:00
Ryan Harper 5f8b562361 Add bin/*tui to pyflakes3 check 2018-05-24 16:59:31 -05:00
Ryan Harper 879901149f Add bin/*-tui to pep8 checks 2018-05-24 16:59:31 -05:00
Ryan Harper acd24c0796 Add pep8 script 2018-05-24 16:51:51 -05:00
Ryan Harper a0bf68f3c4 pyflakes3 fixes
Add and enable pyflakes3 on console_conf, subiquity, subiquitycore and tests.
Replace NOQA markers with __all__ declarations for module imports.
Replace some obvious deadcode that voilates flake8, separate pass for removing
dead code rather than commenting will be handled later.
2018-05-24 16:51:51 -05:00
Ryan Harper 0849db7c14 Add pyflakes3 target and script 2018-05-24 16:51:49 -05:00
Michael Hudson-Doyle a35723089d a simple script to put the edge subiquity snap into a new iso 2018-03-14 15:25:53 +13:00
Michael Hudson-Doyle 6b156766bb change replay-curtin-log to give a more realistic experience in dry-run mode 2018-02-28 15:57:35 +13:00
Michael Hudson-Doyle ef0632175b use a different syslog identifier for each subiquity process 2018-02-28 13:49:24 +13:00
Michael Hudson-Doyle f7a93e6d1b move to running tests in lxd rather than docker
other work requires having systemd running
2018-02-28 13:42:47 +13:00
Michael Hudson-Doyle 05c5f4218a make log replay timescale adjustable
want to be able to slow it down when hacking on the log view!
2018-02-12 14:44:40 +13:00
Michael Hudson-Doyle 1a939844fb use the journald event reporter that is now part of curtin 2018-02-12 13:37:00 +13:00
Michael Hudson-Doyle 2779bac01a change the log replayer to be more realistic 2018-02-12 13:30:00 +13:00
Michael Hudson-Doyle aa509d317a make it easier to replace the squashfses in an iso 2017-12-21 14:04:17 +13:00
Michael Hudson-Doyle 2eba19e5de mostly pointless tweaking of inject-subiquity-snap 2017-12-21 12:02:08 +13:00
Michael Hudson-Doyle bfe374f96e tidy up inject-this-snap with some bashisms 2017-12-19 16:03:53 +13:00
Michael Hudson-Doyle 168d372e68 allow editing filesystem.squashfs with inject-subiquity-snap 2017-12-19 15:51:39 +13:00
Michael Hudson-Doyle 3bad7e1295 add -c option to inject-subiquity-snap.sh too 2017-11-17 12:34:23 +13:00
Michael Hudson-Doyle 5d65ab88ab add -i flag to inject-subiquity-snap.sh to allow random edits of iso 2017-11-17 10:25:08 +13:00
Michael Hudson-Doyle ca631ab9c1 inject-subiquity-snap.sh: fix perms in generated installer.squashfs
this makes the generated ISOs boot again.
2017-11-10 15:37:24 +13:00
Michael Hudson-Doyle d756596093 hook up curtin's event reporting into journald and watch these messages during install 2017-09-18 22:50:00 +12:00
Michael Hudson-Doyle fae35af6ee fix subquity -> subiquity typos, including in script name 2017-08-23 10:26:09 +12:00
Michael Hudson-Doyle a94f0f2f43 add another helper script 2017-08-23 10:20:44 +12:00
Michael Hudson-Doyle 64b420111e move instructions from script to README 2017-08-22 12:18:59 +12:00
Michael Hudson-Doyle ce3ce3cb3e update README.md 2017-08-22 12:05:08 +12:00
Michael Hudson-Doyle eec72a34a6 add script to inject custom subiquity snap into downloaded iso 2017-08-22 12:02:33 +12:00