1 # integration tests for brscan5 sane driver
4 import ./make-test-python.nix ({ pkgs, ...} : {
6 meta = with pkgs.lib.maintainers; {
7 maintainers = [ mattchrist ];
10 nodes.machine = { pkgs, ... }:
12 nixpkgs.config.allowUnfree = true;
18 "a" = { model="ADS-1200"; nodename="BRW0080927AFBCE"; };
19 "b" = { model="ADS-1200"; ip="192.168.1.2"; };
27 # sane loads libsane-brother5.so.1 successfully, and scanimage doesn't die
28 strace = machine.succeed('strace scanimage -L 2>&1').split("\n")
29 regexp = 'openat\(.*libsane-brother5.so.1", O_RDONLY|O_CLOEXEC\) = \d\d*$'
30 assert len([x for x in strace if re.match(regexp,x)]) > 0
32 # module creates a config
33 cfg = machine.succeed('cat /etc/opt/brother/scanner/brscan5/brsanenetdevice.cfg')
34 assert 'DEVICE=a , "ADS-1200" , 0x4f9:0x459 , NODENAME=BRW0080927AFBCE' in cfg
35 assert 'DEVICE=b , "ADS-1200" , 0x4f9:0x459 , IP-ADDRESS=192.168.1.2' in cfg
37 # scanimage lists the two network scanners
38 scanimage = machine.succeed("scanimage -L")
40 assert """device `brother5:net1;dev0' is a Brother b ADS-1200""" in scanimage
41 assert """device `brother5:net1;dev1' is a Brother a ADS-1200""" in scanimage