Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/sbin/gpt Make the test work
details: https://anonhg.NetBSD.org/src/rev/3226dce92602
branches: trunk
changeset: 342054:3226dce92602
user: christos <christos%NetBSD.org@localhost>
date: Fri Dec 04 01:42:47 2015 +0000
description:
Make the test work
diffstat:
tests/sbin/gpt/Makefile | 4 ++--
tests/sbin/gpt/gpt.2part.show.uuid | 8 ++++++++
tests/sbin/gpt/t_gpt.sh | 17 +++++++++--------
3 files changed, 19 insertions(+), 10 deletions(-)
diffs (82 lines):
diff -r 6fe6a055678f -r 3226dce92602 tests/sbin/gpt/Makefile
--- a/tests/sbin/gpt/Makefile Fri Dec 04 01:21:12 2015 +0000
+++ b/tests/sbin/gpt/Makefile Fri Dec 04 01:42:47 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2015/12/04 01:21:12 christos Exp $
+# $NetBSD: Makefile,v 1.3 2015/12/04 01:42:47 christos Exp $
.include <bsd.own.mk>
@@ -7,7 +7,7 @@
TESTS_SH= t_gpt
FILESDIR= ${TESTSDIR}
-FILES= gpt.2disk.show.guid gpt.2part.show.normal gpt.empty.show.normal
+FILES= gpt.2part.show.uuid gpt.2part.show.normal gpt.empty.show.normal
FILES+= gpt.backup
.include <bsd.test.mk>
diff -r 6fe6a055678f -r 3226dce92602 tests/sbin/gpt/gpt.2part.show.uuid
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/sbin/gpt/gpt.2part.show.uuid Fri Dec 04 01:42:47 2015 +0000
@@ -0,0 +1,8 @@
+ start size index contents
+ 0 1 PMBR
+ 1 1 Pri GPT header
+ 2 32 Pri GPT table
+ 34 1024 1 GPT part - c12a7328-f81f-11d2-ba4b-00a0c93ec93b
+ 1058 9150 2 GPT part - 49f48d5a-b10e-11dc-b99b-0019d1879648
+ 10208 32 Sec GPT table
+ 10240 1 Sec GPT header
diff -r 6fe6a055678f -r 3226dce92602 tests/sbin/gpt/t_gpt.sh
--- a/tests/sbin/gpt/t_gpt.sh Fri Dec 04 01:21:12 2015 +0000
+++ b/tests/sbin/gpt/t_gpt.sh Fri Dec 04 01:42:47 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_gpt.sh,v 1.3 2015/12/04 01:21:12 christos Exp $
+# $NetBSD: t_gpt.sh,v 1.4 2015/12/04 01:42:47 christos Exp $
#
# Copyright (c) 2015 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -33,6 +33,7 @@
disk=gpt.disk
uuid="........-....-....-....-............"
zero="00000000-0000-0000-0000-000000000000"
+src=$(atf_get_srcdir)
prepare() {
rm -f $disk
@@ -50,10 +51,10 @@
# Calling this from tests does not work. BUG!
check_2part() {
-# atf_check -s exit:0 -o file:gpt.2part.show.normal \
-# -e empty gpt show $disk
-# atf_check -s exit:0 -o file:gpt.2part.show.guid \
-# -e empty gpt show -g $disk
+ atf_check -s exit:0 -o file:"$src/gpt.2part.show.normal" \
+ -e empty gpt show $disk
+ atf_check -s exit:0 -o file:"$src/gpt.2part.show.uuid" \
+ -e empty gpt show -u $disk
}
partmsg() {
@@ -72,7 +73,7 @@
create_empty_body() {
prepare
atf_check -s exit:0 -o empty -e empty gpt create $disk
- atf_check -s exit:0 -o file:gpt.empty.show.normal \
+ atf_check -s exit:0 -o file:"$src/gpt.empty.show.normal" \
-e empty gpt show $disk
}
@@ -94,8 +95,8 @@
backup_2part_body() {
prepare_2part
atf_check -s exit:0 -o save:test.backup -e empty gpt backup $disk
- atf_check -s exit:0 -o file:gpt.backup -e empty \
- sed -e "s/$uuid/$zero/g" test.backup
+ atf_check -s exit:0 -o file:"$src/gpt.backup" -e empty \
+ sed -e "s/$uuid/$zero/g" "test.backup"
}
atf_test_case restore_2part
Home |
Main Index |
Thread Index |
Old Index