@@ -36,8 +36,10 @@ func Test_createPastaArgs(t *testing.T) {
3636 ),
3737 wantArgs : []string {
3838 "--config-net" , "--dns-forward" , dnsForwardIpv4 , "-t" , "none" , "-u" , "none" ,
39- "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
40- mapGuestAddrOpt , mapGuestAddrIpv4 ,
39+ "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
40+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
41+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
42+ "--netns" , "netns123" ,
4143 },
4244 wantDNSForward : []string {dnsForwardIpv4 },
4345 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -51,8 +53,10 @@ func Test_createPastaArgs(t *testing.T) {
5153 ),
5254 wantArgs : []string {
5355 "--config-net" , "-t" , "80-80:80-80" , "--dns-forward" , dnsForwardIpv4 , "-u" , "none" ,
54- "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
55- mapGuestAddrOpt , mapGuestAddrIpv4 ,
56+ "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
57+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
58+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
59+ "--netns" , "netns123" ,
5660 },
5761 wantDNSForward : []string {dnsForwardIpv4 },
5862 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -66,8 +70,10 @@ func Test_createPastaArgs(t *testing.T) {
6670 ),
6771 wantArgs : []string {
6872 "--config-net" , "-t" , "80-82:80-82" , "--dns-forward" , dnsForwardIpv4 , "-u" , "none" ,
69- "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
70- mapGuestAddrOpt , mapGuestAddrIpv4 ,
73+ "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
74+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
75+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
76+ "--netns" , "netns123" ,
7177 },
7278 wantDNSForward : []string {dnsForwardIpv4 },
7379 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -81,8 +87,10 @@ func Test_createPastaArgs(t *testing.T) {
8187 ),
8288 wantArgs : []string {
8389 "--config-net" , "-t" , "80-80:60-60" , "--dns-forward" , dnsForwardIpv4 , "-u" , "none" ,
84- "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
85- mapGuestAddrOpt , mapGuestAddrIpv4 ,
90+ "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
91+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
92+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
93+ "--netns" , "netns123" ,
8694 },
8795 wantDNSForward : []string {dnsForwardIpv4 },
8896 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -99,8 +107,10 @@ func Test_createPastaArgs(t *testing.T) {
99107 ),
100108 wantArgs : []string {
101109 "--config-net" , "-t" , "80-80:60-60" , "-u" , "100-100:100-100" , "--dns-forward" ,
102- dnsForwardIpv4 , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
103- mapGuestAddrOpt , mapGuestAddrIpv4 ,
110+ dnsForwardIpv4 , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
111+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
112+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
113+ "--netns" , "netns123" ,
104114 },
105115 wantDNSForward : []string {dnsForwardIpv4 },
106116 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -117,8 +127,10 @@ func Test_createPastaArgs(t *testing.T) {
117127 ),
118128 wantArgs : []string {
119129 "--config-net" , "-t" , "80-80:60-60" , "-t" , "100-100:100-100" , "--dns-forward" ,
120- dnsForwardIpv4 , "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
121- mapGuestAddrOpt , mapGuestAddrIpv4 ,
130+ dnsForwardIpv4 , "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
131+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
132+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
133+ "--netns" , "netns123" ,
122134 },
123135 wantDNSForward : []string {dnsForwardIpv4 },
124136 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -143,8 +155,10 @@ func Test_createPastaArgs(t *testing.T) {
143155 ),
144156 wantArgs : []string {
145157 "--config-net" , "-i" , "eth0" , "-n" , "24" , "--dns-forward" , dnsForwardIpv4 ,
146- "-t" , "none" , "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
147- mapGuestAddrOpt , mapGuestAddrIpv4 ,
158+ "-t" , "none" , "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
159+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
160+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
161+ "--netns" , "netns123" ,
148162 },
149163 wantDNSForward : []string {dnsForwardIpv4 },
150164 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -158,8 +172,10 @@ func Test_createPastaArgs(t *testing.T) {
158172 ),
159173 wantArgs : []string {
160174 "--config-net" , "-i" , "eth0" , "-n" , "24" , "--dns-forward" , dnsForwardIpv4 ,
161- "-t" , "none" , "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
162- mapGuestAddrOpt , mapGuestAddrIpv4 ,
175+ "-t" , "none" , "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
176+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
177+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
178+ "--netns" , "netns123" ,
163179 },
164180 wantDNSForward : []string {dnsForwardIpv4 },
165181 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -173,8 +189,10 @@ func Test_createPastaArgs(t *testing.T) {
173189 ),
174190 wantArgs : []string {
175191 "--config-net" , "-T" , "80" , "--dns-forward" , dnsForwardIpv4 ,
176- "-t" , "none" , "-u" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
177- mapGuestAddrOpt , mapGuestAddrIpv4 ,
192+ "-t" , "none" , "-u" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
193+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
194+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
195+ "--netns" , "netns123" ,
178196 },
179197 wantDNSForward : []string {dnsForwardIpv4 },
180198 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -188,8 +206,10 @@ func Test_createPastaArgs(t *testing.T) {
188206 ),
189207 wantArgs : []string {
190208 "--config-net" , "--tcp-ns" , "80" , "--dns-forward" , dnsForwardIpv4 ,
191- "-t" , "none" , "-u" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
192- mapGuestAddrOpt , mapGuestAddrIpv4 ,
209+ "-t" , "none" , "-u" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
210+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
211+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
212+ "--netns" , "netns123" ,
193213 },
194214 wantDNSForward : []string {dnsForwardIpv4 },
195215 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -203,8 +223,10 @@ func Test_createPastaArgs(t *testing.T) {
203223 ),
204224 wantArgs : []string {
205225 "--config-net" , "--dns-forward" , dnsForwardIpv4 , "-t" , "none" ,
206- "-u" , "none" , "-T" , "none" , "-U" , "none" , "--quiet" , "--netns" , "netns123" ,
207- mapGuestAddrOpt , mapGuestAddrIpv4 ,
226+ "-u" , "none" , "-T" , "none" , "-U" , "none" , "--quiet" ,
227+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
228+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
229+ "--netns" , "netns123" ,
208230 },
209231 wantDNSForward : []string {dnsForwardIpv4 },
210232 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -218,8 +240,10 @@ func Test_createPastaArgs(t *testing.T) {
218240 ),
219241 wantArgs : []string {
220242 "--config-net" , "-T" , "80" , "--dns-forward" , dnsForwardIpv4 ,
221- "-t" , "none" , "-u" , "none" , "-U" , "none" , "--quiet" , "--netns" , "netns123" ,
222- mapGuestAddrOpt , mapGuestAddrIpv4 ,
243+ "-t" , "none" , "-u" , "none" , "-U" , "none" , "--quiet" ,
244+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
245+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
246+ "--netns" , "netns123" ,
223247 },
224248 wantDNSForward : []string {dnsForwardIpv4 },
225249 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -233,8 +257,10 @@ func Test_createPastaArgs(t *testing.T) {
233257 ),
234258 wantArgs : []string {
235259 "--config-net" , "-T" , "80" , "--dns-forward" , dnsForwardIpv4 ,
236- "-t" , "none" , "-u" , "none" , "-U" , "none" , "--quiet" , "--netns" , "netns123" ,
237- mapGuestAddrOpt , mapGuestAddrIpv4 ,
260+ "-t" , "none" , "-u" , "none" , "-U" , "none" , "--quiet" ,
261+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
262+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
263+ "--netns" , "netns123" ,
238264 },
239265 wantDNSForward : []string {dnsForwardIpv4 },
240266 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -248,8 +274,10 @@ func Test_createPastaArgs(t *testing.T) {
248274 ),
249275 wantArgs : []string {
250276 "--config-net" , "--dns-forward" , "192.168.255.255" , "-t" , "none" ,
251- "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
252- mapGuestAddrOpt , mapGuestAddrIpv4 ,
277+ "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
278+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
279+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
280+ "--netns" , "netns123" ,
253281 },
254282 wantDNSForward : []string {"192.168.255.255" },
255283 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -263,8 +291,10 @@ func Test_createPastaArgs(t *testing.T) {
263291 ),
264292 wantArgs : []string {
265293 "--config-net" , "--dns-forward" , "192.168.255.255" , "--dns-forward" , "::1" , "-t" , "none" ,
266- "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
267- mapGuestAddrOpt , mapGuestAddrIpv4 ,
294+ "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
295+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
296+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
297+ "--netns" , "netns123" ,
268298 },
269299 wantDNSForward : []string {"192.168.255.255" , "::1" },
270300 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -278,8 +308,10 @@ func Test_createPastaArgs(t *testing.T) {
278308 ),
279309 wantArgs : []string {
280310 "--config-net" , "-i" , "eth0" , "-t" , "80-80:80-80" , "--dns-forward" , dnsForwardIpv4 ,
281- "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
282- mapGuestAddrOpt , mapGuestAddrIpv4 ,
311+ "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
312+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
313+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
314+ "--netns" , "netns123" ,
283315 },
284316 wantDNSForward : []string {dnsForwardIpv4 },
285317 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -294,7 +326,10 @@ func Test_createPastaArgs(t *testing.T) {
294326 wantArgs : []string {
295327 "--config-net" , "--log-file=/tmp/log" , "--trace" , "--debug" ,
296328 "--dns-forward" , dnsForwardIpv4 , "-t" , "none" , "-u" , "none" , "-T" , "none" , "-U" , "none" ,
297- "--no-map-gw" , "--netns" , "netns123" , mapGuestAddrOpt , mapGuestAddrIpv4 ,
329+ "--no-map-gw" ,
330+ mapGuestAddrOpt , mapGuestAddrIpv4 , mapGuestAddrOpt , mapGuestAddrIpv6 ,
331+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
332+ "--netns" , "netns123" ,
298333 },
299334 wantDNSForward : []string {dnsForwardIpv4 },
300335 wantMapGuestAddr : []string {mapGuestAddrIpv4 },
@@ -309,6 +344,7 @@ func Test_createPastaArgs(t *testing.T) {
309344 wantArgs : []string {
310345 "--config-net" , mapGuestAddrOpt , "192.168.255.255" , dnsForwardOpt , dnsForwardIpv4 ,
311346 "-t" , "none" , "-u" , "none" , "-T" , "none" , "-U" , "none" , "--no-map-gw" , "--quiet" ,
347+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
312348 "--netns" , "netns123" ,
313349 },
314350 wantDNSForward : []string {dnsForwardIpv4 },
@@ -324,7 +360,9 @@ func Test_createPastaArgs(t *testing.T) {
324360 wantArgs : []string {
325361 "--config-net" , mapGuestAddrOpt , "192.168.255.255" , mapGuestAddrOpt , "::1" ,
326362 dnsForwardOpt , dnsForwardIpv4 , "-t" , "none" , "-u" , "none" , "-T" , "none" ,
327- "-U" , "none" , "--no-map-gw" , "--quiet" , "--netns" , "netns123" ,
363+ "-U" , "none" , "--no-map-gw" , "--quiet" ,
364+ addressOpt , guestAddrIpv6 , gatewayOpt , gatewayIpv6 ,
365+ "--netns" , "netns123" ,
328366 },
329367 wantDNSForward : []string {dnsForwardIpv4 },
330368 wantMapGuestAddr : []string {"192.168.255.255" , "::1" },
0 commit comments