mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
Merge pull request #1653 from dave-tucker/ltp-ci
Changes required to run LTP tests in CI
This commit is contained in:
commit
2ec3884283
12
Makefile
12
Makefile
@ -52,7 +52,7 @@ install:
|
|||||||
cp -R ./bin/* $(PREFIX)/bin
|
cp -R ./bin/* $(PREFIX)/bin
|
||||||
|
|
||||||
define check_test_log
|
define check_test_log
|
||||||
@cat $1 |grep -q 'Kernel config test suite PASSED'
|
@cat $1 |grep -q 'test suite PASSED'
|
||||||
endef
|
endef
|
||||||
|
|
||||||
.PHONY: test-hyperkit
|
.PHONY: test-hyperkit
|
||||||
@ -71,16 +71,26 @@ test: test-initrd.img test-bzImage test-cmdline
|
|||||||
tar cf - $^ | ./scripts/qemu.sh 2>&1 | tee test.log
|
tar cf - $^ | ./scripts/qemu.sh 2>&1 | tee test.log
|
||||||
$(call check_test_log, test.log)
|
$(call check_test_log, test.log)
|
||||||
|
|
||||||
|
test-ltp.img.tar.gz: $(MOBY) test/ltp/test-ltp.yml
|
||||||
|
$(MOBY) build test/ltp/test-ltp.yml
|
||||||
|
|
||||||
|
.PHONY: test-ltp
|
||||||
|
test-ltp: $(MOBY) test-ltp.img.tar.gz
|
||||||
|
$(MOBY) run gcp -skip-cleanup -machine n1-highcpu-4 test-ltp.img.tar.gz | tee test-ltp.log
|
||||||
|
$(call check_test_log, test-ltp.log)
|
||||||
|
|
||||||
.PHONY: ci ci-tag ci-pr
|
.PHONY: ci ci-tag ci-pr
|
||||||
ci:
|
ci:
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
$(MAKE)
|
$(MAKE)
|
||||||
$(MAKE) test
|
$(MAKE) test
|
||||||
|
$(MAKE) test-ltp
|
||||||
|
|
||||||
ci-tag:
|
ci-tag:
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
$(MAKE)
|
$(MAKE)
|
||||||
$(MAKE) test
|
$(MAKE) test
|
||||||
|
$(MAKE) test-ltp
|
||||||
|
|
||||||
ci-pr:
|
ci-pr:
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
|
@ -45,6 +45,7 @@ func runGcp(args []string) {
|
|||||||
familyFlag := gcpCmd.String("family", "", "GCP Image Family. A group of images where the family name points to the most recent image. *Optional* when 'prefix' is a filename")
|
familyFlag := gcpCmd.String("family", "", "GCP Image Family. A group of images where the family name points to the most recent image. *Optional* when 'prefix' is a filename")
|
||||||
nameFlag := gcpCmd.String("img-name", "", "Overrides the Name used to identify the file in Google Storage, Image and Instance. Defaults to [name]")
|
nameFlag := gcpCmd.String("img-name", "", "Overrides the Name used to identify the file in Google Storage, Image and Instance. Defaults to [name]")
|
||||||
diskSizeFlag := gcpCmd.Int("disk-size", 0, "Size of system disk in GB")
|
diskSizeFlag := gcpCmd.Int("disk-size", 0, "Size of system disk in GB")
|
||||||
|
skipCleanup := gcpCmd.Bool("skip-cleanup", false, "Don't remove images or VMs")
|
||||||
|
|
||||||
if err := gcpCmd.Parse(args); err != nil {
|
if err := gcpCmd.Parse(args); err != nil {
|
||||||
log.Fatal("Unable to parse args")
|
log.Fatal("Unable to parse args")
|
||||||
@ -107,7 +108,9 @@ func runGcp(args []string) {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = client.DeleteInstance(name, zone, true); err != nil {
|
if !*skipCleanup {
|
||||||
log.Fatal(err)
|
if err = client.DeleteInstance(name, zone, true); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user