···5858 # Link some extra directories in /run/current-system/software/share
5959 environment.pathsToLink = [ "/share" ];
60606161+ # virtual file systems support for PCManFM-QT
6162 services.gvfs.enable = true;
6262- services.gvfs.package = pkgs.gvfs;
63636464 services.upower.enable = config.powerManagement.enable;
6565 };
+30-7
nixos/tests/atop.nix
···1414 '';
1515 unit = name: state: ''
1616 with subtest("Unit ${name} should be ${state}"):
1717- machine.require_unit_state("${name}", "${state}")
1717+ if "${state}" == "active":
1818+ machine.wait_for_unit("${name}")
1919+ else:
2020+ machine.require_unit_state("${name}", "${state}")
1821 '';
1922 version = ''
2023 import re
···4447 if present then
4548 unit "atop.service" "active"
4649 + ''
4747- with subtest("atop.service should have written some data to /var/log/atop"):
4848- files = int(machine.succeed("ls -1 /var/log/atop | wc -l"))
4949- assert files > 0, "Expected at least 1 data file"
5050+ with subtest("atop.service should write some data to /var/log/atop"):
5151+5252+ def has_data_files(last: bool) -> bool:
5353+ files = int(machine.succeed("ls -1 /var/log/atop | wc -l"))
5454+ if files == 0:
5555+ machine.log("Did not find at least one 1 data file")
5656+ if not last:
5757+ machine.log("Will retry...")
5858+ return False
5959+ return True
6060+6161+ with machine.nested("Waiting for data files"):
6262+ retry(has_data_files)
5063 '' else unit "atop.service" "inactive";
5164 atopRotateTimer = present:
5265 unit "atop-rotate.timer" (if present then "active" else "inactive");
···5568 unit "atopacct.service" "active"
5669 + ''
5770 with subtest("atopacct.service should enable process accounting"):
5858- machine.succeed("test -f /run/pacct_source")
7171+ machine.wait_until_succeeds("test -f /run/pacct_source")
59726073 with subtest("atopacct.service should write data to /run/pacct_shadow.d"):
6161- files = int(machine.succeed("ls -1 /run/pacct_shadow.d | wc -l"))
6262- assert files >= 1, "Expected at least 1 pacct_shadow.d file"
7474+7575+ def has_data_files(last: bool) -> bool:
7676+ files = int(machine.succeed("ls -1 /run/pacct_shadow.d | wc -l"))
7777+ if files == 0:
7878+ machine.log("Did not find at least one 1 data file")
7979+ if not last:
8080+ machine.log("Will retry...")
8181+ return False
8282+ return True
8383+8484+ with machine.nested("Waiting for data files"):
8585+ retry(has_data_files)
6386 '' else unit "atopacct.service" "inactive";
6487 netatop = present:
6588 if present then