Commit graph

4 commits

Author SHA1 Message Date
Christian Boltz
bd09ea910b Backport the python3 compability changes from trunk r2052 to
the 2.8 branch.

Original commit message:
    committer: Jamie Strandboge <jamie@canonical.com>
    Initial port to python3 for utilities. Thanks to Dmitrijs Ledkovs
    Acked-By: Jamie Strandboge <jamie@canonical.com>

Most of trunk r2052 also applies to the 2.8 branch. The only difference
is the last section of changes in utils/vim/create-apparmor.vim.py

Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
Skimmed-by: Seth Arnold <seth.arnold@canonical.com>
2013-05-07 22:38:18 +02:00
Steve Beattie
98a1594e88 Subject: aa-decode test script
Merge from trunk commit 2077

Original message:
  Subject: aa-decode test script v3
  
  This patch adds a test script/driver for the aa-decode utility. The only
  change from the previous versions is to support overriding the location
  of the aa-decode to test via the APPARMOR_DECODE environment variable
  and documenting the utils/ tests in the top level README.
  
  The aa-decode test can be run directly from the commandline in the utils
  directory like so:
  
    test/test-aa-decode.py -v
  
  Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
  Acked-By: Christian Boltz <apparmor@cboltz.de>

Nominated-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: Christian Boltz <apparmor@cboltz.de>
2013-01-04 15:06:47 -08:00
Jamie Strandboge
d418a16703 mark easyprof and easyprof test scripts as executable 2012-05-09 11:05:07 -07:00
Jamie Strandboge
1db463f4de This patchset is broken into 4 parts:
* the application, library, documentation and installation script
* the initial templates and policy groups. This will undoubtedly need
  refinement as we get feedback from users. Initial policy is based on Ubuntu's
  Application Review Board (ARB) requirements[2].
* tests for the library
* Makefile integration

Templates are stored in /usr/share/apparmor/easyprof/templates and policy
groups in /usr/share/apparmor/easyprof/policygroups. This can be adjusted via
/etc/apparmor/easyprof.conf.

The aa-easyprof.pod has complete documentation on usage with some
additional information in utils/easyprof/README (mostly duplicated
here).

Testing can be performed in a number of ways:
$ cd utils ; make check # runs unit tests and pyflakes

Unit tests manually:
$ ./test/test-aa-easyprof.py

In source manual testing:
$ ./aa-easyprof --templates-dir=./easyprof/templates \
                --policy-groups-dir=./easyprof/policygroups \
                ... \
                /opt/foo/bin/foo

Post-install manual testing:
$ make DESTDIR=/tmp/test PERLDIR=/tmp/test/usr/share/perl5/Immunix install
$ cd /tmp/test
$ PYTHONPATH=/tmp/test/usr/local/.../dist-packages ./usr/bin/aa-easyprof \
    --templates-dir=/tmp/test/usr/share/apparmor/easyprof/templates \
    --policy-groups-dir=/tmp/test/usr/share/apparmor/easyprof/policygroups \
    /opt/bin/foo

(you may also adjust /tmp/test/etc/apparmor/easyprof.conf to avoid
specifying --templates-dir and --policy-groups-dir).

Committing this now based on conversation with John and Steve.

Acked-By: Jamie Strandboge <jamie@canonical.com>
2012-05-07 22:37:48 -07:00