@@ -38,7 +38,7 @@ func TestMain(m *testing.M) {
38
38
}
39
39
40
40
func TestHelp (t * testing.T ) {
41
- output , err := load .RunLego ("-h" )
41
+ output , err := load .RunLegoCombinedOutput ("-h" )
42
42
if err != nil {
43
43
fmt .Fprintf (os .Stderr , "%s\n " , output )
44
44
t .Fatal (err )
@@ -50,18 +50,14 @@ func TestHelp(t *testing.T) {
50
50
func TestChallengeHTTP_Run (t * testing.T ) {
51
51
loader .CleanLegoFiles ()
52
52
53
- output , err := load .RunLego (
53
+ err := load .RunLego (
54
54
"-m" , "hubert@hubert.com" ,
55
55
"--accept-tos" ,
56
56
"-s" , "https://localhost:14000/dir" ,
57
57
"-d" , "acme.wtf" ,
58
58
"--http" ,
59
59
"--http.port" , ":5002" ,
60
60
"run" )
61
-
62
- if len (output ) > 0 {
63
- fmt .Fprintf (os .Stdout , "%s\n " , output )
64
- }
65
61
if err != nil {
66
62
t .Fatal (err )
67
63
}
@@ -70,18 +66,14 @@ func TestChallengeHTTP_Run(t *testing.T) {
70
66
func TestChallengeTLS_Run_Domains (t * testing.T ) {
71
67
loader .CleanLegoFiles ()
72
68
73
- output , err := load .RunLego (
69
+ err := load .RunLego (
74
70
"-m" , "hubert@hubert.com" ,
75
71
"--accept-tos" ,
76
72
"-s" , "https://localhost:14000/dir" ,
77
73
"-d" , "acme.wtf" ,
78
74
"--tls" ,
79
75
"--tls.port" , ":5001" ,
80
76
"run" )
81
-
82
- if len (output ) > 0 {
83
- fmt .Fprintf (os .Stdout , "%s\n " , output )
84
- }
85
77
if err != nil {
86
78
t .Fatal (err )
87
79
}
@@ -90,18 +82,14 @@ func TestChallengeTLS_Run_Domains(t *testing.T) {
90
82
func TestChallengeTLS_Run_IP (t * testing.T ) {
91
83
loader .CleanLegoFiles ()
92
84
93
- output , err := load .RunLego (
85
+ err := load .RunLego (
94
86
"-m" , "hubert@hubert.com" ,
95
87
"--accept-tos" ,
96
88
"-s" , "https://localhost:14000/dir" ,
97
89
"-d" , "127.0.0.1" ,
98
90
"--tls" ,
99
91
"--tls.port" , ":5001" ,
100
92
"run" )
101
-
102
- if len (output ) > 0 {
103
- fmt .Fprintf (os .Stdout , "%s\n " , output )
104
- }
105
93
if err != nil {
106
94
t .Fatal (err )
107
95
}
@@ -110,18 +98,14 @@ func TestChallengeTLS_Run_IP(t *testing.T) {
110
98
func TestChallengeTLS_Run_CSR (t * testing.T ) {
111
99
loader .CleanLegoFiles ()
112
100
113
- output , err := load .RunLego (
101
+ err := load .RunLego (
114
102
"-m" , "hubert@hubert.com" ,
115
103
"--accept-tos" ,
116
104
"-s" , "https://localhost:14000/dir" ,
117
105
"-csr" , "./fixtures/csr.raw" ,
118
106
"--tls" ,
119
107
"--tls.port" , ":5001" ,
120
108
"run" )
121
-
122
- if len (output ) > 0 {
123
- fmt .Fprintf (os .Stdout , "%s\n " , output )
124
- }
125
109
if err != nil {
126
110
t .Fatal (err )
127
111
}
@@ -130,18 +114,14 @@ func TestChallengeTLS_Run_CSR(t *testing.T) {
130
114
func TestChallengeTLS_Run_CSR_PEM (t * testing.T ) {
131
115
loader .CleanLegoFiles ()
132
116
133
- output , err := load .RunLego (
117
+ err := load .RunLego (
134
118
"-m" , "hubert@hubert.com" ,
135
119
"--accept-tos" ,
136
120
"-s" , "https://localhost:14000/dir" ,
137
121
"-csr" , "./fixtures/csr.cert" ,
138
122
"--tls" ,
139
123
"--tls.port" , ":5001" ,
140
124
"run" )
141
-
142
- if len (output ) > 0 {
143
- fmt .Fprintf (os .Stdout , "%s\n " , output )
144
- }
145
125
if err != nil {
146
126
t .Fatal (err )
147
127
}
@@ -150,7 +130,7 @@ func TestChallengeTLS_Run_CSR_PEM(t *testing.T) {
150
130
func TestChallengeTLS_Run_Revoke (t * testing.T ) {
151
131
loader .CleanLegoFiles ()
152
132
153
- output , err := load .RunLego (
133
+ err := load .RunLego (
154
134
"-m" , "hubert@hubert.com" ,
155
135
"--accept-tos" ,
156
136
"-s" , "https://localhost:14000/dir" ,
@@ -159,26 +139,18 @@ func TestChallengeTLS_Run_Revoke(t *testing.T) {
159
139
"--tls" ,
160
140
"--tls.port" , ":5001" ,
161
141
"run" )
162
-
163
- if len (output ) > 0 {
164
- fmt .Fprintf (os .Stdout , "%s\n " , output )
165
- }
166
142
if err != nil {
167
143
t .Fatal (err )
168
144
}
169
145
170
- output , err = load .RunLego (
146
+ err = load .RunLego (
171
147
"-m" , "hubert@hubert.com" ,
172
148
"--accept-tos" ,
173
149
"-s" , "https://localhost:14000/dir" ,
174
150
"-d" , "lego.wtf" ,
175
151
"--tls" ,
176
152
"--tls.port" , ":5001" ,
177
153
"revoke" )
178
-
179
- if len (output ) > 0 {
180
- fmt .Fprintf (os .Stdout , "%s\n " , output )
181
- }
182
154
if err != nil {
183
155
t .Fatal (err )
184
156
}
@@ -187,34 +159,26 @@ func TestChallengeTLS_Run_Revoke(t *testing.T) {
187
159
func TestChallengeTLS_Run_Revoke_Non_ASCII (t * testing.T ) {
188
160
loader .CleanLegoFiles ()
189
161
190
- output , err := load .RunLego (
162
+ err := load .RunLego (
191
163
"-m" , "hubert@hubert.com" ,
192
164
"--accept-tos" ,
193
165
"-s" , "https://localhost:14000/dir" ,
194
166
"-d" , "légô.wtf" ,
195
167
"--tls" ,
196
168
"--tls.port" , ":5001" ,
197
169
"run" )
198
-
199
- if len (output ) > 0 {
200
- fmt .Fprintf (os .Stdout , "%s\n " , output )
201
- }
202
170
if err != nil {
203
171
t .Fatal (err )
204
172
}
205
173
206
- output , err = load .RunLego (
174
+ err = load .RunLego (
207
175
"-m" , "hubert@hubert.com" ,
208
176
"--accept-tos" ,
209
177
"-s" , "https://localhost:14000/dir" ,
210
178
"-d" , "légô.wtf" ,
211
179
"--tls" ,
212
180
"--tls.port" , ":5001" ,
213
181
"revoke" )
214
-
215
- if len (output ) > 0 {
216
- fmt .Fprintf (os .Stdout , "%s\n " , output )
217
- }
218
182
if err != nil {
219
183
t .Fatal (err )
220
184
}
0 commit comments