Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions integration/nats_firewall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ var _ = Describe("nats firewall", func() {
AfterEach(func() {
err := testEnvironment.DetachDevice("/dev/sdh")
Expect(err).ToNot(HaveOccurred())
_, err = testEnvironment.RunCommand("sudo ip6tables -t mangle -D POSTROUTING -d 2001:db8::1 -p tcp --dport 8080 -m cgroup --cgroup 2958295042 -j ACCEPT --wait")
Expect(err).To(BeNil())
_, err = testEnvironment.RunCommand("sudo ip6tables -t mangle -D POSTROUTING -d 2001:db8::1 -p tcp --dport 8080 -j DROP --wait")
Expect(err).To(BeNil())
_, err = testEnvironment.RunCommand("sudo ip6tables -t mangle -D POSTROUTING -d 2001:db8::1 -p tcp --dport 4222 -m cgroup --cgroup 2958295042 -j ACCEPT --wait")
Expect(err).ToNot(HaveOccurred())
_, err = testEnvironment.RunCommand("sudo ip6tables -t mangle -D POSTROUTING -d 2001:db8::1 -p tcp --dport 4222 -j DROP --wait")
Expect(err).ToNot(HaveOccurred())
})

It("sets up the outgoing nats for firewall ipv6", func() {
Expand All @@ -96,8 +96,8 @@ var _ = Describe("nats firewall", func() {
Expect(err).To(BeNil())

// Check iptables for inclusion of the nats_cgroup_id
Expect(output).To(MatchRegexp("ACCEPT *tcp *anywhere *2001:db8::1 *tcp dpt:http-alt cgroup 2958295042"))
Expect(output).To(MatchRegexp("DROP *tcp *anywhere *2001:db8::1 *tcp dpt:http-alt"))
Expect(output).To(MatchRegexp("ACCEPT *tcp *anywhere *2001:db8::1 *tcp dpt:4222 cgroup 2958295042"))
Expect(output).To(MatchRegexp("DROP *tcp *anywhere *2001:db8::1 *tcp dpt:4222"))

Expect(output).To(MatchRegexp("2001:db8::1"))
})
Expand Down