nixosTests.taskchampion-sync-server: init
This commit is contained in:
parent
ecf4caea3f
commit
2c40948c73
@ -993,6 +993,7 @@ in {
|
||||
tandoor-recipes-script-name = handleTest ./tandoor-recipes-script-name.nix {};
|
||||
tang = handleTest ./tang.nix {};
|
||||
taskserver = handleTest ./taskserver.nix {};
|
||||
taskchampion-sync-server = handleTest ./taskchampion-sync-server.nix {};
|
||||
tayga = handleTest ./tayga.nix {};
|
||||
technitium-dns-server = handleTest ./technitium-dns-server.nix {};
|
||||
teeworlds = handleTest ./teeworlds.nix {};
|
||||
|
48
nixos/tests/taskchampion-sync-server.nix
Normal file
48
nixos/tests/taskchampion-sync-server.nix
Normal file
@ -0,0 +1,48 @@
|
||||
import ./make-test-python.nix (
|
||||
{ ... }:
|
||||
{
|
||||
name = "taskchampion-sync-server";
|
||||
|
||||
nodes = {
|
||||
server = {
|
||||
services.taskchampion-sync-server.enable = true;
|
||||
services.taskchampion-sync-server.openFirewall = true;
|
||||
};
|
||||
client =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [ pkgs.taskwarrior3 ];
|
||||
};
|
||||
};
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
let
|
||||
cfg = nodes.server.services.taskchampion-sync-server;
|
||||
port = builtins.toString cfg.port;
|
||||
# Generated with uuidgen
|
||||
uuid = "bf01376e-04a4-435a-9263-608567531af3";
|
||||
password = "nixos-test";
|
||||
in
|
||||
''
|
||||
# Explicitly start the VMs so that we don't accidentally start newServer
|
||||
server.start()
|
||||
client.start()
|
||||
|
||||
server.wait_for_unit("taskchampion-sync-server.service")
|
||||
server.wait_for_open_port(${port})
|
||||
|
||||
# See man task-sync(5)
|
||||
client.succeed("mkdir ~/.task")
|
||||
client.succeed("touch ~/.taskrc")
|
||||
client.succeed("echo sync.server.origin=http://server:${port} >> ~/.taskrc")
|
||||
client.succeed("echo sync.server.client_id=${uuid} >> ~/.taskrc")
|
||||
client.succeed("echo sync.encryption_secret=${password} >> ~/.taskrc")
|
||||
client.succeed("task add hello world")
|
||||
client.succeed("task sync")
|
||||
|
||||
# Useful for debugging
|
||||
client.copy_from_vm("/root/.task", "client")
|
||||
server.copy_from_vm("${cfg.dataDir}", "server")
|
||||
'';
|
||||
}
|
||||
)
|
@ -8,6 +8,7 @@
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
libuuid,
|
||||
nixosTests,
|
||||
python3,
|
||||
xdg-utils,
|
||||
installShellFiles,
|
||||
@ -75,6 +76,8 @@ stdenv.mkDerivation rec {
|
||||
ln -s $out/share/vim-plugins/task $out/share/nvim/site
|
||||
'';
|
||||
|
||||
passthru.tests.nixos = nixosTests.taskchampion-sync-server;
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/GothenburgBitFactory/taskwarrior/blob/${src.rev}/ChangeLog";
|
||||
description = "Highly flexible command-line tool to manage TODO lists";
|
||||
|
Loading…
Reference in New Issue
Block a user