[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/25] tests/hd-geo-test: Skip test when images can not be created
From: |
Alex Bennée |
Subject: |
[PULL 07/25] tests/hd-geo-test: Skip test when images can not be created |
Date: |
Thu, 19 Dec 2019 10:49:16 +0000 |
From: Thomas Huth <address@hidden>
In certain environments like restricted containers, we can not create
huge test images. To be able to use "make check" in such container
environments, too, let's skip the hd-geo-test instead of failing when
the test images could not be created.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
index 7e86c5416cc..a2498005440 100644
--- a/tests/hd-geo-test.c
+++ b/tests/hd-geo-test.c
@@ -34,8 +34,13 @@ static char *create_test_img(int secs)
fd = mkstemp(template);
g_assert(fd >= 0);
ret = ftruncate(fd, (off_t)secs * 512);
- g_assert(ret == 0);
close(fd);
+
+ if (ret) {
+ free(template);
+ template = NULL;
+ }
+
return template;
}
@@ -934,6 +939,10 @@ int main(int argc, char **argv)
for (i = 0; i < backend_last; i++) {
if (img_secs[i] >= 0) {
img_file_name[i] = create_test_img(img_secs[i]);
+ if (!img_file_name[i]) {
+ g_test_message("Could not create test images.");
+ goto test_add_done;
+ }
} else {
img_file_name[i] = NULL;
}
@@ -965,6 +974,7 @@ int main(int argc, char **argv)
"skipping hd-geo/override/* tests");
}
+test_add_done:
ret = g_test_run();
for (i = 0; i < backend_last; i++) {
--
2.20.1
- [PULL 00/25] testing and logging updates, Alex Bennée, 2019/12/19
- [PULL 01/25] configure: allow disable of cross compilation containers, Alex Bennée, 2019/12/19
- [PULL 03/25] travis.yml: Run tcg tests with tci, Alex Bennée, 2019/12/19
- [PULL 02/25] tests/vm: Allow to set qemu-img path, Alex Bennée, 2019/12/19
- [PULL 04/25] iotests: Provide a function for checking the creation of huge files, Alex Bennée, 2019/12/19
- [PULL 05/25] iotests: Skip test 060 if it is not possible to create large files, Alex Bennée, 2019/12/19
- [PULL 06/25] iotests: Skip test 079 if it is not possible to create large files, Alex Bennée, 2019/12/19
- [PULL 08/25] tests/test-util-filemonitor: Skip test on non-x86 Travis containers, Alex Bennée, 2019/12/19
- [PULL 09/25] travis.yml: Enable builds on arm64, ppc64le and s390x, Alex Bennée, 2019/12/19
- [PULL 07/25] tests/hd-geo-test: Skip test when images can not be created,
Alex Bennée <=
- [PULL 10/25] ci: build out-of-tree, Alex Bennée, 2019/12/19
- [PULL 11/25] Fix double free issue in qemu_set_log_filename()., Alex Bennée, 2019/12/19
- [PULL 12/25] Cleaned up flow of code in qemu_set_log(), to simplify and clarify., Alex Bennée, 2019/12/19
- [PULL 13/25] Add a mutex to guarantee single writer to qemu_logfile handle., Alex Bennée, 2019/12/19
- [PULL 18/25] travis.yml: Remove the redundant clang-with-MAIN_SOFTMMU_TARGETS entry, Alex Bennée, 2019/12/19
- [PULL 21/25] linux-user: add target_mmap_complete tracepoint, Alex Bennée, 2019/12/19
- [PULL 15/25] Add use of RCU for qemu_logfile., Alex Bennée, 2019/12/19
- [PULL 20/25] linux-user: convert target_mmap debug to tracepoint, Alex Bennée, 2019/12/19
- [PULL 17/25] docker: gtester is no longer used, Alex Bennée, 2019/12/19
- [PULL 19/25] linux-user: convert target_mprotect debug to tracepoint, Alex Bennée, 2019/12/19