From: David Hildenbrand <david@redhat.com>
To: kvm@vger.kernel.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
david@redhat.com,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
"Cornelia Huck" <cornelia.huck@de.ibm.com>
Subject: [kvm-unit-tests PATCH v1 2/6] s390x: basic self test
Date: Fri, 12 May 2017 12:58:26 +0200 [thread overview]
Message-ID: <20170512105830.10604-3-david@redhat.com> (raw)
In-Reply-To: <20170512105830.10604-1-david@redhat.com>
Test if the general infrastructure is working. The test will fail until
we have proper sclp console output.
Signed-off-by: David Hildenbrand <david@redhat.com>
---
s390x/Makefile | 2 ++
s390x/selftest.c | 31 +++++++++++++++++++++++++++++++
s390x/unittests.cfg | 5 +++++
3 files changed, 38 insertions(+)
create mode 100644 s390x/selftest.c
diff --git a/s390x/Makefile b/s390x/Makefile
index f9468bb..549c1c0 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -1,3 +1,5 @@
+tests = $(TEST_DIR)/selftest.elf
+
all: test_cases
test_cases: $(tests)
diff --git a/s390x/selftest.c b/s390x/selftest.c
new file mode 100644
index 0000000..827ef60
--- /dev/null
+++ b/s390x/selftest.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017 Red Hat Inc
+ *
+ * Authors:
+ * Thomas Huth <thuth@redhat.com>
+ * David Hildenbrand <david@redhat.com>
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+#include <libcflat.h>
+#include <util.h>
+
+int main(int argc, char**argv)
+{
+ report_prefix_push("selftest");
+
+ if (argc != 3)
+ report_abort("Wrong number of arguments");
+
+ if (strcmp(argv[0], "s390x/selftest.elf") != 0)
+ report_abort("wrong program name");
+ if (strcmp(argv[1], "test") != 0)
+ report_abort("wrong parameter value");
+ if (strcmp(argv[2], "123") != 0)
+ report_abort("wrong parameter value");
+
+ report("test true", true, 0);
+
+ return report_summary();
+}
diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg
index b1e0b1e..92e01ab 100644
--- a/s390x/unittests.cfg
+++ b/s390x/unittests.cfg
@@ -17,3 +17,8 @@
# # to check separated by a space but each check
# # parameter needs to be of the form <path>=<value>
##############################################################################
+
+[selftest-setup]
+file = selftest.elf
+groups = selftest
+extra_params = -append 'test 123'
--
2.9.3
next prev parent reply other threads:[~2017-05-12 10:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-12 10:58 [kvm-unit-tests PATCH v1 0/6] s390x: basic test infrastructure David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 1/6] s390x: initial infrastructure David Hildenbrand
2017-05-15 9:19 ` Christian Borntraeger
2017-05-16 7:54 ` David Hildenbrand
2017-05-16 7:58 ` Christian Borntraeger
2017-05-16 8:21 ` David Hildenbrand
2017-05-12 10:58 ` David Hildenbrand [this message]
2017-05-16 13:35 ` [kvm-unit-tests PATCH v1 2/6] s390x: basic self test Radim Krčmář
2017-05-16 19:16 ` David Hildenbrand
2017-05-17 13:12 ` Radim Krčmář
2017-05-17 16:50 ` David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 3/6] s390x: copy sclp.h and sclp-ascii.c from QEMU David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 4/6] s390x: compile sclp-ascii.c David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 5/6] s390x: wire up sclp console output David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 6/6] MAINTAINERS: add s390x maintainers David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170512105830.10604-3-david@redhat.com \
--to=david@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox