Module Name: src Committed By: christos Date: Fri Dec 4 01:42:47 UTC 2015
Modified Files: src/tests/sbin/gpt: Makefile t_gpt.sh Added Files: src/tests/sbin/gpt: gpt.2part.show.uuid Log Message: Make the test work To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/gpt/Makefile cvs rdiff -u -r0 -r1.1 src/tests/sbin/gpt/gpt.2part.show.uuid cvs rdiff -u -r1.3 -r1.4 src/tests/sbin/gpt/t_gpt.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/sbin/gpt/Makefile diff -u src/tests/sbin/gpt/Makefile:1.2 src/tests/sbin/gpt/Makefile:1.3 --- src/tests/sbin/gpt/Makefile:1.2 Thu Dec 3 20:21:12 2015 +++ src/tests/sbin/gpt/Makefile Thu Dec 3 20:42:47 2015 @@ -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 @@ TESTSDIR= ${TESTSBASE}/sbin/gpt 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> Index: src/tests/sbin/gpt/t_gpt.sh diff -u src/tests/sbin/gpt/t_gpt.sh:1.3 src/tests/sbin/gpt/t_gpt.sh:1.4 --- src/tests/sbin/gpt/t_gpt.sh:1.3 Thu Dec 3 20:21:12 2015 +++ src/tests/sbin/gpt/t_gpt.sh Thu Dec 3 20:42:47 2015 @@ -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 @@ shdr=34 disk=gpt.disk uuid="........-....-....-....-............" zero="00000000-0000-0000-0000-000000000000" +src=$(atf_get_srcdir) prepare() { rm -f $disk @@ -50,10 +51,10 @@ prepare_2part() { # 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_head() { 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_head() { 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 Added files: Index: src/tests/sbin/gpt/gpt.2part.show.uuid diff -u /dev/null src/tests/sbin/gpt/gpt.2part.show.uuid:1.1 --- /dev/null Thu Dec 3 20:42:47 2015 +++ src/tests/sbin/gpt/gpt.2part.show.uuid Thu Dec 3 20:42:47 2015 @@ -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