Skip to content

Fixup and refactor Hetzner backend tests#348

Merged
edolstra merged 14 commits intoNixOS:masterfrom
aszlig:fixup-hetzner-tests
Oct 26, 2015
Merged

Fixup and refactor Hetzner backend tests#348
edolstra merged 14 commits intoNixOS:masterfrom
aszlig:fixup-hetzner-tests

Conversation

@aszlig
Copy link
Member

@aszlig aszlig commented Oct 21, 2015

These tests were broken since 209aa19.

Also, this switches the rescue image to Debian Jessie, so it doesn't reflect the current situation but the upcoming situation. I've asked the Hetzner staff about a date of the switch, but they still have issues to solve on their own, so they couldn't provide a specific date but a "by the end of the year".

The main reason for the switch was that Debian Jessie has some major changes, which includes their switch to systemd. I found it not worth the work to refactor it and patch it up just so that we have a VM test that uses Debian Wheezy.

aszlig added 13 commits October 21, 2015 17:56
We're going to split up the expression file, so we can break off
unimportant stuff into other files than the default.nix.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
We now do this properly by also signing the repository with a valid GPG
key instead of trying to force APT into "insecure" mode.

So far we had repository creatien in the derivation creating the rescue
image, which now is split off because we want to trim down build time of
the rescue image to only the essential parts. That way it's easier to
work on and/or debug the rescue image creation.

As for the repository creation itself, it's now comprised of three
derivations:

 * Snakeoil GPG key
 * Snakeoil GPG key Debian package
 * The finished APT repository

Right now I'm not sure whether we can avoid the keyring package, but for
the matter of completeness it's good to have it (especially if we want
to generalize it for <nixpkgs> someday).

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
We also switch to the latest version of live-build to avoid a range of
bugs and incompatibilities to the version shipped with Jessie.

The main reason however is that the real Hetzner rescue system is now on
Jessie, so in order to get our test environment as close to this, we
need to update as well.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
We want to ensure we don't have to cope with all the changes to the nex
release of live-build, so we create a proper Debian package and put it
into the APT repository.

The reason why this is the best way to deal with it is because
live-build's goal is to go for unmodified Debian packages and the
configuration file names frequently change between versions.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
The chroot hook scripts need to be suffixed with .hook.chroot in the
latest version of live-build, so let's avoid stumbling on changes like
this by setting it imperatively in the testScript.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
It's a dummy anyway, so it's just ugly if the baudrate sticks around ;-)

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This needs cpio within the live-build process, because it's using a
construct of find | cpio to copy the files over to the chroot.

As for the journal configuration, we want to have full information about
what's going on in the rescue system routed to the serial device.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
The hook we've used so far doesn't work anymore and also isn't
documented anymore in the latest version of live-build. So let's copy
the full bootloaders directory and change it directly instead of a hook.

Now, the rescue systems should properly boot.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Both $target1 and $target2 are set up the same way except for very few
differences, so it really makes sense to put them into a common sub.

Functionality-wise there are no changes, except for dropping the work-
around regarding mkfs.btrfs, which is no longer needed in newer versions
of live-build.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
On Debian Jessie, password authentication as user root isn't permitted
anymore, so we need to enable it for the rescue targets (because the
real Hetzner ones work solely on password authentication).

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Only an aesthetics issue for the resulting test log, no changes in
functionality.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
We now no longer pollute the main test file, so that
tests/hetzner-backend/default.nix is now solely about the real test
while the implementation details about the rescue ISO are now in
rescue-image.nix and other files in that directory.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This reverts commit 209aa19.

Our tests are now working again, so we can build them on Hydra.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
@aszlig
Copy link
Member Author

aszlig commented Oct 22, 2015

One commit incoming, please do not merge yet :-)

This is in par with 2a76f9c.

Over there, we do the same fix for the "none" backend. The approach here
doesn't suffer from the same problems because we were using myEnvFun,
which happens to properly reference the store paths.

While this is working, it's ugly as hell because myEnvFun could not only
cease to exist but also change implementation, so we're now doing the
same as in the referenced commit now.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
@aszlig
Copy link
Member Author

aszlig commented Oct 22, 2015

Done, ready to be merged :-)

aszlig added a commit to aszlig/nixops that referenced this pull request Oct 23, 2015
Fixup and refactor Hetzner backend tests
aszlig added a commit to openlab-aux/vuizvui that referenced this pull request Oct 23, 2015
Instead of merging all those PRs via the patches attribute, I've now
created a branch that has all those PRs merged, which are:

 * NixOS/nixops#201: Use dedicated SSH keypair for "none" backend
 * NixOS/nixops#348: Fixup and refactor Hetzner backend tests
 * NixOS/nixops#349: hetzner: Don't create /root/.ssh/authorized_keys
 * NixOS/nixops#350: Fix tests for the "none" backend

So our version of NixOps now should now correctly cope with
users.mutableUsers set to false.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
edolstra added a commit that referenced this pull request Oct 26, 2015
Fixup and refactor Hetzner backend tests
@edolstra edolstra merged commit aa708f5 into NixOS:master Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants