@@ -3,6 +3,7 @@ package downstream
33import (
44 "os"
55 "path/filepath"
6+ "strings"
67 "testing"
78
89 aws "github.com/gruntwork-io/terratest/modules/aws"
@@ -30,9 +31,9 @@ func TestDownstreamSplitrole(t *testing.T) {
3031 t .Fatalf ("Error getting git root directory: %v" , err )
3132 }
3233
33- exampleDir := repoRoot + "/ examples/" + directory
34- testDir := repoRoot + "/ test/tests/data/" + id
35- pluginsDir := filepath .Join (repoRoot , "test/tests/data" , id , "plugins" )
34+ exampleDir := filepath . Join ( repoRoot , " examples" , directory )
35+ testDir := filepath . Join ( repoRoot , " test/tests/data" , id )
36+ pluginsDir := filepath .Join (testDir , "plugins" )
3637
3738 err = util .CreateTestDirectories (t , id )
3839 if err != nil {
@@ -52,7 +53,7 @@ func TestDownstreamSplitrole(t *testing.T) {
5253 }
5354 keyPairObj := keyPair .KeyPair
5455 privateKey := keyPairObj .PrivateKey
55- publicKey := keyPairObj .PublicKey
56+ publicKey := strings . TrimSuffix ( keyPairObj .PublicKey , " \n " )
5657 keyPairName := keyPair .Name
5758
5859 err = os .WriteFile (testDir + "/id_rsa" , []byte (privateKey ), 0600 )
@@ -113,7 +114,6 @@ func TestDownstreamSplitrole(t *testing.T) {
113114 "aws_region" : region ,
114115 "acme_server_url" : acme_server_url ,
115116 "downstream_node_config" : "split-role-node-config" ,
116- "data_dir" : testDir ,
117117 },
118118 // Environment variables to set when running Terraform
119119 EnvVars : map [string ]string {
@@ -123,7 +123,7 @@ func TestDownstreamSplitrole(t *testing.T) {
123123 "TF_PLUGIN_CACHE_DIR" : pluginsDir ,
124124 "TF_IN_AUTOMATION" : "1" ,
125125 "KUBECONFIG" : testDir + "/kubeconfig" ,
126- "KUBE_CONFIG_PATH" : testDir ,
126+ "KUBE_CONFIG_PATH" : testDir + "/kubeconfig" ,
127127 "TF_CLI_ARGS_plan" : "-no-color -state=" + testDir + "/tfstate" ,
128128 "TF_CLI_ARGS_apply" : "-no-color -state=" + testDir + "/tfstate" ,
129129 "TF_CLI_ARGS_destroy" : "-no-color -state=" + testDir + "/tfstate" ,
0 commit comments