diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-01-27 19:02:03 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-01-27 19:02:03 +0000 |
commit | af47e82269f447b36549384323013765efd7e01c (patch) | |
tree | 32c06bed6793927f9d640c86f09d67567e5bd041 /tests | |
parent | bf159f0bdc7b8e7aa8342dedb3829ca744c1b612 (diff) | |
parent | f8a9b4c66569cbc1640722369a91c635102b5264 (diff) |
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2021-01-27' into staging
* Patches to speed up and improve the gitlab-CI
* Documentation for the decorators in the "acceptance" tests
* One small rework of a libqtest function
# gpg: Signature made Wed 27 Jan 2021 06:22:11 GMT
# gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg: issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg: aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5
* remotes/huth-gitlab/tags/pull-request-2021-01-27:
libqtest: Rework qtest_rsp()
docs/devel: Explain how acceptance tests can be skipped
gitlab-ci.yml: Avoid recompiling the sources in the test jobs
gitlab-ci.yml: Exclude some redundant targets in build-without-default-features
meson: Do not build optional libraries by default
configure: Only check for audio drivers if system-mode is selected
gitlab-ci.yml: Avoid some submodules to speed up the CI a little bit
gitlab-ci: Test building linux-user targets on CentOS 7
tests/docker: Install static libc package in CentOS 7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/docker/dockerfiles/centos7.docker | 1 | ||||
-rw-r--r-- | tests/docker/dockerfiles/centos8.docker | 1 | ||||
-rw-r--r-- | tests/docker/dockerfiles/debian-amd64.docker | 1 | ||||
-rw-r--r-- | tests/docker/dockerfiles/fedora.docker | 3 | ||||
-rw-r--r-- | tests/docker/dockerfiles/ubuntu2004.docker | 1 | ||||
-rw-r--r-- | tests/qtest/libqtest.c | 50 |
6 files changed, 33 insertions, 24 deletions
diff --git a/tests/docker/dockerfiles/centos7.docker b/tests/docker/dockerfiles/centos7.docker index 6f11af1989..75fdb53c7c 100644 --- a/tests/docker/dockerfiles/centos7.docker +++ b/tests/docker/dockerfiles/centos7.docker @@ -15,6 +15,7 @@ ENV PACKAGES \ gettext \ git \ glib2-devel \ + glibc-static \ gnutls-devel \ libaio-devel \ libepoxy-devel \ diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker index 64cb7a6eda..a763d55730 100644 --- a/tests/docker/dockerfiles/centos8.docker +++ b/tests/docker/dockerfiles/centos8.docker @@ -15,6 +15,7 @@ ENV PACKAGES \ glib2-devel \ libaio-devel \ libepoxy-devel \ + libfdt-devel \ libgcrypt-devel \ lzo-devel \ make \ diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker index a98314757d..ed546edcd6 100644 --- a/tests/docker/dockerfiles/debian-amd64.docker +++ b/tests/docker/dockerfiles/debian-amd64.docker @@ -21,6 +21,7 @@ RUN apt update && \ libbz2-dev \ liblzo2-dev \ libgcrypt20-dev \ + libfdt-dev \ librdmacm-dev \ libsasl2-dev \ libsnappy-dev \ diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index 0b5053f2d0..0d7602abbe 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -6,6 +6,7 @@ ENV PACKAGES \ brlapi-devel \ bzip2 \ bzip2-devel \ + capstone-devel \ ccache \ clang \ cyrus-sasl-devel \ @@ -37,6 +38,7 @@ ENV PACKAGES \ libpng-devel \ librbd-devel \ libseccomp-devel \ + libslirp-devel \ libssh-devel \ libubsan \ libudev-devel \ @@ -46,6 +48,7 @@ ENV PACKAGES \ llvm \ lzo-devel \ make \ + meson \ mingw32-bzip2 \ mingw32-curl \ mingw32-glib2 \ diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker index ae889d8482..8519584d2b 100644 --- a/tests/docker/dockerfiles/ubuntu2004.docker +++ b/tests/docker/dockerfiles/ubuntu2004.docker @@ -37,6 +37,7 @@ ENV PACKAGES flex bison \ libsasl2-dev \ libsdl2-dev \ libseccomp-dev \ + libslirp-dev \ libsnappy-dev \ libspice-protocol-dev \ libspice-server-dev \ diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 5249a628cc..fd043b0570 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -503,7 +503,7 @@ static GString *qtest_client_socket_recv_line(QTestState *s) return line; } -static gchar **qtest_rsp(QTestState *s, int expected_args) +static gchar **qtest_rsp_args(QTestState *s, int expected_args) { GString *line; gchar **words; @@ -539,25 +539,27 @@ redo: g_assert(words[0] != NULL); g_assert_cmpstr(words[0], ==, "OK"); - if (expected_args) { - for (i = 0; i < expected_args; i++) { - g_assert(words[i] != NULL); - } - } else { - g_strfreev(words); - words = NULL; + for (i = 0; i < expected_args; i++) { + g_assert(words[i] != NULL); } return words; } +static void qtest_rsp(QTestState *s) +{ + gchar **words = qtest_rsp_args(s, 0); + + g_strfreev(words); +} + static int qtest_query_target_endianness(QTestState *s) { gchar **args; int big_endian; qtest_sendf(s, "endianness\n"); - args = qtest_rsp(s, 1); + args = qtest_rsp_args(s, 1); g_assert(strcmp(args[1], "big") == 0 || strcmp(args[1], "little") == 0); big_endian = strcmp(args[1], "big") == 0; g_strfreev(args); @@ -892,14 +894,14 @@ bool qtest_get_irq(QTestState *s, int num) void qtest_module_load(QTestState *s, const char *prefix, const char *libname) { qtest_sendf(s, "module_load %s %s\n", prefix, libname); - qtest_rsp(s, 0); + qtest_rsp(s); } static int64_t qtest_clock_rsp(QTestState *s) { gchar **words; int64_t clock; - words = qtest_rsp(s, 2); + words = qtest_rsp_args(s, 2); clock = g_ascii_strtoll(words[1], NULL, 0); g_strfreev(words); return clock; @@ -926,13 +928,13 @@ int64_t qtest_clock_set(QTestState *s, int64_t val) void qtest_irq_intercept_out(QTestState *s, const char *qom_path) { qtest_sendf(s, "irq_intercept_out %s\n", qom_path); - qtest_rsp(s, 0); + qtest_rsp(s); } void qtest_irq_intercept_in(QTestState *s, const char *qom_path) { qtest_sendf(s, "irq_intercept_in %s\n", qom_path); - qtest_rsp(s, 0); + qtest_rsp(s); } void qtest_set_irq_in(QTestState *s, const char *qom_path, const char *name, @@ -942,13 +944,13 @@ void qtest_set_irq_in(QTestState *s, const char *qom_path, const char *name, name = "unnamed-gpio-in"; } qtest_sendf(s, "set_irq_in %s %s %d %d\n", qom_path, name, num, level); - qtest_rsp(s, 0); + qtest_rsp(s); } static void qtest_out(QTestState *s, const char *cmd, uint16_t addr, uint32_t value) { qtest_sendf(s, "%s 0x%x 0x%x\n", cmd, addr, value); - qtest_rsp(s, 0); + qtest_rsp(s); } void qtest_outb(QTestState *s, uint16_t addr, uint8_t value) @@ -973,7 +975,7 @@ static uint32_t qtest_in(QTestState *s, const char *cmd, uint16_t addr) unsigned long value; qtest_sendf(s, "%s 0x%x\n", cmd, addr); - args = qtest_rsp(s, 2); + args = qtest_rsp_args(s, 2); ret = qemu_strtoul(args[1], NULL, 0, &value); g_assert(!ret && value <= UINT32_MAX); g_strfreev(args); @@ -1000,7 +1002,7 @@ static void qtest_write(QTestState *s, const char *cmd, uint64_t addr, uint64_t value) { qtest_sendf(s, "%s 0x%" PRIx64 " 0x%" PRIx64 "\n", cmd, addr, value); - qtest_rsp(s, 0); + qtest_rsp(s); } void qtest_writeb(QTestState *s, uint64_t addr, uint8_t value) @@ -1030,7 +1032,7 @@ static uint64_t qtest_read(QTestState *s, const char *cmd, uint64_t addr) uint64_t value; qtest_sendf(s, "%s 0x%" PRIx64 "\n", cmd, addr); - args = qtest_rsp(s, 2); + args = qtest_rsp_args(s, 2); ret = qemu_strtou64(args[1], NULL, 0, &value); g_assert(!ret); g_strfreev(args); @@ -1082,7 +1084,7 @@ void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size) } qtest_sendf(s, "read 0x%" PRIx64 " 0x%zx\n", addr, size); - args = qtest_rsp(s, 2); + args = qtest_rsp_args(s, 2); for (i = 0; i < size; i++) { ptr[i] = hex2nib(args[1][2 + (i * 2)]) << 4; @@ -1098,7 +1100,7 @@ uint64_t qtest_rtas_call(QTestState *s, const char *name, { qtest_sendf(s, "rtas %s %u 0x%"PRIx64" %u 0x%"PRIx64"\n", name, nargs, args, nret, ret); - qtest_rsp(s, 0); + qtest_rsp(s); return 0; } @@ -1134,7 +1136,7 @@ void qtest_bufwrite(QTestState *s, uint64_t addr, const void *data, size_t size) qtest_sendf(s, "b64write 0x%" PRIx64 " 0x%zx ", addr, size); s->ops.send(s, bdata); s->ops.send(s, "\n"); - qtest_rsp(s, 0); + qtest_rsp(s); g_free(bdata); } @@ -1144,7 +1146,7 @@ void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size) size_t len; qtest_sendf(s, "b64read 0x%" PRIx64 " 0x%zx\n", addr, size); - args = qtest_rsp(s, 2); + args = qtest_rsp_args(s, 2); g_base64_decode_inplace(args[1], &len); if (size != len) { @@ -1174,14 +1176,14 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size) } qtest_sendf(s, "write 0x%" PRIx64 " 0x%zx 0x%s\n", addr, size, enc); - qtest_rsp(s, 0); + qtest_rsp(s); g_free(enc); } void qtest_memset(QTestState *s, uint64_t addr, uint8_t pattern, size_t size) { qtest_sendf(s, "memset 0x%" PRIx64 " 0x%zx 0x%02x\n", addr, size, pattern); - qtest_rsp(s, 0); + qtest_rsp(s); } void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...) |