7 # Let the client try to connect to a server.
8 # We can't simulate a server, so there's no more to test.
12 # 192.0.0.8 is a "dummy address" according to RFC 7600
13 dsmSysCli = writeText "cli.dsm.sys" ''
14 defaultserver testserver
17 tcpserveraddress 192.0.0.8
18 nodename ARBITRARYNODENAME
21 tsm-client_ = tsm-client.override { inherit dsmSysCli; };
23 env.nativeBuildInputs = [ tsm-client_ ];
27 inherit (tsm-client_.passthru.unwrapped) version;
28 major = lib.versions.major version;
29 minor = lib.versions.minor version;
30 patch = lib.versions.patch version;
31 fixup = lib.lists.elemAt (lib.versions.splitVersion version) 3;
33 "Client Version ${major}, Release ${minor}, Level ${patch}.${fixup}";
37 runCommand "${tsm-client.name}-test-cli" env ''
41 export DSM_LOG=$(mktemp -d ./dsm_log.XXXXXXXXXXX)
43 { dsmc -optfile=/dev/null || true; } | tee dsmc-stdout
45 # does it report the correct version?
46 grep --fixed-strings '${versionString}' dsmc-stdout
48 # does it use the provided dsm.sys config file?
49 # if it does, it states the node's name
50 grep ARBITRARYNODENAME dsmc-stdout
52 # does it try (and fail) to connect to the server?
53 # if it does, it reports the "TCP/IP connection failure" error code
54 grep ANS1017E dsmc-stdout
55 grep ANS1017E $DSM_LOG/dsmerror.log