@@ -26,12 +26,10 @@ func buildCertDirectory() (string, func(), error) {
26
26
27
27
func TestGenCertsGenericDefaults (t * testing.T ) {
28
28
dataDir , destroy , schemaErr := buildCertDirectory ()
29
- //defer destroy()
30
-
31
29
if schemaErr != nil {
32
- destroy ()
33
30
t .Fatal (schemaErr )
34
31
}
32
+ defer destroy ()
35
33
36
34
config := cmd.GenerateCertificates {
37
35
DataDir : dataDir ,
@@ -40,7 +38,7 @@ func TestGenCertsGenericDefaults(t *testing.T) {
40
38
ValidFor : 1 , // 1ns ... 1*1e9 == 1s
41
39
}
42
40
43
- args := []string {"args" } // "Commander" interface args
41
+ args := []string {"" }
44
42
45
43
if err := config .Execute (args ); err != nil {
46
44
t .Fatalf ("unable to GenerateCertificates: %s" , err )
@@ -51,8 +49,8 @@ func TestGenCertsGenericDefaults(t *testing.T) {
51
49
if errSsl != nil {
52
50
t .Fatalf ("unable to find sslPath: %s" , errSsl )
53
51
}
54
- if fileInfoSsl .Mode ().Perm () != 0775 {
55
- t .Fatal ("ssl directory does not have 0775 permissions" )
52
+ if fileInfoSsl .Mode ().Perm () != 0755 {
53
+ t .Fatal ("ssl directory does not have 0755 permissions" )
56
54
}
57
55
if ! fileInfoSsl .IsDir () {
58
56
t .Fatalf ("Expecting a directory: %s" , dataDir )
@@ -63,8 +61,8 @@ func TestGenCertsGenericDefaults(t *testing.T) {
63
61
if errCert != nil {
64
62
t .Fatalf ("unable to find certPemPath %s: %s" , certPemPath , errCert )
65
63
}
66
- if fileInfoCert .Mode ().Perm () != 0664 {
67
- t .Fatal ("cert.pem does not have 0664 permissions" )
64
+ if fileInfoCert .Mode ().Perm () != 0644 {
65
+ t .Fatal ("cert.pem does not have 0644 permissions" )
68
66
}
69
67
if ! fileInfoCert .Mode ().IsRegular () {
70
68
t .Fatalf ("Expecting a file: %s" , certPemPath )
0 commit comments