aboutsummaryrefslogtreecommitdiff
path: root/nixos/tests
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-09-06 03:20:09 +0200
committerJan Tojnar <jtojnar@gmail.com>2019-09-06 03:20:09 +0200
commitcdf426488b5dc3a7c051d7ad1c90c07dc0c3a89f (patch)
tree3fdd8ed1c086fb0ddf93941114bb1cbbb4659af9 /nixos/tests
parente7cccdbb139ccf2f9f170500f40c04a6237a2da1 (diff)
parented54a5b51dc9542df94f70b25a13d86d1f494e64 (diff)
Merge branch 'master' into staging-next
Fixed trivial conflicts caused by removing rec.
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/ceph.nix52
-rw-r--r--nixos/tests/kubernetes/base.nix5
-rw-r--r--nixos/tests/kubernetes/dns.nix3
-rw-r--r--nixos/tests/kubernetes/rbac.nix4
-rw-r--r--nixos/tests/quake3.nix4
5 files changed, 40 insertions, 28 deletions
diff --git a/nixos/tests/ceph.nix b/nixos/tests/ceph.nix
index 8722ea33ec5..0706b68075c 100644
--- a/nixos/tests/ceph.nix
+++ b/nixos/tests/ceph.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({pkgs, ...}: {
+import ./make-test.nix ({pkgs, lib, ...}: {
name = "All-in-one-basic-ceph-cluster";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ lejonet ];
@@ -7,6 +7,7 @@ import ./make-test.nix ({pkgs, ...}: {
nodes = {
aio = { pkgs, ... }: {
virtualisation = {
+ memorySize = 1536;
emptyDiskImages = [ 20480 20480 ];
vlans = [ 1 ];
};
@@ -24,9 +25,6 @@ import ./make-test.nix ({pkgs, ...}: {
ceph
xfsprogs
];
- nixpkgs.config.packageOverrides = super: {
- ceph = super.ceph.override({ nss = super.nss; libxfs = super.libxfs; libaio = super.libaio; jemalloc = super.jemalloc; });
- };
boot.kernelModules = [ "xfs" ];
@@ -51,6 +49,9 @@ import ./make-test.nix ({pkgs, ...}: {
enable = true;
daemons = [ "0" "1" ];
};
+
+ # So that we don't have to battle systemd when bootstraping
+ systemd.targets.ceph.wantedBy = lib.mkForce [];
};
};
@@ -61,24 +62,26 @@ import ./make-test.nix ({pkgs, ...}: {
# Create the ceph-related directories
$aio->mustSucceed(
- "mkdir -p /var/lib/ceph/mgr/ceph-aio/",
- "mkdir -p /var/lib/ceph/mon/ceph-aio/",
- "mkdir -p /var/lib/ceph/osd/ceph-{0..1}/",
- "chown ceph:ceph -R /var/lib/ceph/"
+ "mkdir -p /var/lib/ceph/mgr/ceph-aio",
+ "mkdir -p /var/lib/ceph/mon/ceph-aio",
+ "mkdir -p /var/lib/ceph/osd/ceph-{0,1}",
+ "chown ceph:ceph -R /var/lib/ceph/",
+ "mkdir -p /etc/ceph",
+ "chown ceph:ceph -R /etc/ceph"
);
# Bootstrap ceph-mon daemon
$aio->mustSucceed(
- "mkdir -p /var/lib/ceph/bootstrap-osd && chown ceph:ceph /var/lib/ceph/bootstrap-osd",
"sudo -u ceph ceph-authtool --create-keyring /tmp/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *'",
- "ceph-authtool --create-keyring /etc/ceph/ceph.client.admin.keyring --gen-key -n client.admin --set-uid=0 --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow *' --cap mgr 'allow *'",
- "ceph-authtool /tmp/ceph.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring",
- "monmaptool --create --add aio 192.168.1.1 --fsid 066ae264-2a5d-4729-8001-6ad265f50b03 /tmp/monmap",
+ "sudo -u ceph ceph-authtool --create-keyring /etc/ceph/ceph.client.admin.keyring --gen-key -n client.admin --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow *' --cap mgr 'allow *'",
+ "sudo -u ceph ceph-authtool /tmp/ceph.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring",
+ "monmaptool --create --add aio 192.168.1.1 --fsid 066ae264-2a5d-4729-8001-6ad265f50b03 /tmp/monmap",
"sudo -u ceph ceph-mon --mkfs -i aio --monmap /tmp/monmap --keyring /tmp/ceph.mon.keyring",
- "touch /var/lib/ceph/mon/ceph-aio/done",
+ "sudo -u ceph touch /var/lib/ceph/mon/ceph-aio/done",
"systemctl start ceph-mon-aio"
);
$aio->waitForUnit("ceph-mon-aio");
+ $aio->mustSucceed("ceph mon enable-msgr2");
# Can't check ceph status until a mon is up
$aio->succeed("ceph -s | grep 'mon: 1 daemons'");
@@ -90,6 +93,7 @@ import ./make-test.nix ({pkgs, ...}: {
);
$aio->waitForUnit("ceph-mgr-aio");
$aio->waitUntilSucceeds("ceph -s | grep 'quorum aio'");
+ $aio->waitUntilSucceeds("ceph -s | grep 'mgr: aio(active,'");
# Bootstrap both OSDs
$aio->mustSucceed(
@@ -112,8 +116,8 @@ import ./make-test.nix ({pkgs, ...}: {
"systemctl start ceph-osd-1"
);
- $aio->waitUntilSucceeds("ceph osd stat | grep '2 osds: 2 up, 2 in'");
- $aio->waitUntilSucceeds("ceph -s | grep 'mgr: aio(active)'");
+ $aio->waitUntilSucceeds("ceph osd stat | grep -e '2 osds: 2 up[^,]*, 2 in'");
+ $aio->waitUntilSucceeds("ceph -s | grep 'mgr: aio(active,'");
$aio->waitUntilSucceeds("ceph -s | grep 'HEALTH_OK'");
$aio->mustSucceed(
@@ -135,5 +139,23 @@ import ./make-test.nix ({pkgs, ...}: {
"ceph osd pool ls | grep 'aio-test'",
"ceph osd pool delete aio-other-test aio-other-test --yes-i-really-really-mean-it"
);
+
+ # As we disable the target in the config, we still want to test that it works as intended
+ $aio->mustSucceed(
+ "systemctl stop ceph-osd-0",
+ "systemctl stop ceph-osd-1",
+ "systemctl stop ceph-mgr-aio",
+ "systemctl stop ceph-mon-aio"
+ );
+ $aio->succeed("systemctl start ceph.target");
+ $aio->waitForUnit("ceph-mon-aio");
+ $aio->waitForUnit("ceph-mgr-aio");
+ $aio->waitForUnit("ceph-osd-0");
+ $aio->waitForUnit("ceph-osd-1");
+ $aio->succeed("ceph -s | grep 'mon: 1 daemons'");
+ $aio->waitUntilSucceeds("ceph -s | grep 'quorum aio'");
+ $aio->waitUntilSucceeds("ceph osd stat | grep -e '2 osds: 2 up[^,]*, 2 in'");
+ $aio->waitUntilSucceeds("ceph -s | grep 'mgr: aio(active,'");
+ $aio->waitUntilSucceeds("ceph -s | grep 'HEALTH_OK'");
'';
})
diff --git a/nixos/tests/kubernetes/base.nix b/nixos/tests/kubernetes/base.nix
index f5307f253a5..f21634c4ffb 100644
--- a/nixos/tests/kubernetes/base.nix
+++ b/nixos/tests/kubernetes/base.nix
@@ -30,10 +30,7 @@ let
{ config, pkgs, lib, nodes, ... }:
mkMerge [
{
- boot = {
- postBootCommands = "rm -fr /var/lib/kubernetes/secrets /tmp/shared/*";
- kernel.sysctl = { "fs.inotify.max_user_instances" = 256; };
- };
+ boot.postBootCommands = "rm -fr /var/lib/kubernetes/secrets /tmp/shared/*";
virtualisation.memorySize = mkDefault 1536;
virtualisation.diskSize = mkDefault 4096;
networking = {
diff --git a/nixos/tests/kubernetes/dns.nix b/nixos/tests/kubernetes/dns.nix
index e7db0a58ab6..46bcb01a526 100644
--- a/nixos/tests/kubernetes/dns.nix
+++ b/nixos/tests/kubernetes/dns.nix
@@ -77,7 +77,6 @@ let
singleNodeTest = {
test = ''
# prepare machine1 for test
- $machine1->waitForUnit("kubernetes.target");
$machine1->waitUntilSucceeds("kubectl get node machine1.${domain} | grep -w Ready");
$machine1->waitUntilSucceeds("docker load < ${redisImage}");
$machine1->waitUntilSucceeds("kubectl create -f ${redisPod}");
@@ -103,8 +102,6 @@ let
# Node token exchange
$machine1->waitUntilSucceeds("cp -f /var/lib/cfssl/apitoken.secret /tmp/shared/apitoken.secret");
$machine2->waitUntilSucceeds("cat /tmp/shared/apitoken.secret | nixos-kubernetes-node-join");
- $machine1->waitForUnit("kubernetes.target");
- $machine2->waitForUnit("kubernetes.target");
# prepare machines for test
$machine1->waitUntilSucceeds("kubectl get node machine2.${domain} | grep -w Ready");
diff --git a/nixos/tests/kubernetes/rbac.nix b/nixos/tests/kubernetes/rbac.nix
index 967fe506004..3ce7adcd0d7 100644
--- a/nixos/tests/kubernetes/rbac.nix
+++ b/nixos/tests/kubernetes/rbac.nix
@@ -94,8 +94,6 @@ let
singlenode = base // {
test = ''
- $machine1->waitForUnit("kubernetes.target");
-
$machine1->waitUntilSucceeds("kubectl get node machine1.my.zyx | grep -w Ready");
$machine1->waitUntilSucceeds("docker load < ${kubectlImage}");
@@ -118,8 +116,6 @@ let
# Node token exchange
$machine1->waitUntilSucceeds("cp -f /var/lib/cfssl/apitoken.secret /tmp/shared/apitoken.secret");
$machine2->waitUntilSucceeds("cat /tmp/shared/apitoken.secret | nixos-kubernetes-node-join");
- $machine1->waitForUnit("kubernetes.target");
- $machine2->waitForUnit("kubernetes.target");
$machine1->waitUntilSucceeds("kubectl get node machine2.my.zyx | grep -w Ready");
diff --git a/nixos/tests/quake3.nix b/nixos/tests/quake3.nix
index d3e59a32373..4253ce4a867 100644
--- a/nixos/tests/quake3.nix
+++ b/nixos/tests/quake3.nix
@@ -12,9 +12,9 @@ let
# Only allow the demo data to be used (only if it's unfreeRedistributable).
unfreePredicate = pkg: with pkgs.lib; let
- allowDrvPredicates = [ "quake3-demo" "quake3-pointrelease" ];
+ allowPackageNames = [ "quake3-demodata" "quake3-pointrelease" ];
allowLicenses = [ pkgs.lib.licenses.unfreeRedistributable ];
- in any (flip hasPrefix pkg.name) allowDrvPredicates &&
+ in elem pkg.pname allowPackageNames &&
elem (pkg.meta.license or null) allowLicenses;
in