aboutsummaryrefslogtreecommitdiffstats
path: root/tests/by-name
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-13 22:07:08 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-13 22:07:08 +0200
commit17b4ee1f87c6645302240b72503e70c869b3e60f (patch)
tree2cd8300d89c98b41fe35163f3ef048fb29bfc008 /tests/by-name
parentscripts/check.sh: Improve readability (diff)
downloadnixos-server-17b4ee1f87c6645302240b72503e70c869b3e60f.zip
modules/atuin-sync: Replace `atuin` with `turtle`
Diffstat (limited to '')
-rw-r--r--tests/by-name/at/atuin-sync/test.nix35
1 files changed, 17 insertions, 18 deletions
diff --git a/tests/by-name/at/atuin-sync/test.nix b/tests/by-name/at/atuin-sync/test.nix
index d65c216..0f2cd24 100644
--- a/tests/by-name/at/atuin-sync/test.nix
+++ b/tests/by-name/at/atuin-sync/test.nix
@@ -6,6 +6,7 @@
pkgs,
extraModules,
nixLib,
+ turtle,
...
}:
nixos-lib.runTest {
@@ -21,6 +22,7 @@ nixos-lib.runTest {
nodes = let
atuinSession = "01969ec6b8d07e30a9d2df0911fbfe2a";
+ atuin = turtle.packages."${pkgs.stdenv.hostPlatform.system}".default;
in {
acme = {
imports = [
@@ -83,7 +85,7 @@ nixos-lib.runTest {
environment.sessionVariables.ATUIN_SESSION = atuinSession;
environment.systemPackages = [
- pkgs.atuin
+ atuin
pkgs.sqlite-interactive
];
};
@@ -96,29 +98,22 @@ nixos-lib.runTest {
environment.sessionVariables.ATUIN_SESSION = atuinSession;
environment.systemPackages = [
- pkgs.atuin
+ atuin
pkgs.sqlite-interactive
];
};
};
testScript = {nodes, ...}: let
- syncLogin = pkgs.writeShellScript "login-atuin-sync-account" ''
- atuin login --username syncy --password password1234 --key "$1"
- '';
-
- syncRegister = pkgs.writeShellScript "register-atuin-sync-account" ''
- atuin register --username syncy --email syncy@email.com --password password1234
- '';
-
mkSyncConfig = pkgs.writeShellScript "register-atuin-sync-account" ''
mkdir --parents ~/.config/atuin/
+
cat << EOF > ~/.config/atuin/config.toml
- sync_address = "https://atuin-sync.server"
- # Use the v2 sync
[sync]
- records = true
+ address = "https://atuin-sync.server"
+ user_id_path = "${pkgs.writeText "user-id" "019eb88a-6b51-7e52-b12c-7d30bd8e5928"}"
+ encryption_key_path = "${pkgs.writeText "encryption-key" "3AAgbWsDzL7M00/Mq0LMjsyOCy3MnsypBsyQzKbMywNGzNnMrUBozIINAxdbIiDMhQ=="}"
EOF
'';
@@ -147,7 +142,7 @@ nixos-lib.runTest {
acme.prepare ["server" "client1" "client2"]
# Python
''
- server.wait_for_unit("atuin.service")
+ server.wait_for_unit("turtle.service")
server.wait_for_open_port(443)
# Wait for the server to acquire the acme certificate
@@ -158,8 +153,12 @@ nixos-lib.runTest {
for client in [client1, client2]:
client.succeed("${mkSyncConfig}")
- client1.succeed("${syncRegister}")
- client2.succeed(f"${syncLogin} '{client1.succeed("atuin key")}'")
+ with subtest("Start atuin daemons"):
+ for client in [client1, client2]:
+ client.succeed("systemd-run atuin daemon start")
+
+ for client in [client1, client2]:
+ client.wait_until_succeeds("atuin daemon status")
with subtest("Can import shell history"):
client1.succeed("${runCommandAndRecordInAtuin} echo hi - client 1")
@@ -167,8 +166,8 @@ nixos-lib.runTest {
with subtest("Can sync tasks"):
for client in [client1, client2]:
- client.succeed("atuin sync --force")
- client1.succeed("atuin sync --force")
+ client.succeed("atuin sync perform --force")
+ client1.succeed("atuin sync perform --force")
with subtest("Have correct tasks"):