@@ -120,12 +120,18 @@ func TestAddSNATRules(t *testing.T) {
120120 // should be cleaned up
121121 table : iptables .Nat ,
122122 chain : SWIFTPOSTROUTING ,
123- rule : []string {"-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS , "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "99.1.2.1" },
123+ rule : []string {
124+ "-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS ,
125+ "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "99.1.2.1" ,
126+ },
124127 },
125128 {
126129 table : iptables .Nat ,
127130 chain : "SWIFT" ,
128- rule : []string {"-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS , "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "192.1.2.1" },
131+ rule : []string {
132+ "-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS ,
133+ "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "192.1.2.1" ,
134+ },
129135 },
130136 },
131137 expectedChains : []chainExpectation {
@@ -193,22 +199,34 @@ func TestAddSNATRules(t *testing.T) {
193199 {
194200 table : iptables .Nat ,
195201 chain : SWIFTPOSTROUTING ,
196- rule : []string {"-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS , "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "240.1.2.1" },
202+ rule : []string {
203+ "-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS ,
204+ "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "240.1.2.1" ,
205+ },
197206 },
198207 {
199208 table : iptables .Nat ,
200209 chain : SWIFTPOSTROUTING ,
201- rule : []string {"-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS , "-p" , "tcp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "240.1.2.1" },
210+ rule : []string {
211+ "-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS ,
212+ "-p" , "tcp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "240.1.2.1" ,
213+ },
202214 },
203215 {
204216 table : iptables .Nat ,
205217 chain : SWIFTPOSTROUTING ,
206- rule : []string {"-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureIMDS , "-p" , "tcp" , "--dport" , strconv .Itoa (iptables .HTTPPort ), "-j" , "SNAT" , "--to" , "10.0.0.4" },
218+ rule : []string {
219+ "-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureIMDS ,
220+ "-p" , "tcp" , "--dport" , strconv .Itoa (iptables .HTTPPort ), "-j" , "SNAT" , "--to" , "10.0.0.4" ,
221+ },
207222 },
208223 {
209224 table : iptables .Nat ,
210225 chain : "SWIFT" ,
211- rule : []string {"-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS , "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "192.1.2.1" },
226+ rule : []string {
227+ "-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS ,
228+ "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "192.1.2.1" ,
229+ },
212230 },
213231 },
214232 expectedChains : []chainExpectation {
0 commit comments