mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-01 02:57:59 +00:00 
			
		
		
		
	s/TF_ACC/VAULT_ACC
This commit is contained in:
		
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							| @@ -18,7 +18,7 @@ dev: generate | |||||||
|  |  | ||||||
| # test runs the unit tests and vets the code | # test runs the unit tests and vets the code | ||||||
| test: generate | test: generate | ||||||
| 	VAULT_TOKEN= TF_ACC= go test $(TEST) $(TESTARGS) -timeout=120s -parallel=4 | 	VAULT_TOKEN= VAULT_ACC= go test $(TEST) $(TESTARGS) -timeout=120s -parallel=4 | ||||||
|  |  | ||||||
| # testacc runs acceptance tests | # testacc runs acceptance tests | ||||||
| testacc: generate | testacc: generate | ||||||
| @@ -26,11 +26,11 @@ testacc: generate | |||||||
| 		echo "ERROR: Set TEST to a specific package"; \ | 		echo "ERROR: Set TEST to a specific package"; \ | ||||||
| 		exit 1; \ | 		exit 1; \ | ||||||
| 	fi | 	fi | ||||||
| 	TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m | 	VAULT_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m | ||||||
|  |  | ||||||
| # testrace runs the race checker | # testrace runs the race checker | ||||||
| testrace: generate | testrace: generate | ||||||
| 	CGO_ENABLED=1 VAULT_TOKEN= TF_ACC= go test -race $(TEST) $(TESTARGS) | 	CGO_ENABLED=1 VAULT_TOKEN= VAULT_ACC= go test -race $(TEST) $(TESTARGS) | ||||||
|  |  | ||||||
| cover: | cover: | ||||||
| 	./scripts/coverage.sh --html | 	./scripts/coverage.sh --html | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ import ( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| func TestBackend_basic(t *testing.T) { | func TestBackend_basic(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -40,7 +40,7 @@ func TestBackend_basic(t *testing.T) { | |||||||
| } | } | ||||||
|  |  | ||||||
| func TestBackend_management(t *testing.T) { | func TestBackend_management(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -61,7 +61,7 @@ func TestBackend_management(t *testing.T) { | |||||||
| } | } | ||||||
|  |  | ||||||
| func TestBackend_crud(t *testing.T) { | func TestBackend_crud(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -82,7 +82,7 @@ func TestBackend_crud(t *testing.T) { | |||||||
| } | } | ||||||
|  |  | ||||||
| func TestBackend_role_lease(t *testing.T) { | func TestBackend_role_lease(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ var ( | |||||||
| // Performs basic tests on CA functionality | // Performs basic tests on CA functionality | ||||||
| // Uses the RSA CA key | // Uses the RSA CA key | ||||||
| func TestBackend_RSAKey(t *testing.T) { | func TestBackend_RSAKey(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -71,7 +71,7 @@ func TestBackend_RSAKey(t *testing.T) { | |||||||
| // Performs basic tests on CA functionality | // Performs basic tests on CA functionality | ||||||
| // Uses the EC CA key | // Uses the EC CA key | ||||||
| func TestBackend_ECKey(t *testing.T) { | func TestBackend_ECKey(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -104,7 +104,7 @@ func TestBackend_ECKey(t *testing.T) { | |||||||
| } | } | ||||||
|  |  | ||||||
| func TestBackend_CSRValues(t *testing.T) { | func TestBackend_CSRValues(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -137,7 +137,7 @@ func TestBackend_CSRValues(t *testing.T) { | |||||||
| } | } | ||||||
|  |  | ||||||
| func TestBackend_URLsCRUD(t *testing.T) { | func TestBackend_URLsCRUD(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -173,7 +173,7 @@ func TestBackend_URLsCRUD(t *testing.T) { | |||||||
| // of role flags to ensure that they are properly restricted | // of role flags to ensure that they are properly restricted | ||||||
| // Uses the RSA CA key | // Uses the RSA CA key | ||||||
| func TestBackend_RSARoles(t *testing.T) { | func TestBackend_RSARoles(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -220,7 +220,7 @@ func TestBackend_RSARoles(t *testing.T) { | |||||||
| // of role flags to ensure that they are properly restricted | // of role flags to ensure that they are properly restricted | ||||||
| // Uses the RSA CA key | // Uses the RSA CA key | ||||||
| func TestBackend_RSARoles_CSR(t *testing.T) { | func TestBackend_RSARoles_CSR(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -267,7 +267,7 @@ func TestBackend_RSARoles_CSR(t *testing.T) { | |||||||
| // of role flags to ensure that they are properly restricted | // of role flags to ensure that they are properly restricted | ||||||
| // Uses the EC CA key | // Uses the EC CA key | ||||||
| func TestBackend_ECRoles(t *testing.T) { | func TestBackend_ECRoles(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -314,7 +314,7 @@ func TestBackend_ECRoles(t *testing.T) { | |||||||
| // of role flags to ensure that they are properly restricted | // of role flags to ensure that they are properly restricted | ||||||
| // Uses the EC CA key | // Uses the EC CA key | ||||||
| func TestBackend_ECRoles_CSR(t *testing.T) { | func TestBackend_ECRoles_CSR(t *testing.T) { | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -554,7 +554,7 @@ func TestKeyUpgrade(t *testing.T) { | |||||||
|  |  | ||||||
| func TestPolicyFuzzing(t *testing.T) { | func TestPolicyFuzzing(t *testing.T) { | ||||||
| 	// Don't run if not during acceptance tests | 	// Don't run if not during acceptance tests | ||||||
| 	if os.Getenv("TF_ACC") == "" { | 	if os.Getenv("VAULT_ACC") == "" { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ import ( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| // TestEnvVar must be set to a non-empty value for acceptance tests to run. | // TestEnvVar must be set to a non-empty value for acceptance tests to run. | ||||||
| const TestEnvVar = "TF_ACC" | const TestEnvVar = "VAULT_ACC" | ||||||
|  |  | ||||||
| // TestCase is a single set of tests to run for a backend. A TestCase | // TestCase is a single set of tests to run for a backend. A TestCase | ||||||
| // should generally map 1:1 to each test method for your acceptance | // should generally map 1:1 to each test method for your acceptance | ||||||
| @@ -45,7 +45,7 @@ type TestCase struct { | |||||||
| 	Teardown TestTeardownFunc | 	Teardown TestTeardownFunc | ||||||
|  |  | ||||||
| 	// AcceptanceTest, if set, the test case will be run only if | 	// AcceptanceTest, if set, the test case will be run only if | ||||||
| 	// the environment variable TF_ACC is set. If not this test case | 	// the environment variable VAULT_ACC is set. If not this test case | ||||||
| 	// will be run as a unit test. | 	// will be run as a unit test. | ||||||
| 	AcceptanceTest bool | 	AcceptanceTest bool | ||||||
| } | } | ||||||
| @@ -95,7 +95,7 @@ type TestTeardownFunc func() error | |||||||
|  |  | ||||||
| // Test performs an acceptance test on a backend with the given test case. | // Test performs an acceptance test on a backend with the given test case. | ||||||
| // | // | ||||||
| // Tests are not run unless an environmental variable "TF_ACC" is | // Tests are not run unless an environmental variable "VAULT_ACC" is | ||||||
| // set to some non-empty value. This is to avoid test cases surprising | // set to some non-empty value. This is to avoid test cases surprising | ||||||
| // a user by creating real resources. | // a user by creating real resources. | ||||||
| // | // | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								make.bat
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								make.bat
									
									
									
									
									
								
							| @@ -44,7 +44,7 @@ REM testacc runs acceptance tests. | |||||||
| 	call :testsetup | 	call :testsetup | ||||||
| 	if x%_TEST% == x./... goto testacc_fail | 	if x%_TEST% == x./... goto testacc_fail | ||||||
| 	if x%_TEST% == x.\... goto testacc_fail | 	if x%_TEST% == x.\... goto testacc_fail | ||||||
| 	set TF_ACC=1 | 	set VAULT_ACC=1 | ||||||
| 	go test %_TEST% -v %TESTARGS% -timeout 45m | 	go test %_TEST% -v %TESTARGS% -timeout 45m | ||||||
| 	exit /b %ERRORLEVEL% | 	exit /b %ERRORLEVEL% | ||||||
| :testacc_fail | :testacc_fail | ||||||
| @@ -57,13 +57,13 @@ REM testrace runs the race checker. | |||||||
| 	go test -race %_TEST% %TESTARGS% | 	go test -race %_TEST% %TESTARGS% | ||||||
| 	exit /b %ERRORLEVEL% | 	exit /b %ERRORLEVEL% | ||||||
|  |  | ||||||
| REM testsetup calls `go generate` and defines the variables TF_ACC | REM testsetup calls `go generate` and defines the variables VAULT_ACC | ||||||
| REM and _TEST. TF_ACC is always cleared. _TEST defaults to the value | REM and _TEST. VAULT_ACC is always cleared. _TEST defaults to the value | ||||||
| REM of the TEST environment variable, provided that TEST is defined, | REM of the TEST environment variable, provided that TEST is defined, | ||||||
| REM otherwise _TEST it is set to "./...". | REM otherwise _TEST it is set to "./...". | ||||||
| :testsetup | :testsetup | ||||||
| 	call :generate | 	call :generate | ||||||
| 	set TF_ACC= | 	set VAULT_ACC= | ||||||
| 	set _TEST=./... | 	set _TEST=./... | ||||||
| 	if defined TEST set _TEST=%TEST% | 	if defined TEST set _TEST=%TEST% | ||||||
| 	goto :eof | 	goto :eof | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 vishalnayak
					vishalnayak