diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-03-13 06:39:02 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-03-13 06:39:07 -0400 |
commit | f7dce82d532e911c41933776426785373fe13967 (patch) | |
tree | 4c603d8f582912994ae2542cdeb33e1f2d76db90 /tools | |
parent | d2348fb6fdc6d671ad45b62db237f76c8c115603 (diff) | |
parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) |
Merge commit 'v3.9-rc2' into timers/core
Fold in upstream fixes.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/efivarfs/efivarfs.sh | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index 880cdd5dc63f..77edcdcc016b 100644 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh | |||
@@ -125,6 +125,63 @@ test_open_unlink() | |||
125 | ./open-unlink $file | 125 | ./open-unlink $file |
126 | } | 126 | } |
127 | 127 | ||
128 | # test that we can create a range of filenames | ||
129 | test_valid_filenames() | ||
130 | { | ||
131 | local attrs='\x07\x00\x00\x00' | ||
132 | local ret=0 | ||
133 | |||
134 | local file_list="abc dump-type0-11-1-1362436005 1234 -" | ||
135 | for f in $file_list; do | ||
136 | local file=$efivarfs_mount/$f-$test_guid | ||
137 | |||
138 | printf "$attrs\x00" > $file | ||
139 | |||
140 | if [ ! -e $file ]; then | ||
141 | echo "$file could not be created" >&2 | ||
142 | ret=1 | ||
143 | else | ||
144 | rm $file | ||
145 | fi | ||
146 | done | ||
147 | |||
148 | exit $ret | ||
149 | } | ||
150 | |||
151 | test_invalid_filenames() | ||
152 | { | ||
153 | local attrs='\x07\x00\x00\x00' | ||
154 | local ret=0 | ||
155 | |||
156 | local file_list=" | ||
157 | -1234-1234-1234-123456789abc | ||
158 | foo | ||
159 | foo-bar | ||
160 | -foo- | ||
161 | foo-barbazba-foob-foob-foob-foobarbazfoo | ||
162 | foo------------------------------------- | ||
163 | -12345678-1234-1234-1234-123456789abc | ||
164 | a-12345678=1234-1234-1234-123456789abc | ||
165 | a-12345678-1234=1234-1234-123456789abc | ||
166 | a-12345678-1234-1234=1234-123456789abc | ||
167 | a-12345678-1234-1234-1234=123456789abc | ||
168 | 1112345678-1234-1234-1234-123456789abc" | ||
169 | |||
170 | for f in $file_list; do | ||
171 | local file=$efivarfs_mount/$f | ||
172 | |||
173 | printf "$attrs\x00" 2>/dev/null > $file | ||
174 | |||
175 | if [ -e $file ]; then | ||
176 | echo "Creating $file should have failed" >&2 | ||
177 | rm $file | ||
178 | ret=1 | ||
179 | fi | ||
180 | done | ||
181 | |||
182 | exit $ret | ||
183 | } | ||
184 | |||
128 | check_prereqs | 185 | check_prereqs |
129 | 186 | ||
130 | rc=0 | 187 | rc=0 |
@@ -135,5 +192,7 @@ run_test test_create_read | |||
135 | run_test test_delete | 192 | run_test test_delete |
136 | run_test test_zero_size_delete | 193 | run_test test_zero_size_delete |
137 | run_test test_open_unlink | 194 | run_test test_open_unlink |
195 | run_test test_valid_filenames | ||
196 | run_test test_invalid_filenames | ||
138 | 197 | ||
139 | exit $rc | 198 | exit $rc |