Skip to contentSkip to conversation

tools/tests: add xenstore testing framework

PATCH Superseded Juergen Gross 4 participants 11 messages Jan 18, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/tests: add xenstore testing framework

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

---
 .gitignore                     |   1 +
 tools/tests/Makefile           |   1 +
 tools/tests/xenstore/Makefile  |  27 +++
 tools/tests/xenstore/xs-test.c | 512 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 541 insertions(+)
 create mode 100644 tools/tests/xenstore/Makefile
 create mode 100644 tools/tests/xenstore/xs-test.c
.gitignore +1 -0
index 7689596..d9982f6 100644
@@ -212,6 +212,7 @@ tools/tests/x86_emulator/blowfish.h
 tools/tests/x86_emulator/test_x86_emulator
 tools/tests/x86_emulator/x86_emulate
 tools/tests/xen-access/xen-access
+tools/tests/xenstore/xs-test
 tools/tests/regression/installed/*
 tools/tests/regression/build/*
 tools/tests/regression/downloads/*
tools/tests/Makefile +1 -0
index adeb120..6397761 100644
@@ -12,6 +12,7 @@ SUBDIRS-y += regression
 endif
 SUBDIRS-$(CONFIG_X86) += x86_emulator
 SUBDIRS-y += xen-access
+SUBDIRS-y += xenstore
 
 .PHONY: all clean install distclean
 all clean distclean: %: subdirs-%
tools/tests/xenstore/Makefile new file +27 -0
new file mode 100644
index 0000000..6c85f98
@@ -0,0 +1,27 @@
+XEN_ROOT=$(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+CFLAGS += -Werror
+
+CFLAGS += $(CFLAGS_libxenstore)
+
+TARGETS-y := xs-test
+TARGETS := $(TARGETS-y)
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build: $(TARGETS)
+
+.PHONY: clean
+clean:
+	$(RM) *.o $(TARGETS) *~ $(DEPS)
+
+.PHONY: distclean
+distclean: clean
+
+xs-test: xs-test.o Makefile
+	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenstore)
+
+-include $(DEPS)
tools/tests/xenstore/xs-test.c new file +512 -0

512 lines not on this page · raw message

Signature · 7 lines
2.10.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 6 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

Quoted 7 lines

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

Thank you for doing this work!

The only complaint I have is the code seems to be mixing hypervisor and toolstack coding style.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

Quoted 6 lines
Quoted 1 line

Thank you for doing this work!

The only complaint I have is the code seems to be mixing hypervisor and toolstack coding style.

Sorry, I don't see it. Where do I use coding style not compliant to ./CODING_STYLE ?

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw
In reply to Juergen Gross
Quoted 15 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

---

tools/tests/xenstore/xs-test.c line 411

Quoted 4 lines
tools/tests/xenstore/xs-test.c new file +4 -0
+TEST("read 1", test_read, 1, "Read node with 1 byte data"),
+TEST("read 3000", test_write, 3000, "Write node with 3000 bytes data"),
+TEST("write 1", test_write, 1, "Write node with 1 byte data"),
+TEST("write 3000", test_read, 3000, "Read node with 3000 bytes data"),

No idea how it happened, but there is some confusion with read/write 3000 tests.

I will send V2 after waiting for comments a little bit longer...

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
In reply to Juergen Gross
Quoted 16 lines · Juergen Gross
Quoted 15 lines · Wei Liu
Quoted 13 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

Quoted 8 lines
Quoted 4 lines

Thank you for doing this work!

The only complaint I have is the code seems to be mixing hypervisor and toolstack coding style.

Sorry, I don't see it. Where do I use coding style not compliant to ./CODING_STYLE ?

+static int test_dir_init(uintptr_t par)
+{
+ unsigned int i;
+
+ for (i = 0; i < WRITE_BUFFERS_N; i++)

Here and a bunch of other places.

There are places where there is space after '('. It looks to me you wished to follow hypervisor side coding style.

Wei.

Quoted 2 lines

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw
Quoted 32 lines · Wei Liu
Quoted 24 lines · Juergen Gross
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

Quoted 6 lines
Quoted 1 line

Thank you for doing this work!

The only complaint I have is the code seems to be mixing hypervisor and toolstack coding style.

Sorry, I don't see it. Where do I use coding style not compliant to ./CODING_STYLE ?

tools/tests/xenstore/xs-test.c new file +5 -0
+static int test_dir_init(uintptr_t par)
+{
+    unsigned int i;
+
+    for (i = 0; i < WRITE_BUFFERS_N; i++)
Quoted 1 line

Here and a bunch of other places.

Aah, okay. Missed those, yes.

Quoted 2 lines

There are places where there is space after '('. It looks to me you wished to follow hypervisor side coding style.

Yep. That was the plan.

I'll update those with V2.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#6 lore raw
In reply to Juergen Gross
Quoted 6 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

Quoted 7 lines

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

BTW: when running the tests against oxenstored I discovered that oxenstored is applying the default Xenstore entry size limit of 2000 bytes for dom0, too. All other limits are effective for domUs only. Is this on purpose?

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#7 lore raw
Quoted 13 lines · Juergen Gross
Quoted 12 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

Quoted 7 lines
Quoted 1 line

BTW: when running the tests against oxenstored I discovered that oxenstored is applying the default Xenstore entry size limit of 2000 bytes for dom0, too. All other limits are effective for domUs only. Is this on purpose?

I don't know.

CC our oxenstored maintainer for input.

Quoted 3 lines

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#10 lore raw
In reply to Juergen Gross
Quoted 13 lines · Juergen Gross
Quoted 12 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

Quoted 5 lines
Quoted 1 line

BTW: when running the tests against oxenstored I discovered that oxenstored is applying the default Xenstore entry size limit of 2000 bytes for dom0, too. All other limits are effective for domUs only. Is this on purpose?

I presume not. dom0 is supposed to be immune to all quota-related restrictions.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#8 lore raw
In reply to Wei Liu
Quoted 7 lines · Wei Liu
Quoted 3 lines · Juergen Gross
Quoted 2 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

This is a great idea!

Quoted 18 lines
Quoted 10 lines
Quoted 10 lines

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

Quoted 7 lines
Quoted 1 line

BTW: when running the tests against oxenstored I discovered that oxenstored is applying the default Xenstore entry size limit of 2000 bytes for dom0, too. All other limits are effective for domUs only. Is this on purpose?

Quoted 3 lines

I don't know.

CC our oxenstored maintainer for input.

I don’t think it’s on purpose— I suspect the code evolved a bit, and dom0 was exempted from one quota but not another.

I think it makes sense to be consistent and to enforce the quotas for domUs only.

Cheers,
Dave
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#9 lore raw
Quoted 9 lines · David Scott
Quoted 7 lines · Wei Liu
Quoted 3 lines · Juergen Gross
Quoted 2 lines · Juergen Gross

Add tools/tests/xenstore for a framework to do tests of xenstore. The aim is to test for correctness and performance.

This is a great idea!

When you are doing critical changes to xenstore this is kind of mandatory. ;-)

Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 11 lines

Add a test program containing some tests meant to be run against any xenstore implementation (xenstored, oxenstored, xenstore-stubdom).

It is using libxenstore for access to xenstore and supports multiple tests to be either selected all or individually. All tests are using /local/domain/<own-domid>/xenstore-test/<pid> as base for doing the tests. This allows multiple instances of the program to run in parallel.

BTW: when running the tests against oxenstored I discovered that oxenstored is applying the default Xenstore entry size limit of 2000 bytes for dom0, too. All other limits are effective for domUs only. Is this on purpose?

Quoted 7 lines
Quoted 3 lines

I don't know.

CC our oxenstored maintainer for input.

I don’t think it’s on purpose— I suspect the code evolved a bit, and dom0 was exempted from one quota but not another.

I think it makes sense to be consistent and to enforce the quotas for domUs only.

Nice. First bug found by the test program. :-)

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel