at master 1.8 kB view raw
1# The tsm-client GUI first tries to connect to a server. 2# We can't simulate a server, so we just check if 3# it reports the correct connection failure error. 4# After that the test persuades the GUI 5# to show its main application window 6# and verifies some configuration information. 7 8{ lib, pkgs, ... }: 9{ 10 name = "tsm-client"; 11 12 enableOCR = true; 13 14 nodes.machine = 15 { pkgs, ... }: 16 { 17 imports = [ ./common/x11.nix ]; 18 programs.tsmClient = { 19 enable = true; 20 package = pkgs.tsm-client-withGui; 21 defaultServername = "testserver"; 22 servers.testserver = { 23 # 192.0.0.8 is a "dummy address" according to RFC 7600 24 tcpserveraddress = "192.0.0.8"; 25 nodename = "SOME-NODE"; 26 passworddir = "/tmp"; 27 }; 28 }; 29 }; 30 31 testScript = '' 32 machine.succeed("which dsmj") # fail early if this is missing 33 machine.wait_for_x() 34 machine.execute("DSM_LOG=/tmp dsmj -optfile=/dev/null >&2 &") 35 36 # does it report the "TCP/IP connection failure" error code? 37 machine.wait_for_window("IBM Storage Protect") 38 machine.wait_for_text("ANS2610S") 39 machine.send_key("esc") 40 41 # it asks to continue to restore a local backupset now; 42 # "yes" (return) leads to the main application window 43 machine.wait_for_text("backupset") 44 machine.send_key("ret") 45 46 # main window: navigate to "Connection Information" 47 machine.wait_for_text("Welcome") 48 machine.send_key("alt-f") # "File" menu 49 machine.send_key("c") # "Connection Information" 50 51 # "Connection Information" dialog box 52 machine.wait_for_window("Connection Information") 53 machine.wait_for_text("SOME-NODE") 54 machine.wait_for_text("${pkgs.tsm-client.passthru.unwrapped.version}") 55 56 machine.shutdown() 57 ''; 58 59 meta.maintainers = [ lib.maintainers.yarny ]; 60}