-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a test for EVE PR #4071. It test the vTPM feature of EVE and aziot on EVE both legacy (using EVE-TOOLS) and latest (using vTPM). Signed-off-by: Shahriyar Jalayeri <[email protected]>
- Loading branch information
Showing
18 changed files
with
1,451 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
DEBUG ?= "debug" | ||
|
||
# HOSTARCH is the host architecture | ||
# ARCH is the target architecture | ||
# we need to keep track of them separately | ||
HOSTARCH ?= $(shell uname -m) | ||
HOSTOS ?= $(shell uname -s | tr A-Z a-z) | ||
|
||
# canonicalized names for host architecture | ||
override HOSTARCH := $(subst aarch64,arm64,$(subst x86_64,amd64,$(HOSTARCH))) | ||
|
||
# unless otherwise set, I am building for my own architecture, i.e. not cross-compiling | ||
# and for my OS | ||
ARCH ?= $(HOSTARCH) | ||
OS ?= $(HOSTOS) | ||
|
||
# canonicalized names for target architecture | ||
override ARCH := $(subst aarch64,arm64,$(subst x86_64,amd64,$(ARCH))) | ||
|
||
WORKDIR ?= $(CURDIR)/../../dist | ||
TESTDIR := tests/$(shell basename $(CURDIR)) | ||
BINDIR := $(WORKDIR)/bin | ||
DATADIR := $(WORKDIR)/$(TESTDIR)/ | ||
BIN := eden | ||
LOCALBIN := $(BINDIR)/$(BIN)-$(OS)-$(ARCH) | ||
TESTNAME := eden.aziot | ||
TESTBIN := $(TESTNAME).test | ||
TESTSCN := $(TESTNAME).tests.txt | ||
LOCALTESTBIN := $(TESTBIN)-$(OS)-$(ARCH) | ||
LINKDIR := ../../tests/aziot | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
clean: | ||
rm -rf $(LOCALTESTBIN) $(BINDIR)/$(TESTBIN) $(WORKDIR)/$(TESTSCN) $(CURDIR)/$(TESTBIN) $(BINDIR)/$(TESTBIN) | ||
|
||
$(BINDIR): | ||
mkdir -p $@ | ||
$(DATADIR): | ||
mkdir -p $@ | ||
|
||
test: | ||
$(LOCALBIN) test $(CURDIR) -v $(DEBUG) | ||
|
||
build: setup | ||
|
||
testbin: $(TESTBIN) | ||
$(LOCALTESTBIN): $(BINDIR) *.go | ||
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go test -c -ldflags "-s -w" -o $@ *.go | ||
|
||
$(TESTBIN): $(LOCALTESTBIN) | ||
ln -sf $(LOCALTESTBIN) $(CURDIR)/$(TESTBIN) | ||
|
||
setup: testbin $(BINDIR) $(DATADIR) | ||
cp -a $(LOCALTESTBIN) $(CURDIR)/$(TESTBIN) $(BINDIR) | ||
cp -a *.yml $(TESTSCN) $(DATADIR) | ||
|
||
debug: | ||
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go test -c -gcflags "all=-N -l" -o $@ *.go | ||
dlv dap --listen=:12345 --headless=true --api-version=2 exec ./debug -- -test.v | ||
|
||
.PHONY: test build setup clean all testbin debug | ||
|
||
help: | ||
@echo "EDEN is the harness for testing EVE and ADAM" | ||
@echo | ||
@echo "This Makefile automates commons tasks of EDEN testing" | ||
@echo | ||
@echo "Commonly used maintenance and development targets:" | ||
@echo " build build test-binary (OS and ARCH options supported, for ex. OS=linux ARCH=arm64)" | ||
@echo " setup setup of test environment" | ||
@echo " test run tests" | ||
@echo " clean cleanup of test harness" | ||
@echo | ||
@echo "You need install requirements for EVE (look at https://github.com/lf-edge/eve#install-dependencies)." | ||
@echo "You need access to docker socket and installed qemu packages." |
Oops, something went wrong.