~ubuntu-branches/ubuntu/vivid/apparmor-easyprof-ubuntu/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/tests/installed_templates

  • Committer: Package Import Robot
  • Author(s): Jamie Strandboge
  • Date: 2014-10-29 07:52:45 UTC
  • Revision ID: package-import@ubuntu.com-20141029075245-nm993mltnacssq52
Tags: 1.3.0
* debian/control:
  - add Vcs-Bzr and Vcs-Browser now that we have them
  - adjust Standards-Version
* add debian/make-new-version.sh and document how to use it
* create policy version 1.3
* adjust autopkgtests:
  - add tests for policy version 1.3
  - fix lintian warnings in naming of the tests
* debian/apparmor-easyprof-ubuntu.postinst: add #DEBHELPER# token

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# Author: Jamie Strandboge <jamie@ubuntu.com>
3
 
# Copyright (C) 2014 Canonical Ltd.
4
 
#
5
 
# This script is distributed under the terms and conditions of the GNU General
6
 
# Public License, Version 3 or later. See http://www.gnu.org/copyleft/gpl.html
7
 
# for details.
8
 
set -e
9
 
 
10
 
# Note, we don't need to run apparmor_parser because aa-easyprof will do that
11
 
# for us if apparmor_parser is found
12
 
 
13
 
rc="0"
14
 
 
15
 
expected_templates_10="default ubuntu-sdk ubuntu-webapp unconfined"
16
 
expected_templates_11="$expected_templates_10" # no new templates over 1.0
17
 
# ubuntu-scope-local-content is no longer shipped
18
 
#expected_templates_12="default ubuntu-scope-network ubuntu-scope-local-content ubuntu-sdk ubuntu-webapp unconfined"
19
 
expected_templates_12="default ubuntu-push-helper ubuntu-scope-network ubuntu-sdk ubuntu-webapp unconfined"
20
 
 
21
 
for v in 1.0 1.1 1.2 ; do
22
 
    expected_templates="$expected_templates_10"
23
 
    if [ "$v" = "1.1" ]; then
24
 
        expected_templates="$expected_templates_11"
25
 
    elif [ "$v" = "1.2" ]; then
26
 
        expected_templates="$expected_templates_12"
27
 
    fi
28
 
    tmp=`aa-easyprof --list-templates --policy-vendor=ubuntu --policy-version=$v`
29
 
    for p in $expected_templates ; do
30
 
        found=""
31
 
        for i in $tmp ; do
32
 
            if [ "$p" = "$i" ]; then
33
 
                found="yes"
34
 
                continue
35
 
            fi
36
 
        done
37
 
        if [ -z "$found" ]; then
38
 
            echo "Could not find '$p'" >&2
39
 
            rc="1"
40
 
        fi
41
 
    done
42
 
 
43
 
    unexpected=""
44
 
    for p in $tmp ; do
45
 
        found=""
46
 
        for i in $expected_templates ; do
47
 
            if [ "$p" = "$i" ]; then
48
 
                found="yes"
49
 
                continue
50
 
            fi
51
 
        done
52
 
        if [ -z "$found" ]; then
53
 
            echo "Found unexpected '$p'" >&2
54
 
            rc="1"
55
 
        fi
56
 
    done
57
 
done
58
 
 
59
 
if [ "$rc" = "0" ]; then
60
 
    echo "PASS"
61
 
else
62
 
    echo "FAIL"
63
 
fi
64
 
exit "$rc"