Skip to content

Commit 7b4d9c9

Browse files
committed
NixOS tests
1 parent 6dbdce8 commit 7b4d9c9

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,23 +262,27 @@ jobs:
262262
- name: Checkout
263263
uses: actions/checkout@main
264264

265+
- name: Ensure KVM is available
266+
run: |
267+
if [ ! -e /dev/kvm ]; then
268+
echo "::warning::KVM not available, test will likely fail"
269+
fi
270+
sudo chmod 666 /dev/kvm || true
271+
272+
265273
- name: Setup Nix environment
266274
uses: ./.github/actions/setup-nix
267275
with:
268276
nixbuild_key: ${{ secrets.NIXBUILD_KEY }}
269277
github_token: ${{ secrets.GITHUB_TOKEN }}
270278
cache_key: test-nixos
271279

272-
- name: Ensure KVM is available
273-
run: |
274-
if [ ! -e /dev/kvm ]; then
275-
echo "::warning::KVM not available, test will likely fail"
276-
fi
277-
sudo chmod 666 /dev/kvm || true
280+
- name: Setup upterm session
281+
uses: owenthereal/action-upterm@v1
278282

279-
- name: Run NixOS integration test
280-
run: |
281-
nix build --show-trace --file . nixosTests.containerd --print-build-logs
283+
# - name: Run NixOS integration test
284+
# run: |
285+
# nix build --file . nixosTests.containerd.driverInteractive --out-link driver
282286

283287
release:
284288
needs: [build, test-kind-cache, test-kind-nocache]

tests/nixos/cluster-module.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@
130130
cores = 4;
131131
};
132132

133+
# -- Interactive debug user --
134+
users.users.nixkube = {
135+
isNormalUser = true;
136+
initialPassword = "nixkube";
137+
extraGroups = [ "wheel" ];
138+
};
139+
140+
# Allow nixkube to use sudo without password
141+
security.sudo.wheelNeedsPassword = false;
142+
133143
# Disable COW on etcd data dir (etcd doesn't tolerate COW filesystems)
134144
system.activationScripts.noCOWs.text = ''
135145
${lib.getExe' pkgs.coreutils "mkdir"} --parents /var/lib/etcd
@@ -140,4 +150,11 @@
140150
systemd.tmpfiles.rules = [
141151
"d /var/run/nri 0755 root root -"
142152
];
153+
154+
# Enable external networking for image pulls and nix binary cache access
155+
networking = {
156+
useDHCP = true;
157+
firewall.enable = false;
158+
};
159+
systemd.services.systemd-resolved.enable = true;
143160
}

0 commit comments

Comments
 (0)