aboutsummaryrefslogtreecommitdiffstats
path: root/tests/by-name/ba
diff options
context:
space:
mode:
Diffstat (limited to 'tests/by-name/ba')
-rw-r--r--tests/by-name/ba/back/test.nix46
1 files changed, 15 insertions, 31 deletions
diff --git a/tests/by-name/ba/back/test.nix b/tests/by-name/ba/back/test.nix
index 41d6c8e..b1d908d 100644
--- a/tests/by-name/ba/back/test.nix
+++ b/tests/by-name/ba/back/test.nix
@@ -1,11 +1,7 @@
{
- nixos-lib,
- pkgsUnstable,
- nixpkgs-unstable,
- vhackPackages,
pkgs,
extraModules,
- nixLib,
+ vhack,
...
}: let
domain = "server";
@@ -22,17 +18,15 @@
option user-configs = cgit\.owner cgit\.desc cgit\.section cgit\.homepage
'';
in
- nixos-lib.runTest {
- hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs
-
+ vhack.runTest {
name = "back";
- node = {
- specialArgs = {inherit pkgsUnstable vhackPackages nixpkgs-unstable nixLib;};
+ ignore = "We are not using back currently.";
- # Use the nixpkgs as constructed by the `nixpkgs.*` options
- pkgs = null;
- };
+ serverDomains = [
+ {server = "git.${domain}";}
+ {server = "issues.${domain}";}
+ ];
nodes = {
server = {config, ...}: {
@@ -49,7 +43,6 @@ in
openssh.enable = true;
nginx = {
enable = true;
- selfsign = true;
};
git-server = {
enable = true;
@@ -73,23 +66,17 @@ in
PreferredAuthentications publickey
'';
users.users.alice = {isNormalUser = true;};
- networking.hosts = {
- "${nodes.server.networking.primaryIPAddress}" = [
- "git.${domain}"
- "issues.${domain}"
- "${domain}"
- ];
- };
};
};
+ services = [
+ {server = "gitolite-init.service";}
+ {server = "sshd.service";}
+ ];
+
testScript = {nodes, ...}:
- /*
- python
- */
+ # Python
''
- start_all()
-
with subtest("can setup ssh keys on client"):
client.succeed(
"mkdir -p ~root/.ssh",
@@ -103,11 +90,8 @@ in
)
with subtest("gitolite server starts"):
- server.wait_for_unit("gitolite-init.service")
- server.wait_for_unit("sshd.service")
client.succeed("ssh -n git@git.${domain} info")
-
with subtest("admin can clone and configure gitolite-admin.git"):
server.succeed("sudo -u git ${pkgs.writeShellScript "delete_main_branch_on_server" ''
set -xe
@@ -188,10 +172,10 @@ in
client.succeed("${pkgs.writeShellScript "curl-back" ''
set -xe
- curl --insecure --fail --show-error "https://issues.${domain}/alice/repo1/issues/?query=status:open" --output /root/issues.html
+ curl --fail --show-error "https://issues.${domain}/alice/repo1/issues/?query=status:open" --output /root/issues.html
grep -- 'Second bug title' /root/issues.html
- curl --insecure --fail --show-error "https://issues.${domain}/" --output /root/repos.html
+ curl --fail --show-error "https://issues.${domain}/" --output /root/repos.html
grep -- 'repo' /root/repos.html
grep -- "<No description>" /root/repos.html
grep -- '<span class="user-name">Alice</span>' /root/repos.html