diff --git a/qubesadmin/tests/tools/qvm_firewall.py b/qubesadmin/tests/tools/qvm_firewall.py index 910dabd..1d04434 100644 --- a/qubesadmin/tests/tools/qvm_firewall.py +++ b/qubesadmin/tests/tools/qvm_firewall.py @@ -2,7 +2,7 @@ # # The Qubes OS Project, http://www.qubes-os.org # -# Copyright (C) 2016 Marek Marczykowski-Górecki +# Copyright (C) 2016 Marek Marczykowski-Górecki # # # This program is free software; you can redistribute it and/or modify @@ -195,24 +195,3 @@ class TC_10_qvm_firewall(qubesadmin.tests.QubesTestCase): ['test-vm', 'del', 'drop', 'proto=icmp'], app=self.app ) - - def test_030_policy_get(self): - self.app.expected_calls[('test-vm', 'admin.vm.firewall.GetPolicy', - None, None)] = b'0\0accept' - with qubesadmin.tests.tools.StdoutBuffer() as stdout: - qubesadmin.tools.qvm_firewall.main( - ['test-vm', 'policy'], - app=self.app - ) - self.assertEqual(stdout.getvalue(), 'accept\n') - - def test_031_policy_set(self): - self.app.expected_calls[('test-vm', 'admin.vm.firewall.SetPolicy', - None, b'accept')] = b'0\0' - with qubesadmin.tests.tools.StdoutBuffer() as stdout: - qubesadmin.tools.qvm_firewall.main( - ['test-vm', 'policy', 'accept'], - app=self.app - ) - self.assertEqual(stdout.getvalue(), '') - diff --git a/qubesadmin/tools/qvm_firewall.py b/qubesadmin/tools/qvm_firewall.py index 2f4f910..f8ae21d 100644 --- a/qubesadmin/tools/qvm_firewall.py +++ b/qubesadmin/tools/qvm_firewall.py @@ -86,11 +86,6 @@ action_del.add_argument('rule', nargs='*', action=RuleAction, action_list = action.add_parser('list', help='list rules') -action_policy = action.add_parser('policy', - help='get/set policy - default action') -action_policy.add_argument('policy', choices=['accept', 'drop'], - help='policy value', default=None, nargs='?') - parser.add_argument('--reload', '-r', action='store_true', help='force reloading rules even when unchanged') @@ -150,14 +145,6 @@ def rules_del(vm, args): vm.firewall.save_rules() -def policy(vm, args): - '''Get/Set default action (policy)''' - if args.policy is not None: - vm.firewall.policy = args.policy - else: - print(vm.firewall.policy) - - def main(args=None, app=None): '''Main routine of :program:`qvm-firewall`.''' try: @@ -167,8 +154,6 @@ def main(args=None, app=None): rules_add(vm, args) elif args.command == 'del': rules_del(vm, args) - elif args.command == 'policy': - policy(vm, args) elif args.command == 'list': if args.raw: rules_list_raw(vm)