diff options
author | Nikolay Amiantov <ab@fmap.me> | 2016-02-22 12:22:29 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2016-02-22 12:42:06 +0300 |
commit | 8b124b752179a5e28dc75bf4adbfd6f49bb85cdb (patch) | |
tree | 12ccf4b1e56867ff1fa8e8d35d8c3e43cb98ceb7 /nixos/tests | |
parent | 1a025a4a9649bbe581a6d6da68bb61cdf7109c81 (diff) | |
download | nixpkgs-8b124b752179a5e28dc75bf4adbfd6f49bb85cdb.tar nixpkgs-8b124b752179a5e28dc75bf4adbfd6f49bb85cdb.tar.gz nixpkgs-8b124b752179a5e28dc75bf4adbfd6f49bb85cdb.tar.bz2 nixpkgs-8b124b752179a5e28dc75bf4adbfd6f49bb85cdb.tar.lz nixpkgs-8b124b752179a5e28dc75bf4adbfd6f49bb85cdb.tar.xz nixpkgs-8b124b752179a5e28dc75bf4adbfd6f49bb85cdb.tar.zst nixpkgs-8b124b752179a5e28dc75bf4adbfd6f49bb85cdb.zip |
nixos.tests.printing: fix for new CUPS version
It looks like now queue is not immediately cleared from cancelled jobs. Instead, files like "c00001" are left alongside "d00001-001", and cleanup happens at some later point of time. Also, all new jobs are assigned consecutive numbers now (00002, 00003 etc.). So when original d00001 file is finally cleaned, it breaks the test. Fixed by checking for any "d*" file inside the queue and cleaning it by ourselves to ensure that each job works correctly.
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/printing.nix | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/tests/printing.nix b/nixos/tests/printing.nix index 02980cee2fb..10d69b446cd 100644 --- a/nixos/tests/printing.nix +++ b/nixos/tests/printing.nix @@ -78,7 +78,7 @@ import ./make-test.nix ({pkgs, ... }: { # (showing that the right filters have been applied). Of # course, since there is no actual USB printer attached, the # file will stay in the queue forever. - $server->waitForFile("/var/spool/cups/d00001-001"); + $server->waitForFile("/var/spool/cups/d*-001"); $server->sleep(10); $server->succeed("lpq -a") =~ /$fn/ or die; @@ -90,6 +90,9 @@ import ./make-test.nix ({pkgs, ... }: { Machine::retry sub { return 1 if $server->succeed("lpq -a") =~ /no entries/; }; + # The queue is empty already, so this should be safe. + # Otherwise, pairs of "c*"-"d*-001" files might persist. + $server->execute("rm /var/spool/cups/*"); }; } ''; |