mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
tests: Extract mock library for making hash table deterministic
virHashNew calls virRandomBits to initialize seed for the hashing function. If a test uses iteration through the hash table to produce results they may/will be non-deterministic. Extract the mock library which was used for mac address mapping to be universal. Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
0175dc6ea0
commit
4983368367
@ -1206,22 +1206,23 @@ else ! WITH_NSS
|
|||||||
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
|
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
|
||||||
endif ! WITH_NSS
|
endif ! WITH_NSS
|
||||||
|
|
||||||
if WITH_YAJL
|
virdeterministichashmock_la_SOURCES = \
|
||||||
virmacmapmock_la_SOURCES = \
|
virdeterministichashmock.c
|
||||||
virmacmapmock.c
|
virdeterministichashmock_la_CFLAGS = $(AM_CFLAGS)
|
||||||
virmacmapmock_la_CFLAGS = $(AM_CFLAGS)
|
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
|
||||||
virmacmapmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
|
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
|
||||||
virmacmapmock_la_LIBADD = $(MOCKLIBS_LIBS)
|
|
||||||
|
|
||||||
|
test_libraries += virdeterministichashmock.la
|
||||||
|
|
||||||
|
if WITH_YAJL
|
||||||
virmacmaptest_SOURCES = \
|
virmacmaptest_SOURCES = \
|
||||||
virmacmaptest.c testutils.h testutils.c
|
virmacmaptest.c testutils.h testutils.c
|
||||||
virmacmaptest_CLFAGS = $(AM_CFLAGS)
|
virmacmaptest_CLFAGS = $(AM_CFLAGS)
|
||||||
virmacmaptest_LDADD = $(LDADDS)
|
virmacmaptest_LDADD = $(LDADDS)
|
||||||
|
|
||||||
test_libraries += virmacmapmock.la
|
|
||||||
test_programs += virmacmaptest
|
test_programs += virmacmaptest
|
||||||
else ! WITH_YAJL
|
else ! WITH_YAJL
|
||||||
EXTRA_DIST += virmacmapmock.c virmacmaptest.c
|
EXTRA_DIST += virmacmaptest.c
|
||||||
endif ! WITH_YAJL
|
endif ! WITH_YAJL
|
||||||
|
|
||||||
virnetdevtest_SOURCES = \
|
virnetdevtest_SOURCES = \
|
||||||
|
@ -234,4 +234,4 @@ mymain(void)
|
|||||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virmacmapmock.so")
|
VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdeterministichashmock.so")
|
||||||
|
Loading…
Reference in New Issue
Block a user