static unsigned arg_n_iterations = 3;
static usec_t arg_timeout = 0;
+#if HAVE_BLKID
static usec_t end = 0;
static void* thread_func(void *ptr) {
return NULL;
}
+#endif
static bool have_root_gpt_type(void) {
#ifdef GPT_ROOT_NATIVE
_cleanup_(pclosep) FILE *sfdisk = NULL;
_cleanup_(loop_device_unrefp) LoopDevice *loop = NULL;
_cleanup_close_ int fd = -1;
- _cleanup_(dissected_image_unrefp) DissectedImage *dissected = NULL;
- _cleanup_(umount_and_rmdir_and_freep) char *mounted = NULL;
- sd_id128_t id;
int r;
test_setup_logging(LOG_DEBUG);
if (argc >= 5)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Too many arguments (expected 3 at max).");
- pthread_t threads[arg_n_threads];
-
if (!have_root_gpt_type()) {
log_tests_skipped("No root partition GPT defined for this architecture, exiting.");
return EXIT_TEST_SKIP;
sfdisk = NULL;
assert_se(loop_device_make(fd, O_RDWR, 0, UINT64_MAX, LO_FLAGS_PARTSCAN, &loop) >= 0);
+
+#if HAVE_BLKID
+ _cleanup_(dissected_image_unrefp) DissectedImage *dissected = NULL;
+ _cleanup_(umount_and_rmdir_and_freep) char *mounted = NULL;
+ pthread_t threads[arg_n_threads];
+ sd_id128_t id;
+
assert_se(dissect_image(loop->fd, NULL, NULL, loop->diskseq, loop->uevent_seqnum_not_before, loop->timestamp_not_before, 0, &dissected) >= 0);
assert_se(dissected->partitions[PARTITION_ESP].found);
}
log_notice("Threads are all terminated now.");
+#else
+ log_notice("Cutting test short, since we do not have libblkid.");
+#endif
return 0;
}