summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/wireguard/qemu/init.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2022-07-11 10:58:01 +0300
committerBorislav Petkov <bp@suse.de>2022-07-11 10:58:01 +0300
commit5a88c48f4146de2c8c2ed7ddcaa76f898869f3a3 (patch)
treefc501a1b940026cbd5316f8665236c109d5f1a2e /tools/testing/selftests/wireguard/qemu/init.c
parentb69a2afd5afce9bf6d56e349d6ab592c916e20f2 (diff)
parent32346491ddf24599decca06190ebca03ff9de7f8 (diff)
downloadlinux-5a88c48f4146de2c8c2ed7ddcaa76f898869f3a3.tar.xz
Merge tag 'v5.19-rc6' into tip:x86/kdump
Merge rc6 to pick up dependent changes to the bootparam UAPI header. Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'tools/testing/selftests/wireguard/qemu/init.c')
-rw-r--r--tools/testing/selftests/wireguard/qemu/init.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/selftests/wireguard/qemu/init.c b/tools/testing/selftests/wireguard/qemu/init.c
index c9e128436546..3e49924dd77e 100644
--- a/tools/testing/selftests/wireguard/qemu/init.c
+++ b/tools/testing/selftests/wireguard/qemu/init.c
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <fcntl.h>
+#include <time.h>
#include <sys/wait.h>
#include <sys/mount.h>
#include <sys/stat.h>
@@ -70,6 +71,15 @@ static void seed_rng(void)
close(fd);
}
+static void set_time(void)
+{
+ if (time(NULL))
+ return;
+ pretty_message("[+] Setting fake time...");
+ if (stime(&(time_t){1433512680}) < 0)
+ panic("settimeofday()");
+}
+
static void mount_filesystems(void)
{
pretty_message("[+] Mounting filesystems...");
@@ -259,6 +269,7 @@ int main(int argc, char *argv[])
print_banner();
mount_filesystems();
seed_rng();
+ set_time();
kmod_selftests();
enable_logging();
clear_leaks();