• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3#
4# vmcp tool and module test
5#
6# The tool allows Linux users to send commands to the z/VM control program (CP).
7# The normal usage is to invoke vmcp with the command you want to execute.
8#
9# The test case contains one shell script:
10#
11# basically executes the vmcp tool with different parameters and verifies that
12# output and exitcodes are as expected
13
14TST_CNT=2
15TST_TESTFUNC=vmcp_main
16TST_NEEDS_CMDS="vmcp"
17
18vmcp_run()
19{
20
21        $2
22        if [ $? -eq $1 ]; then
23            tst_res TPASS "'$2' returned '$1'"
24        else
25            tst_res TFAIL "'$2' did not return '$1'"
26        fi
27}
28
29vmcp_main1()
30{
31        tst_res TINFO "Verify basic VMCP commands"
32        vmcp_run 0 "vmcp --version";
33        vmcp_run 0 "vmcp --help";
34        vmcp_run 0 "vmcp -v";
35        vmcp_run 0 "vmcp -h";
36        vmcp_run 0 "vmcp q dasd";
37}
38
39vmcp_main2()
40{
41        tst_res TINFO "Verify error conditions"
42        vmcp_run 4 "vmcp -L"
43        vmcp_run 4 "vmcp -m q dasd"
44        vmcp_run 1 "vmcp dasddasddasd"
45}
46
47. tst_test.sh
48tst_run
49