~ecryptfs/ecryptfs/trunk

« back to all changes in this revision

Viewing changes to tests/kernel/read-dir.sh

  • Committer: Dustin Kirkland
  • Date: 2016-02-27 00:00:23 UTC
  • Revision ID: kirkland@ubuntu.com-20160227000023-h0e4oui5y1vbaurd
openingĀ 112

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# read-dir: check we cannot read an ecryptfs directory
 
4
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/719691
 
5
#
 
6
# Author: Colin King <colin.king@canonical.com>
 
7
#
 
8
# Copyright (C) 2012 Canonical, Ltd.
 
9
#
 
10
# This program is free software; you can redistribute it and/or
 
11
# modify it under the terms of the GNU General Public License
 
12
# as published by the Free Software Foundation; either version 2
 
13
# of the License, or (at your option) any later version.
 
14
#
 
15
# This program is distributed in the hope that it will be useful,
 
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
# GNU General Public License for more details.
 
19
#
 
20
# You should have received a copy of the GNU General Public License
 
21
# along with this program; if not, write to the Free Software
 
22
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 
23
 
 
24
test_script_dir=$(dirname $0)
 
25
rc=1
 
26
test_dir=""
 
27
 
 
28
. ${test_script_dir}/../lib/etl_funcs.sh
 
29
 
 
30
test_cleanup()
 
31
{
 
32
        etl_remove_test_dir $test_dir
 
33
        etl_umount
 
34
        etl_lumount
 
35
        etl_unlink_keys
 
36
        exit $rc
 
37
}
 
38
trap test_cleanup 0 1 2 3 15
 
39
 
 
40
etl_add_keys || exit
 
41
etl_lmount || exit
 
42
etl_mount_i || exit
 
43
test_dir=$(etl_create_test_dir) || exit
 
44
 
 
45
${test_script_dir}/read-dir/test ${test_dir}
 
46
 
 
47
rc=$?
 
48
exit