aboutsummaryrefslogtreecommitdiffstats
path: root/tests/by-name/sh/sharkey-cpu/test.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/by-name/sh/sharkey-cpu/test.nix102
1 files changed, 52 insertions, 50 deletions
diff --git a/tests/by-name/sh/sharkey-cpu/test.nix b/tests/by-name/sh/sharkey-cpu/test.nix
index f38fd46..89bc7cb 100644
--- a/tests/by-name/sh/sharkey-cpu/test.nix
+++ b/tests/by-name/sh/sharkey-cpu/test.nix
@@ -1,64 +1,66 @@
{
- pkgs,
+ packageSets,
vhack,
...
-}:
-vhack.runTest {
- name = "sharkey-cpu";
- ignore = true;
+}: let
+ pkgs = packageSets.stable;
+in
+ vhack.runTest {
+ name = "sharkey-cpu";
+ ignore = true;
- nodes = {
- server = {config, ...}: {
- vhack = {
- persist.enable = true;
- nginx.enable = true;
- sharkey = {
- enable = true;
- fqdn = "sharkey.server";
+ nodes = {
+ server = {config, ...}: {
+ vhack = {
+ persist.enable = true;
+ nginx.enable = true;
+ sharkey = {
+ enable = true;
+ fqdn = "sharkey.server";
+ };
};
- };
- systemd.services = {
- # Avoid an error from this service.
- "acme-sharkey.server".enable = false;
+ systemd.services = {
+ # Avoid an error from this service.
+ "acme-sharkey.server".enable = false;
- # Test that sharkey's hardening still allows access to the CPUs.
- sharkey.serviceConfig.ExecStart = let
- nodejs = pkgs.lib.getExe pkgs.nodejs;
- script = pkgs.writeTextFile {
- name = "script.js";
- text =
- # js
- ''
- import * as os from 'node:os';
+ # Test that sharkey's hardening still allows access to the CPUs.
+ sharkey.serviceConfig.ExecStart = let
+ nodejs = pkgs.lib.getExe pkgs.nodejs;
+ script = pkgs.writeTextFile {
+ name = "script.js";
+ text =
+ # js
+ ''
+ import * as os from 'node:os';
- var cpus = os.cpus()
+ var cpus = os.cpus()
- if (cpus.length != 0) {
- console.log(cpus[0].model)
- } else {
- // Fail?
- }
+ if (cpus.length != 0) {
+ console.log(cpus[0].model)
+ } else {
+ // Fail?
+ }
- while (true) {
- }
- '';
- };
- in
- pkgs.lib.mkForce "${nodejs} ${script}";
+ while (true) {
+ }
+ '';
+ };
+ in
+ pkgs.lib.mkForce "${nodejs} ${script}";
+ };
};
};
- };
- services = [
- {server = "sharkey.service";}
- ];
+ services = [
+ {server = "sharkey.service";}
+ ];
- testScript = {...}:
- # Python
- ''
- from time import sleep
+ testScript = {...}:
+ # Python
+ ''
+ from time import sleep
- # Give the service time to run.
- sleep(3)
- '';
-}
+ # Give the service time to run.
+ sleep(3)
+ '';
+ }