diff options
author | tv <tv@krebsco.de> | 2018-05-09 11:11:50 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-05-09 11:43:08 +0200 |
commit | 47c0b0261eabdf230bfc7a375a3a008a04b61c4a (patch) | |
tree | 5f63540493553f877ce823c4465dd2cf561765af /krebs/6tests | |
parent | 3f3c12dcd06ba211a484aabf011880a83e5832fd (diff) |
krebs: 6tests -> 0tests
Diffstat (limited to 'krebs/6tests')
-rw-r--r-- | krebs/6tests/data/secrets/grafana_security.nix | 1 | ||||
-rw-r--r-- | krebs/6tests/data/secrets/hashedPasswords.nix | 1 | ||||
-rw-r--r-- | krebs/6tests/data/secrets/retiolum.rsa_key.priv | 0 | ||||
-rw-r--r-- | krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix | 1 | ||||
-rw-r--r-- | krebs/6tests/data/secrets/ssh.id_ed25519 | 0 | ||||
-rw-r--r-- | krebs/6tests/data/test-config.nix | 22 | ||||
-rw-r--r-- | krebs/6tests/data/test-source.nix | 12 | ||||
-rw-r--r-- | krebs/6tests/default.nix | 6 | ||||
-rw-r--r-- | krebs/6tests/deploy.nix | 106 |
9 files changed, 0 insertions, 149 deletions
diff --git a/krebs/6tests/data/secrets/grafana_security.nix b/krebs/6tests/data/secrets/grafana_security.nix deleted file mode 100644 index 0967ef424..000000000 --- a/krebs/6tests/data/secrets/grafana_security.nix +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/krebs/6tests/data/secrets/hashedPasswords.nix b/krebs/6tests/data/secrets/hashedPasswords.nix deleted file mode 100644 index 0967ef424..000000000 --- a/krebs/6tests/data/secrets/hashedPasswords.nix +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/krebs/6tests/data/secrets/retiolum.rsa_key.priv b/krebs/6tests/data/secrets/retiolum.rsa_key.priv deleted file mode 100644 index e69de29bb..000000000 --- a/krebs/6tests/data/secrets/retiolum.rsa_key.priv +++ /dev/null diff --git a/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix b/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix deleted file mode 100644 index 963e6db8b..000000000 --- a/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix +++ /dev/null @@ -1 +0,0 @@ -"lol" diff --git a/krebs/6tests/data/secrets/ssh.id_ed25519 b/krebs/6tests/data/secrets/ssh.id_ed25519 deleted file mode 100644 index e69de29bb..000000000 --- a/krebs/6tests/data/secrets/ssh.id_ed25519 +++ /dev/null diff --git a/krebs/6tests/data/test-config.nix b/krebs/6tests/data/test-config.nix deleted file mode 100644 index f0927ddd9..000000000 --- a/krebs/6tests/data/test-config.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - imports = [ - <stockholm/krebs> - <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix> - <nixpkgs/nixos/modules/testing/test-instrumentation.nix> - ]; - - krebs.hosts.minimal = { - cores = 1; - secure = false; - }; - - boot.loader.grub.enable = false; - boot.loader.systemd-boot.enable = true; - - krebs.build = { - host = config.krebs.hosts.minimal; - user = config.krebs.users.krebs; - }; -} diff --git a/krebs/6tests/data/test-source.nix b/krebs/6tests/data/test-source.nix deleted file mode 100644 index dfc6b3297..000000000 --- a/krebs/6tests/data/test-source.nix +++ /dev/null @@ -1,12 +0,0 @@ -with import <stockholm/lib>; -evalSource "" [{ - nixos-config = { - symlink.target = toString ./test-config; - }; - nixpkgs = { - symlink.target = toString <nixpkgs>; - }; - stockholm = { - symlink.target = toString <stockholm>; - }; -}] diff --git a/krebs/6tests/default.nix b/krebs/6tests/default.nix deleted file mode 100644 index c0ca00296..000000000 --- a/krebs/6tests/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -with import <stockholm/lib>; -{ ... }: - -{ - deploy = import ./deploy.nix; -} diff --git a/krebs/6tests/deploy.nix b/krebs/6tests/deploy.nix deleted file mode 100644 index 156e9239f..000000000 --- a/krebs/6tests/deploy.nix +++ /dev/null @@ -1,106 +0,0 @@ -with import <stockholm/lib>; -import <nixpkgs/nixos/tests/make-test.nix> ({ ... }: - -let - pkgs = import <nixpkgs> { overlays = [(import ../5pkgs)]; }; - test-config = <stockholm/krebs/6tests/data/test-config.nix>; - privKey = '' - -----BEGIN OPENSSH PRIVATE KEY----- - b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW - QyNTUxOQAAACD1tYD8r6Fcd7bq3Z0nvo5483nXQ8c4LFh0fcw8rOCQtQAAAJBTNHK6UzRy - ugAAAAtzc2gtZWQyNTUxOQAAACD1tYD8r6Fcd7bq3Z0nvo5483nXQ8c4LFh0fcw8rOCQtQ - AAAECK2ZlEIofZyGbh7rXlUq5lUsUyotamtp9QrlvoS3qgePW1gPyvoVx3turdnSe+jnjz - eddDxzgsWHR9zDys4JC1AAAACWxhc3NAbW9ycwECAwQ= - -----END OPENSSH PRIVATE KEY----- - ''; - pubKey = '' - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPW1gPyvoVx3turdnSe+jnjzeddDxzgsWHR9zDys4JC1 - ''; - - ssh-config = pkgs.writeText "ssh-config" '' - Host server - StrictHostKeyChecking no - UserKnownHostsFile=/dev/null - ''; - - populate-source = { - nixos-config = { - symlink.target = test-config; - type = "symlink"; - }; - nixpkgs = { - symlink.target = <nixpkgs>; - type = "symlink"; - }; - stockholm = { - symlink.target = <stockholm>; - type = "symlink"; - }; - }; - - test-deploy = pkgs.writeDash "test-deploy" '' - cd ${<stockholm>} - export NIX_PATH=stockholm=${<stockholm>}:nixpkgs=${<nixpkgs>}:$NIX_PATH - exec >&2 - source=${pkgs.writeJSON "source.json" populate-source} - LOGNAME=krebs ${pkgs.populate}/bin/populate --force root@server:22/var/src/ < "$source" - # TODO: make deploy work - #LOGNAME=krebs ${pkgs.stockholm}/bin/deploy \ - # --force-populate \ - # --source=${./data/test-source.nix} \ - # --system=server \ - ''; - minimalSystem = (import <nixpkgs/nixos/lib/eval-config.nix> { - modules = [ - test-config - ]; - }).config.system.build.toplevel; - -in { - name = "deploy"; - - nodes = { - - server = - { config, pkgs, ... }: - - { - imports = [ test-config ]; - environment.variables = { - NIX_PATH = mkForce "nixpkgs=${<nixpkgs>}"; - }; - services.openssh.enable = true; - users.extraUsers.root.openssh.authorizedKeys.keys = [ - pubKey - ]; - virtualisation.pathsInNixDB = [ - minimalSystem - ]; - environment.systemPackages = [ pkgs.git ]; - }; - - client = - { config, pkgs, ... }: - { }; - }; - - testScript = '' - startAll; - - $server->waitForUnit("sshd"); - - $client->succeed("mkdir -p -m 700 /root/.ssh"); - $client->succeed("echo '${privKey}' > /root/.ssh/id_ed25519"); - $client->succeed("cp ${ssh-config} /root/.ssh/config"); - $client->succeed("chmod 600 /root/.ssh/id_ed25519"); - - $server->waitForUnit("network.target"); - $server->succeed("ip route show 1>&2"); - $client->waitForUnit("network.target"); - $client->succeed("${test-deploy}"); - $server->succeed("nixos-rebuild -I /var/src switch"); - - $client->shutdown; - $server->shutdown; - ''; -}) |