at 25.11-pre 2.0 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 8import ./make-test-python.nix ( 9 { lib, pkgs, ... }: 10 { 11 name = "tsm-client"; 12 13 enableOCR = true; 14 15 nodes.machine = 16 { pkgs, ... }: 17 { 18 imports = [ ./common/x11.nix ]; 19 programs.tsmClient = { 20 enable = true; 21 package = pkgs.tsm-client-withGui; 22 defaultServername = "testserver"; 23 servers.testserver = { 24 # 192.0.0.8 is a "dummy address" according to RFC 7600 25 tcpserveraddress = "192.0.0.8"; 26 nodename = "SOME-NODE"; 27 passworddir = "/tmp"; 28 }; 29 }; 30 }; 31 32 testScript = '' 33 machine.succeed("which dsmj") # fail early if this is missing 34 machine.wait_for_x() 35 machine.execute("DSM_LOG=/tmp dsmj -optfile=/dev/null >&2 &") 36 37 # does it report the "TCP/IP connection failure" error code? 38 machine.wait_for_window("IBM Storage Protect") 39 machine.wait_for_text("ANS2610S") 40 machine.send_key("esc") 41 42 # it asks to continue to restore a local backupset now; 43 # "yes" (return) leads to the main application window 44 machine.wait_for_text("backupset") 45 machine.send_key("ret") 46 47 # main window: navigate to "Connection Information" 48 machine.wait_for_text("Welcome") 49 machine.send_key("alt-f") # "File" menu 50 machine.send_key("c") # "Connection Information" 51 52 # "Connection Information" dialog box 53 machine.wait_for_window("Connection Information") 54 machine.wait_for_text("SOME-NODE") 55 machine.wait_for_text("${pkgs.tsm-client.passthru.unwrapped.version}") 56 57 machine.shutdown() 58 ''; 59 60 meta.maintainers = [ lib.maintainers.yarny ]; 61 } 62)