Ticket #5307: parted-3.2-t0251-gpt-unicode.sh

File parted-3.2-t0251-gpt-unicode.sh, 1.3 KB (added by Fernando de Oliveira, 11 years ago)

Test with problem failing "Error during translation: Invalid or incomplete multibyte or wide character"

Line 
1#!/bin/sh
2# Test unicode partition names
3# Copyright (C) 2013-2014 Free Software Foundation, Inc.
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18. "${srcdir=.}/init.sh"; path_prepend_ ../parted
19
20dev=loop-file
21
22# create zeroed device
23truncate -s 10m $dev || fail=1
24
25export LC_ALL=C.UTF-8
26# create gpt label with named partition
27part_name=$(printf 'foo\341\264\244')
28parted -s $dev mklabel gpt mkpart primary ext2 1MiB 2MiB name 1 $part_name > empty 2>&1 || fail=1
29
30# ensure there was no output
31compare /dev/null empty || fail=1
32
33# check for expected output
34dd if=$dev bs=1 skip=$(($sector_size_+$sector_size_+56)) count=10 2>/dev/null | od -An -tx1 > out || fail=1
35echo ' 66 00 6f 00 6f 00 24 1d 00 00' >> exp
36compare exp out || fail=1
37
38Exit $fail