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