diff mbox series

adding s390x tests to ltp

Message ID 20190204161328.4616-1-elas@linux.vnet.ibm.com
State Rejected
Headers show
Series adding s390x tests to ltp | expand

Commit Message

Elif Aslan Feb. 4, 2019, 4:13 p.m. UTC
---
 runtest/s390x_tools                           |  2 +
 testcases/commands/s390x_tools/vmcp/vmcp_m.sh | 58 +++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 runtest/s390x_tools
 create mode 100644 testcases/commands/s390x_tools/vmcp/vmcp_m.sh

Comments

Petr Vorel Feb. 4, 2019, 11:51 p.m. UTC | #1
Hi Elif,

these tests are just user space tests for vmcp, LTP would not benefit from it.
I guess you should try to contribute test to s390-tools, where vmcp belongs to.

LTP tests are concern about kernel related tests. There are some user space
tests, but these are related to kernel (e.g. insmod, keyctl) or able to trigger
kernel oops (e.g. filesystem related tools).

Kind regards,
Petr
Jan Stancek Feb. 7, 2019, 12:52 p.m. UTC | #2
----- Original Message -----
> ---
>  runtest/s390x_tools                           |  2 +
>  testcases/commands/s390x_tools/vmcp/vmcp_m.sh | 58 +++++++++++++++++++
>  2 files changed, 60 insertions(+)
>  create mode 100644 runtest/s390x_tools
>  create mode 100644 testcases/commands/s390x_tools/vmcp/vmcp_m.sh
> 
> diff --git a/runtest/s390x_tools b/runtest/s390x_tools
> new file mode 100644
> index 000000000..c88f0cac4
> --- /dev/null
> +++ b/runtest/s390x_tools
> @@ -0,0 +1,2 @@
> +#DESCRIPTION:s390x_tools tests
> +vmcp vmcp_m.sh

Hi,

There is already a runtest/commands, any reason for making new one?

> diff --git a/testcases/commands/s390x_tools/vmcp/vmcp_m.sh
> b/testcases/commands/s390x_tools/vmcp/vmcp_m.sh
> new file mode 100644
> index 000000000..d1f7752de
> --- /dev/null
> +++ b/testcases/commands/s390x_tools/vmcp/vmcp_m.sh
> @@ -0,0 +1,58 @@
> +#!/bin/sh
> +#
> +# Copyright (C) 2018 IBM Corp.
> +#
> +# Copying and distribution of this file, with or without modification,
> +# are permitted in any medium without royalty provided the copyright
> +# notice and this notice are preserved.  This file is offered as-is,
> +# without any warranty.
> +
> +#set -x
> +#
> +
> +TST_CNT=2
> +TST_TESTFUNC=vmcp_main
> +TST_USAGE=usage

Maybe also: TST_NEEDS_CMDS="vmcp" ?
Not sure if all s390x distros have this command installed.

But that should also be sufficient check to run this on any arch,
if command doesn't exist it will TCONF.

Regards,
Jan
Cyril Hrubis Feb. 7, 2019, 12:54 p.m. UTC | #3
Hi!
> There is already a runtest/commands, any reason for making new one?

If we are going to add more s390x related tests it would make sense to
create a runtest file for them.
Petr Vorel Feb. 18, 2019, 6:21 p.m. UTC | #4
Hi Jan, Cyril,

> Maybe also: TST_NEEDS_CMDS="vmcp" ?
> Not sure if all s390x distros have this command installed.

> But that should also be sufficient check to run this on any arch,
> if command doesn't exist it will TCONF.

The reason, why I suggested to move these tests to upstream [1]
is that testing "vmcp --version" or "vmcp --help" does not really depend on
anyhow on SUT. Adding it to upstream into make check (there are none check yet)
would bring 1) earlier catch of potencial bugs as upstream developers can run it
for each commit (CI) and distros during package build.

We had some discussion before about removing some user space packages [2].
Cyril suggested to to keep tests that are working with files (cp/df/ln)
and remove at least unzip and wc.
Doing some real testing (really using vmcp.ko) would make this tests useful to
run on LTP, but current code IMHO does nothing with kernel. Or do I miss
something?

Anyway, it looks like you have no objection about adding it to LTP, so I changed
state of this test New. In that case, I suggest to

remove debugging:
> +#set -x
> +#

use tst_res TINFO instead of echo
+	echo "verifyBasicVMCPCommands"
+	echo "verifyErrorCondition"

Kind regards,
Petr

[1] https://github.com/ibm-s390-tools/s390-tools
[2] https://patchwork.ozlabs.org/patch/905064/#1902070
Jan Stancek Feb. 18, 2019, 6:33 p.m. UTC | #5
----- Original Message -----
> Hi Jan, Cyril,
> 
> > Maybe also: TST_NEEDS_CMDS="vmcp" ?
> > Not sure if all s390x distros have this command installed.
> 
> > But that should also be sufficient check to run this on any arch,
> > if command doesn't exist it will TCONF.
> 
> The reason, why I suggested to move these tests to upstream [1]
> is that testing "vmcp --version" or "vmcp --help" does not really depend on
> anyhow on SUT. Adding it to upstream into make check (there are none check
> yet)
> would bring 1) earlier catch of potencial bugs as upstream developers can run
> it
> for each commit (CI) and distros during package build.
> 
> We had some discussion before about removing some user space packages [2].
> Cyril suggested to to keep tests that are working with files (cp/df/ln)
> and remove at least unzip and wc.
> Doing some real testing (really using vmcp.ko) would make this tests useful
> to
> run on LTP, but current code IMHO does nothing with kernel. Or do I miss
> something?
> 
> Anyway, it looks like you have no objection about adding it to LTP

I don't. My only question was if runtest/commands would be more fitting
for the test, but people seemed to prefer s390x specific runtest-file instead.

Regards,
Jan

>, so I
> changed
> state of this test New. In that case, I suggest to
> 
> remove debugging:
> > +#set -x
> > +#
> 
> use tst_res TINFO instead of echo
> +	echo "verifyBasicVMCPCommands"
> +	echo "verifyErrorCondition"
> 
> Kind regards,
> Petr
> 
> [1] https://github.com/ibm-s390-tools/s390-tools
> [2] https://patchwork.ozlabs.org/patch/905064/#1902070
>
diff mbox series

Patch

diff --git a/runtest/s390x_tools b/runtest/s390x_tools
new file mode 100644
index 000000000..c88f0cac4
--- /dev/null
+++ b/runtest/s390x_tools
@@ -0,0 +1,2 @@ 
+#DESCRIPTION:s390x_tools tests
+vmcp vmcp_m.sh
diff --git a/testcases/commands/s390x_tools/vmcp/vmcp_m.sh b/testcases/commands/s390x_tools/vmcp/vmcp_m.sh
new file mode 100644
index 000000000..d1f7752de
--- /dev/null
+++ b/testcases/commands/s390x_tools/vmcp/vmcp_m.sh
@@ -0,0 +1,58 @@ 
+#!/bin/sh
+#
+# Copyright (C) 2018 IBM Corp.
+# 
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.  This file is offered as-is,
+# without any warranty.
+
+#set -x
+#
+
+TST_CNT=2
+TST_TESTFUNC=vmcp_main
+TST_USAGE=usage
+. tst_test.sh
+
+usage()
+{
+	cat << EOF
+usage: $0 
+
+OPTIONS
+EOF
+}
+
+vmcp_run()
+{
+
+	$2
+	if [ $? -eq $1 ]; then
+		tst_res TPASS "'$2' returned '$1'. Test passed"
+	else
+		tst_res TFAIL "'$2' did not return '$1'. Test failed"
+	fi
+}
+
+vmcp_main1()
+{
+	echo "verifyBasicVMCPCommands"
+	vmcp_run 0 "vmcp --version";
+	vmcp_run 0 "vmcp --help";
+	vmcp_run 0 "vmcp -v";
+	vmcp_run 0 "vmcp -h";
+	vmcp_run 0 "vmcp q dasd";
+}
+
+vmcp_main2()
+{
+	echo "verifyErrorCondition"
+	vmcp_run 4 "vmcp -L"
+	vmcp_run 4 "vmcp -m q dasd"
+	vmcp_run 1 "vmcp dasddasddasd"
+	
+}
+
+
+tst_run