]> xenbits.xensource.com Git - people/royger/xen-test-framework.git/commitdiff
Generate xl configuration files for tests
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 22 Oct 2015 10:43:35 +0000 (11:43 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 22 Oct 2015 11:16:02 +0000 (12:16 +0100)
For now just the default configuration, which gets slightly customised
for each generated environment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
README
config/common.mk
config/default-hvm.cfg.in [new file with mode: 0644]
config/default-pv.cfg.in [new file with mode: 0644]
config/gen.mk

diff --git a/README b/README
index 641aff9775405f6078dbf84502681bc1d9cdc45c..20d912702421ae4388f3d89b34a62b33bcea28d0 100644 (file)
--- a/README
+++ b/README
@@ -20,3 +20,4 @@ machine.
 
 * More introductory text
 * Tests
+* Be able to specify per-test configuration
index 945c2662f42f23e083ceb62dc3e71dac11eb2c92..c43bb923063a807bfaf068cdfa64e806911c4adc 100644 (file)
@@ -30,6 +30,14 @@ head-pv32  := $(ROOT)/arch/x86/boot/head_pv32.o
 head-hvm64 := $(ROOT)/arch/x86/boot/head_hvm64.o
 head-hvm32 := $(ROOT)/arch/x86/boot/head_hvm32.o
 
+defcfg-pv    := $(ROOT)/config/default-pv.cfg.in
+defcfg-hvm   := $(ROOT)/config/default-hvm.cfg.in
+
+defcfg-pv64  := $(defcfg-pv)
+defcfg-pv32  := $(defcfg-pv)
+defcfg-hvm64 := $(defcfg-hvm)
+defcfg-hvm32 := $(defcfg-hvm)
+
 obj-perarch :=
 obj-perenv  :=
 include $(ROOT)/config/files.mk
diff --git a/config/default-hvm.cfg.in b/config/default-hvm.cfg.in
new file mode 100644 (file)
index 0000000..000133d
--- /dev/null
@@ -0,0 +1,4 @@
+name="@@NAME@@-@@ENV@@"
+builder="hvm"
+memory=128
+firmware_override="test-@@ENV@@-@@NAME@@"
diff --git a/config/default-pv.cfg.in b/config/default-pv.cfg.in
new file mode 100644 (file)
index 0000000..1a2f142
--- /dev/null
@@ -0,0 +1,4 @@
+name="@@NAME@@-@@ENV@@"
+loader="generic"
+memory=128
+kernel="test-@@ENV@@-@@NAME@@"
index dcf7c52cc6b16f2e3f756241c275bf0994a3e554..712e0ed30fc4302e66bf7e7eada2a775df0df654 100644 (file)
@@ -14,7 +14,7 @@ $(error Unrecognised environments '$(filter-out $(ALL_ENVIRONMENTS),$(TEST-ENVS)
 endif
 
 .PHONY: build
-build: $(foreach env,$(TEST-ENVS),test-$(env)-$(NAME))
+build: $(foreach env,$(TEST-ENVS),test-$(env)-$(NAME) test-$(env)-$(NAME).cfg)
 
 .PHONY: install install-each-env
 install: install-each-env
@@ -24,14 +24,26 @@ define PERENV_build
 test-$(1)-$(NAME): $$(DEPS-$(1)) $$(link-$(1))
        $$(LD) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@
 
+cfg-$(1) ?= $(defcfg-$(1))
+
+test-$(1)-$(NAME).cfg: $$(cfg-$(1))
+       sed -e "s/@@NAME@@/$$(NAME)/g" \
+               -e "s/@@ENV@@/$(1)/g" \
+               < $$< > $$@
+
 -include $$(link-$(1):%.lds=%.d)
 -include $$(DEPS-$(1):%.o=%.d)
 
-.PHONY: install-$(1)
+.PHONY: install-$(1) install-$(1).cfg
 install-$(1): test-$(1)-$(NAME)
        @mkdir -p $(DESTDIR)
        install -m775 -p $$< $(DESTDIR)
-install-each-env: install-$(1)
+
+install-$(1).cfg: test-$(1)-$(NAME).cfg
+       @mkdir -p $(DESTDIR)
+       install -m664 -p $$< $(DESTDIR)
+
+install-each-env: install-$(1) install-$(1).cfg
 
 endef
 $(foreach env,$(TEST-ENVS),$(eval $(call PERENV_build,$(env))))
@@ -39,7 +51,7 @@ $(foreach env,$(TEST-ENVS),$(eval $(call PERENV_build,$(env))))
 .PHONY: clean
 clean:
        find $(ROOT) \( -name "*.o" -o -name "*.d" \) -delete
-       rm -f $(foreach env,$(TEST-ENVS),test-$(env)-$(NAME))
+       rm -f $(foreach env,$(TEST-ENVS),test-$(env)-$(NAME) test-$(env)-$(NAME).cfg)
 
 .PHONY: %var
 %var: