mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00

Convert the pivotroot parse tests to use common AAParseTest super class in common_test.py. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: Christian Boltz <apparmor@cboltz.de>
29 lines
996 B
Python
29 lines
996 B
Python
#! /usr/bin/env python
|
|
# ------------------------------------------------------------------
|
|
#
|
|
# Copyright (C) 2014 Canonical Ltd.
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
# License published by the Free Software Foundation.
|
|
#
|
|
# ------------------------------------------------------------------
|
|
|
|
import apparmor.aa as aa
|
|
import unittest
|
|
from common_test import AAParseTest, setup_regex_tests
|
|
|
|
class AAParsePivotRootTest(AAParseTest):
|
|
def setUp(self):
|
|
self.parse_function = aa.parse_pivot_root_rule
|
|
|
|
tests = [
|
|
('pivot_root,', 'pivot_root base keyword'),
|
|
('pivot_root /old,', 'pivot_root oldroot rule'),
|
|
('pivot_root /old /new,', 'pivot_root old and new root rule'),
|
|
('pivot_root /old /new -> /usr/bin/child,', 'pivot_root child rule'),
|
|
]
|
|
|
|
if __name__ == '__main__':
|
|
setup_regex_tests(AAParsePivotRootTest)
|
|
unittest.main(verbosity=2)
|