summaryrefslogtreecommitdiffstats
path: root/tests/t_change_uuid
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:25 +0000
commit464df1d5e5ab1322e2dd0a7796939fff1aeefa9a (patch)
tree6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /tests/t_change_uuid
parentInitial commit. (diff)
downloade2fsprogs-upstream.tar.xz
e2fsprogs-upstream.zip
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/t_change_uuid/expect7
-rwxr-xr-xtests/t_change_uuid/script34
-rw-r--r--tests/t_change_uuid_mcsum/expect7
-rwxr-xr-xtests/t_change_uuid_mcsum/script34
-rw-r--r--tests/t_change_uuid_mcsum_mounted/expect7
-rwxr-xr-xtests/t_change_uuid_mcsum_mounted/script34
-rw-r--r--tests/t_change_uuid_mcsum_seed_mounted/expect21
-rwxr-xr-xtests/t_change_uuid_mcsum_seed_mounted/script52
-rw-r--r--tests/t_change_uuid_mounted/expect7
-rwxr-xr-xtests/t_change_uuid_mounted/script34
10 files changed, 237 insertions, 0 deletions
diff --git a/tests/t_change_uuid/expect b/tests/t_change_uuid/expect
new file mode 100644
index 0000000..0a9b20e
--- /dev/null
+++ b/tests/t_change_uuid/expect
@@ -0,0 +1,7 @@
+create fs without metadata_csum
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+change UUID
+Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731
+check filesystem
+fsck returns 0
+Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731
diff --git a/tests/t_change_uuid/script b/tests/t_change_uuid/script
new file mode 100755
index 0000000..d568f46
--- /dev/null
+++ b/tests/t_change_uuid/script
@@ -0,0 +1,34 @@
+test_description="change uuid on a pre-metadata-csum"
+
+trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+OUT=$test_name.log
+EXP=$test_dir/expect
+rm -f $OUT
+
+# Test command line option
+echo "create fs without metadata_csum" >> $OUT
+$MKE2FS -O ^metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "change UUID" >> $OUT
+$TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "check filesystem" >> $OUT
+$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
+echo "fsck returns $?" >> $OUT
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+ rm -f $test_name.tmp
+fi
+
diff --git a/tests/t_change_uuid_mcsum/expect b/tests/t_change_uuid_mcsum/expect
new file mode 100644
index 0000000..fb26e72
--- /dev/null
+++ b/tests/t_change_uuid_mcsum/expect
@@ -0,0 +1,7 @@
+create fs with metadata_csum
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+change UUID
+Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731
+check filesystem
+fsck returns 0
+Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731
diff --git a/tests/t_change_uuid_mcsum/script b/tests/t_change_uuid_mcsum/script
new file mode 100755
index 0000000..4ec5776
--- /dev/null
+++ b/tests/t_change_uuid_mcsum/script
@@ -0,0 +1,34 @@
+test_description="change uuid on a metadata-csum"
+
+trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+OUT=$test_name.log
+EXP=$test_dir/expect
+rm -f $OUT
+
+# Test command line option
+echo "create fs with metadata_csum" >> $OUT
+$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "change UUID" >> $OUT
+$TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "check filesystem" >> $OUT
+$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
+echo "fsck returns $?" >> $OUT
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+ rm -f $test_name.tmp
+fi
+
diff --git a/tests/t_change_uuid_mcsum_mounted/expect b/tests/t_change_uuid_mcsum_mounted/expect
new file mode 100644
index 0000000..e10e9a9
--- /dev/null
+++ b/tests/t_change_uuid_mcsum_mounted/expect
@@ -0,0 +1,7 @@
+create fs with metadata_csum
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+change UUID
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+check filesystem
+fsck returns 0
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
diff --git a/tests/t_change_uuid_mcsum_mounted/script b/tests/t_change_uuid_mcsum_mounted/script
new file mode 100755
index 0000000..f94bfbb
--- /dev/null
+++ b/tests/t_change_uuid_mcsum_mounted/script
@@ -0,0 +1,34 @@
+test_description="change uuid on a metadata-csum"
+
+trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+OUT=$test_name.log
+EXP=$test_dir/expect
+rm -f $OUT
+
+# Test command line option
+echo "create fs with metadata_csum" >> $OUT
+$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "change UUID" >> $OUT
+EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "check filesystem" >> $OUT
+$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
+echo "fsck returns $?" >> $OUT
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+ rm -f $test_name.tmp
+fi
+
diff --git a/tests/t_change_uuid_mcsum_seed_mounted/expect b/tests/t_change_uuid_mcsum_seed_mounted/expect
new file mode 100644
index 0000000..b2d2d91
--- /dev/null
+++ b/tests/t_change_uuid_mcsum_seed_mounted/expect
@@ -0,0 +1,21 @@
+create fs with metadata_csum
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+change UUID
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+check filesystem
+fsck returns 0
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+turn on csum seed
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+Checksum seed: 0x3ba62721
+check filesystem
+fsck returns 0
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+Checksum seed: 0x3ba62721
+change UUID
+Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731
+Checksum seed: 0x3ba62721
+check filesystem
+fsck returns 0
+Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731
+Checksum seed: 0x3ba62721
diff --git a/tests/t_change_uuid_mcsum_seed_mounted/script b/tests/t_change_uuid_mcsum_seed_mounted/script
new file mode 100755
index 0000000..19fdbed
--- /dev/null
+++ b/tests/t_change_uuid_mcsum_seed_mounted/script
@@ -0,0 +1,52 @@
+test_description="change meta-csum uuid with mcsum-seed"
+
+trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+OUT=$test_name.log
+EXP=$test_dir/expect
+rm -f $OUT
+
+# Test command line option
+echo "create fs with metadata_csum" >> $OUT
+$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "change UUID" >> $OUT
+EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "check filesystem" >> $OUT
+$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
+echo "fsck returns $?" >> $OUT
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "turn on csum seed" >> $OUT
+EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -O metadata_csuM_seed $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "check filesystem" >> $OUT
+$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
+echo "fsck returns $?" >> $OUT
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "change UUID" >> $OUT
+EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "check filesystem" >> $OUT
+$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
+echo "fsck returns $?" >> $OUT
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+ rm -f $test_name.tmp
+fi
+
diff --git a/tests/t_change_uuid_mounted/expect b/tests/t_change_uuid_mounted/expect
new file mode 100644
index 0000000..0a9b20e
--- /dev/null
+++ b/tests/t_change_uuid_mounted/expect
@@ -0,0 +1,7 @@
+create fs without metadata_csum
+Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c
+change UUID
+Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731
+check filesystem
+fsck returns 0
+Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731
diff --git a/tests/t_change_uuid_mounted/script b/tests/t_change_uuid_mounted/script
new file mode 100755
index 0000000..150f451
--- /dev/null
+++ b/tests/t_change_uuid_mounted/script
@@ -0,0 +1,34 @@
+test_description="change uuid on a mounted pre-metadata-csum"
+
+trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+OUT=$test_name.log
+EXP=$test_dir/expect
+rm -f $OUT
+
+# Test command line option
+echo "create fs without metadata_csum" >> $OUT
+$MKE2FS -O ^metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "change UUID" >> $OUT
+EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+echo "check filesystem" >> $OUT
+$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
+echo "fsck returns $?" >> $OUT
+$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
+
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+ rm -f $test_name.tmp
+fi
+