Package: keyutils / 1.5.9-5

0014-Conditionalize-tests-based-on-kernel-version.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
From: Christian Kastner <debian@kvr.at>
Date: Thu, 29 May 2014 13:55:18 +0200
Subject: Conditionalize tests based on kernel version

Check the kernel version before running some tests to make sure that the
currently running kernel supports the features they require.

Forwarded: not-needed
Last-Update: 2015-04-29

---
 tests/keyctl/invalidate/bad-args/runtest.sh |  9 +++++++++
 tests/keyctl/invalidate/noargs/runtest.sh   |  9 +++++++++
 tests/keyctl/invalidate/valid/runtest.sh    |  9 +++++++++
 tests/keyctl/padd/useradd/runtest.sh        | 25 ++++++++++++++-----------
 4 files changed, 41 insertions(+), 11 deletions(-)

diff --git a/tests/keyctl/invalidate/bad-args/runtest.sh b/tests/keyctl/invalidate/bad-args/runtest.sh
index 72fc2c4..154c74c 100644
--- a/tests/keyctl/invalidate/bad-args/runtest.sh
+++ b/tests/keyctl/invalidate/bad-args/runtest.sh
@@ -7,6 +7,15 @@
 # ---- do the actual testing ----
 
 result=PASS
+
+if version_less_than `uname -r` 3.5
+then
+	echo "++++ SKIPPING TEST" >>$OUTPUTFILE
+	marker "SKIPPING DUE TO LACK OF KEY INVALIDATION"
+	toolbox_report_result $TEST PASS
+	exit 0
+fi
+
 echo "++++ BEGINNING TEST" >$OUTPUTFILE
 
 # check that a bad key ID fails correctly
diff --git a/tests/keyctl/invalidate/noargs/runtest.sh b/tests/keyctl/invalidate/noargs/runtest.sh
index 51cb045..d89795f 100644
--- a/tests/keyctl/invalidate/noargs/runtest.sh
+++ b/tests/keyctl/invalidate/noargs/runtest.sh
@@ -7,6 +7,15 @@
 # ---- do the actual testing ----
 
 result=PASS
+
+if version_less_than `uname -r` 3.5
+then
+	echo "++++ SKIPPING TEST" >>$OUTPUTFILE
+	marker "SKIPPING DUE TO LACK OF KEY INVALIDATION"
+	toolbox_report_result $TEST PASS
+	exit 0
+fi
+
 echo "++++ BEGINNING TEST" >$OUTPUTFILE
 
 # check that no arguments fails correctly
diff --git a/tests/keyctl/invalidate/valid/runtest.sh b/tests/keyctl/invalidate/valid/runtest.sh
index 6274164..58d79cd 100644
--- a/tests/keyctl/invalidate/valid/runtest.sh
+++ b/tests/keyctl/invalidate/valid/runtest.sh
@@ -7,6 +7,15 @@
 # ---- do the actual testing ----
 
 result=PASS
+
+if version_less_than `uname -r` 3.5
+then
+	echo "++++ SKIPPING TEST" >>$OUTPUTFILE
+	marker "SKIPPING DUE TO LACK OF KEY INVALIDATION"
+	toolbox_report_result $TEST PASS
+	exit 0
+fi
+
 echo "++++ BEGINNING TEST" >$OUTPUTFILE
 
 # create a keyring and attach it to the session keyring
diff --git a/tests/keyctl/padd/useradd/runtest.sh b/tests/keyctl/padd/useradd/runtest.sh
index 94c9609..4c675f5 100644
--- a/tests/keyctl/padd/useradd/runtest.sh
+++ b/tests/keyctl/padd/useradd/runtest.sh
@@ -57,17 +57,20 @@ then
 	md5sum_key $keyid
 	expect_payload payload "f128f774ede3fe931e7c6745c4292f40"
 
-	marker "ADD SMALL BIG KEY"
-	pcreate_key_by_size 128 big_key small @s
-	expect_keyid keyid
-	md5sum_key $keyid
-	expect_payload payload "f09f35a5637839458e462e6350ecbce4"
-
-	marker "ADD HUGE BIG KEY"
-	pcreate_key_by_size $((1024*1024-1)) big_key huge @s
-	expect_keyid keyid
-	md5sum_key $keyid
-	expect_payload payload "e57598cd670284cf7d09e16ed9d4b2ac"
+	if ! version_less_than `uname -r` 3.13
+	then
+		marker "ADD SMALL BIG KEY"
+		pcreate_key_by_size 128 big_key small @s
+		expect_keyid keyid
+		md5sum_key $keyid
+		expect_payload payload "f09f35a5637839458e462e6350ecbce4"
+
+		marker "ADD HUGE BIG KEY"
+		pcreate_key_by_size $((1024*1024-1)) big_key huge @s
+		expect_keyid keyid
+		md5sum_key $keyid
+		expect_payload payload "e57598cd670284cf7d09e16ed9d4b2ac"
+	fi
 fi
 
 marker "CLEAR KEYRING"
-- 
2.0.0.rc4