Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
4 changes: 3 additions & 1 deletion test/fixtures/networking_firewalls_123.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"outbound":[],
"outbound_policy":"DROP",
"inbound":[],
"inbound_policy":"DROP"
"inbound_policy":"DROP",
"version":2,
"fingerprint":"4ef67a29"
},
"tags":[]
}
4 changes: 3 additions & 1 deletion test/fixtures/networking_firewalls_123_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"inbound": [],
"inbound_policy": "DROP",
"outbound": [],
"outbound_policy": "DROP"
"outbound_policy": "DROP",
"version": 2,
"fingerprint": "4ef67a29"
}
8 changes: 8 additions & 0 deletions test/integration/models/firewall/test_firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def test_get_firewall_rules(test_linode_client, test_firewall):

assert rules.inbound_policy in ["ACCEPT", "DROP"]
assert rules.outbound_policy in ["ACCEPT", "DROP"]
assert isinstance(rules.version, int)
assert rules.version > 0
assert isinstance(rules.fingerprint, str)
assert len(rules.fingerprint) > 0


@pytest.mark.smoke
Expand Down Expand Up @@ -61,6 +65,10 @@ def test_update_firewall_rules(test_linode_client, test_firewall):

assert firewall.rules.inbound_policy == "ACCEPT"
assert firewall.rules.outbound_policy == "DROP"
assert isinstance(firewall.rules.version, int)
assert firewall.rules.version > 0
assert isinstance(firewall.rules.fingerprint, str)
assert len(firewall.rules.fingerprint) > 0


def test_get_devices(test_linode_client, linode_fw, test_firewall):
Expand Down
2 changes: 2 additions & 0 deletions test/unit/objects/firewall_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def test_get_rules(self):
self.assertEqual(rules.inbound_policy, "DROP")
self.assertEqual(len(rules.outbound), 0)
self.assertEqual(rules.outbound_policy, "DROP")
self.assertEqual(rules.version, 2)
self.assertEqual(rules.fingerprint, "4ef67a29")

def test_update_rules(self):
"""
Expand Down
Loading