-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathGNUmakefile
More file actions
79 lines (73 loc) · 3.05 KB
/
Copy pathGNUmakefile
File metadata and controls
79 lines (73 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
default: test
# Load environment variables from .env file if it exists
ifneq (,$(wildcard ./.env))
include .env
export
endif
# Run all acceptance tests across all devices and versions
.PHONY: test
test: test-1715-router test-1715-switch
@echo ""
@echo "All multi-device tests completed!"
# Test against 17.15.x Router (C8000V)
# Usage: make test-1715-router [NAME=TestName] [DEBUG=1]
.PHONY: test-1715-router
test-1715-router:
@echo "========================================="
@echo "Testing against 17.15.x Router..."
@echo "========================================="
@if [ -z "$(IOSXE_1715_ROUTER_HOST)" ]; then \
echo "SKIPPED: IOSXE_1715_ROUTER_HOST is not configured"; \
echo "To enable this test, configure IOSXE_1715_ROUTER_HOST in your .env file"; \
else \
$(if $(DEBUG),echo "Debug mode enabled - logs will be written to test-output-1715-router.log";) \
$(if $(NAME),echo "Running tests matching: $(NAME)";) \
TF_ACC=1 \
IOSXE_HOST=$(IOSXE_1715_ROUTER_HOST) \
IOSXE_USERNAME=$(or $(IOSXE_1715_ROUTER_USERNAME),$(IOSXE_USERNAME)) \
IOSXE_PASSWORD=$(or $(IOSXE_1715_ROUTER_PASSWORD),$(IOSXE_PASSWORD)) \
IOSXE_PROTOCOL=netconf \
IOSXE1715=1 \
C8000V=1 \
$(if $(DEBUG),TF_LOG=Trace) \
go test -v $(if $(NAME),-run $(NAME)) $(TESTARGS) -count 1 -timeout 60m ./internal/provider/ $(if $(DEBUG),2>&1 | tee test-output-1715-router.log); \
fi
# Test against 17.15.x Switch (C9000V)
# Usage: make test-1715-switch [NAME=TestName] [DEBUG=1]
.PHONY: test-1715-switch
test-1715-switch:
@echo "========================================="
@echo "Testing against 17.15.x Switch..."
@echo "========================================="
@if [ -z "$(IOSXE_1715_SWITCH_HOST)" ]; then \
echo "SKIPPED: IOSXE_1715_SWITCH_HOST is not configured"; \
echo "To enable this test, configure IOSXE_1715_SWITCH_HOST in your .env file"; \
else \
$(if $(DEBUG),echo "Debug mode enabled - logs will be written to test-output-1715-switch.log";) \
$(if $(NAME),echo "Running tests matching: $(NAME)";) \
TF_ACC=1 \
IOSXE_HOST=$(IOSXE_1715_SWITCH_HOST) \
IOSXE_USERNAME=$(or $(IOSXE_1715_SWITCH_USERNAME),$(IOSXE_USERNAME)) \
IOSXE_PASSWORD=$(or $(IOSXE_1715_SWITCH_PASSWORD),$(IOSXE_PASSWORD)) \
IOSXE_PROTOCOL=netconf \
IOSXE1715=1 \
C9000V=1 \
$(if $(DEBUG),TF_LOG=Trace) \
go test -v $(if $(NAME),-run $(NAME)) $(TESTARGS) -count 1 -timeout 60m ./internal/provider/ $(if $(DEBUG),2>&1 | tee test-output-1715-switch.log); \
fi
# Test all 17.15.x devices (router and switch)
.PHONY: test-1715
test-1715: test-1715-router test-1715-switch
@echo ""
@echo "All 17.15.x tests completed!"
# Update a files from a single definition
# Usage: make gen NAME="Logging"
# NAME: The name of the definition, e.g. "Logging"
.PHONY: gen
gen:
go run gen/load_models.go
go run ./gen/generator.go "$(NAME)"
go run golang.org/x/tools/cmd/goimports -w internal/provider/
terraform fmt -recursive ./examples/
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name iosxe --rendered-provider-name terraform-provider-iosxe
go run gen/doc_category.go