-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic.nix
39 lines (39 loc) · 1.02 KB
/
basic.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 1. Copy confext created with naext into confext search path
# 2. systemd-confext refresh
# 3. Assert that the confext has been activated and the provided file has the expected content
{
pkgs,
...
}:
{
name = "basic";
nodes = {
machine = _: {
naext = {
seed = "12345678-1234-1234-1234-123456789123";
extensions = {
test = {
extensionType = "confext";
imageFormat = "raw";
files = {
"/etc/test".source = pkgs.writeText "example" ''Hello'';
};
};
};
};
};
};
testScript =
{ nodes, ... }:
let
ext = nodes.machine.naext.extensions.test;
in
# python
''
machine.copy_from_host("${ext.image}", "/var/lib/confexts/${ext.name}.${ext.extensionType}.raw")
machine.succeed("systemd-confext refresh")
machine.wait_for_file("/etc/test")
content=machine.succeed("cat /etc/test")
assert content=="Hello", "File provided by confext has expected content"
'';
}