From 2896e592c6cf4cb2bbcacff206d14cb9ddb2d9c7 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 06:52:11 +0000 Subject: Convert `make regress` to `make check` `make check` is the shorter, and is more standard than `make regress` or `make test` --- Makefile | 4 ++-- share/mk/atf.test.mk | 2 +- share/mk/bsd.README | 12 ++++++------ share/mk/bsd.subdir.mk | 4 ++-- share/mk/bsd.sys.mk | 6 +++--- share/mk/bsd.test.mk | 10 +++++----- share/mk/suite.test.mk | 6 +++--- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 981e002..9d18ba4 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,7 @@ .else TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ - check-old check-old-dirs check-old-files check-old-libs \ + check check-old check-old-dirs check-old-files check-old-libs \ checkdpadd clean cleandepend cleandir cleanworld \ delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ @@ -121,7 +121,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries lint maninstall \ - obj objlink regress rerelease showconfig tags toolchain update \ + obj objlink rerelease showconfig tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _cross-tools _includes _libraries _depend \ build32 builddtb distribute32 install32 xdev xdev-build xdev-install \ diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk index 6f99d88..b9c94a7 100644 --- a/share/mk/atf.test.mk +++ b/share/mk/atf.test.mk @@ -25,7 +25,7 @@ ATF_TESTS_SH?= # Path to the prefix of the installed ATF tools, if any. # # If atf-run and atf-report are installed from ports, we automatically define a -# realregress target below to run the tests using these tools. The tools are +# realcheck target below to run the tests using these tools. The tools are # searched for in the hierarchy specified by this variable. ATF_PREFIX?= /usr/local diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 8e5d6bb..527de95 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -448,6 +448,12 @@ It has seven targets: all: build the test programs. + check: + runs the test programs from the object directory; if the + Makefile does not itself define the target test, the + targets beforecheck and aftercheck may also be used to + cause actions immediately before and after the test + target is executed. clean: remove the test programs and any object files. cleandir: @@ -464,12 +470,6 @@ It has seven targets: install target is executed. lint: run lint on the source files. - regress: - runs the test programs from the object directory; if the - Makefile does not itself define the target test, the - targets beforeregress and afterregress may also be used to - cause actions immediately before and after the test - target is executed. tags: create a tags file for the source files. diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index ec2585f..9fefdc2 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -36,10 +36,10 @@ .if !target(____) ____: -ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \ +ALL_SUBDIR_TARGETS= all all-man buildconfig check checkdpadd clean cleandepend \ cleandir cleanilinks cleanobj depend distribute \ installconfig lint maninstall manlint obj objlink \ - realinstall regress tags \ + realinstall tags \ ${SUBDIR_TARGETS} # Described above. diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index cad2b2f..e809829 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -172,11 +172,11 @@ CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} # or expect to ever be up-to-date. PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildconfig buildfiles \ - buildincludes checkdpadd clean cleandepend cleandir cleanobj \ - configure depend dependall distclean distribute exe \ + buildincludes check checkdpadd clean cleandepend cleandir \ + cleanobj configure depend dependall distclean distribute exe \ files html includes install installconfig installfiles \ installincludes lint obj objlink objs objwarn realall \ - realdepend realinstall regress subdir-all subdir-depend \ + realdepend realinstall subdir-all subdir-depend \ subdir-install tags whereobj # we don't want ${PROG} to be PHONY diff --git a/share/mk/bsd.test.mk b/share/mk/bsd.test.mk index 69ada89..8102e8a 100644 --- a/share/mk/bsd.test.mk +++ b/share/mk/bsd.test.mk @@ -76,14 +76,14 @@ PROGS_TARGETS+= install .include .endif -.if !target(realregress) -realregress: .PHONY +.if !target(realcheck) +realcheck: .PHONY @echo "$@ not defined; skipping" .endif -beforeregress realregress afterregress regress: .PHONY -.ORDER: beforeregress realregress afterregress -regress: beforeregress realregress afterregress +beforecheck realcheck aftercheck check: .PHONY +.ORDER: beforecheck realcheck aftercheck +check: beforecheck realcheck aftercheck .ifdef PROG # we came here via bsd.progs.mk below diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk index 0b244c8..9afce75 100644 --- a/share/mk/suite.test.mk +++ b/share/mk/suite.test.mk @@ -51,7 +51,7 @@ KYUAFILE?= auto # Path to the prefix of the installed Kyua CLI, if any. # -# If kyua is installed from ports, we automatically define a realregress target +# If kyua is installed from ports, we automatically define a realcheck target # below to run the tests using this tool. The tools are searched for in the # hierarchy specified by this variable. KYUA_PREFIX?= /usr/local @@ -96,9 +96,9 @@ _kyuafile= ${DESTDIR}${TESTSDIR}/Kyuafile KYUA?= ${KYUA_PREFIX}/bin/kyua -realregress: .PHONY +realcheck: .PHONY .if exists(${KYUA}) -# Definition of the "make regress" target and supporting variables. +# Definition of the "make check" target and supporting variables. # # This target, by necessity, can only work for native builds (i.e. a FreeBSD # host building a release for the same system). The target runs Kyua, which is -- cgit v1.1 From 5539ba0c476726fe20afa71776407356d9b9e241 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 07:03:00 +0000 Subject: MFhead @ r290922 --- sys/mips/atheros/apb.c | 2 + sys/vm/vm_page.h | 1 + sys/vm/vm_pageout.c | 110 +++++++++++++++++++++++++++++++++------- tools/regression/acct/Makefile | 22 -------- tools/regression/acct/pack.c | 108 --------------------------------------- tools/regression/acct/regress.t | 39 -------------- usr.sbin/ypserv/yp_access.c | 4 +- usr.sbin/ypserv/yp_dblookup.c | 4 +- usr.sbin/ypserv/yp_dnslookup.c | 2 +- 9 files changed, 101 insertions(+), 191 deletions(-) delete mode 100644 tools/regression/acct/Makefile delete mode 100644 tools/regression/acct/pack.c delete mode 100755 tools/regression/acct/regress.t diff --git a/sys/mips/atheros/apb.c b/sys/mips/atheros/apb.c index d05122a..2dc926f 100644 --- a/sys/mips/atheros/apb.c +++ b/sys/mips/atheros/apb.c @@ -364,6 +364,8 @@ apb_filter(void *arg) case AR71XX_SOC_AR9341: case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: + case AR71XX_SOC_QCA9533: + case AR71XX_SOC_QCA9533_V2: case AR71XX_SOC_QCA9556: case AR71XX_SOC_QCA9558: /* ACK/clear the given interrupt */ diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index a87f682..1fa61eb 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -227,6 +227,7 @@ struct vm_domain { long vmd_segs; /* bitmask of the segments */ boolean_t vmd_oom; int vmd_pass; /* local pagedaemon pass */ + int vmd_oom_seq; int vmd_last_active_scan; struct vm_page vmd_marker; /* marker for pagedaemon private use */ struct vm_page vmd_inacthead; /* marker for LRU-defeating insertions */ diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 6b061f8..9a3e465 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -122,7 +122,8 @@ static void vm_pageout_init(void); static int vm_pageout_clean(vm_page_t m); static int vm_pageout_cluster(vm_page_t m); static void vm_pageout_scan(struct vm_domain *vmd, int pass); -static void vm_pageout_mightbe_oom(struct vm_domain *vmd, int pass); +static void vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, + int starting_page_shortage); SYSINIT(pagedaemon_init, SI_SUB_KTHREAD_PAGE, SI_ORDER_FIRST, vm_pageout_init, NULL); @@ -158,6 +159,7 @@ SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp); int vm_pages_needed; /* Event on which pageout daemon sleeps */ int vm_pageout_deficit; /* Estimated number of pages deficit */ int vm_pageout_wakeup_thresh; +static int vm_pageout_oom_seq = 12; #if !defined(NO_SWAPPING) static int vm_pageout_req_swapout; /* XXX */ @@ -223,6 +225,10 @@ static int pageout_lock_miss; SYSCTL_INT(_vm, OID_AUTO, pageout_lock_miss, CTLFLAG_RD, &pageout_lock_miss, 0, "vget() lock misses during pageout"); +SYSCTL_INT(_vm, OID_AUTO, pageout_oom_seq, + CTLFLAG_RW, &vm_pageout_oom_seq, 0, + "back-to-back calls to oom detector to start OOM"); + #define VM_PAGEOUT_PAGE_COUNT 16 int vm_pageout_page_count = VM_PAGEOUT_PAGE_COUNT; @@ -1041,7 +1047,8 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) vm_object_t object; long min_scan; int act_delta, addl_page_shortage, deficit, error, maxlaunder, maxscan; - int page_shortage, scan_tick, scanned, vnodes_skipped; + int page_shortage, scan_tick, scanned, starting_page_shortage; + int vnodes_skipped; boolean_t pageout_ok, queues_locked; /* @@ -1080,6 +1087,7 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) page_shortage = vm_paging_target() + deficit; } else page_shortage = deficit = 0; + starting_page_shortage = page_shortage; /* * maxlaunder limits the number of dirty pages we flush per scan. @@ -1343,6 +1351,12 @@ relock_queues: (void)speedup_syncer(); /* + * If the inactive queue scan fails repeatedly to meet its + * target, kill the largest process. + */ + vm_pageout_mightbe_oom(vmd, page_shortage, starting_page_shortage); + + /* * Compute the number of pages we want to try to move from the * active queue to the inactive queue. */ @@ -1453,15 +1467,6 @@ relock_queues: } } #endif - - /* - * If we are critically low on one of RAM or swap and low on - * the other, kill the largest process. However, we avoid - * doing this on the first pass in order to give ourselves a - * chance to flush out dirty vnode-backed pages and to allow - * active pages to be moved to the inactive queue and reclaimed. - */ - vm_pageout_mightbe_oom(vmd, pass); } static int vm_pageout_oom_vote; @@ -1472,12 +1477,17 @@ static int vm_pageout_oom_vote; * failed to reach free target is premature. */ static void -vm_pageout_mightbe_oom(struct vm_domain *vmd, int pass) +vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, + int starting_page_shortage) { int old_vote; - if (pass <= 1 || !((swap_pager_avail < 64 && vm_page_count_min()) || - (swap_pager_full && vm_paging_target() > 0))) { + if (starting_page_shortage <= 0 || starting_page_shortage != + page_shortage) + vmd->vmd_oom_seq = 0; + else + vmd->vmd_oom_seq++; + if (vmd->vmd_oom_seq < vm_pageout_oom_seq) { if (vmd->vmd_oom) { vmd->vmd_oom = FALSE; atomic_subtract_int(&vm_pageout_oom_vote, 1); @@ -1485,6 +1495,12 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int pass) return; } + /* + * Do not follow the call sequence until OOM condition is + * cleared. + */ + vmd->vmd_oom_seq = 0; + if (vmd->vmd_oom) return; @@ -1510,6 +1526,65 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int pass) atomic_subtract_int(&vm_pageout_oom_vote, 1); } +/* + * The OOM killer is the page daemon's action of last resort when + * memory allocation requests have been stalled for a prolonged period + * of time because it cannot reclaim memory. This function computes + * the approximate number of physical pages that could be reclaimed if + * the specified address space is destroyed. + * + * Private, anonymous memory owned by the address space is the + * principal resource that we expect to recover after an OOM kill. + * Since the physical pages mapped by the address space's COW entries + * are typically shared pages, they are unlikely to be released and so + * they are not counted. + * + * To get to the point where the page daemon runs the OOM killer, its + * efforts to write-back vnode-backed pages may have stalled. This + * could be caused by a memory allocation deadlock in the write path + * that might be resolved by an OOM kill. Therefore, physical pages + * belonging to vnode-backed objects are counted, because they might + * be freed without being written out first if the address space holds + * the last reference to an unlinked vnode. + * + * Similarly, physical pages belonging to OBJT_PHYS objects are + * counted because the address space might hold the last reference to + * the object. + */ +static long +vm_pageout_oom_pagecount(struct vmspace *vmspace) +{ + vm_map_t map; + vm_map_entry_t entry; + vm_object_t obj; + long res; + + map = &vmspace->vm_map; + KASSERT(!map->system_map, ("system map")); + sx_assert(&map->lock, SA_LOCKED); + res = 0; + for (entry = map->header.next; entry != &map->header; + entry = entry->next) { + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) + continue; + obj = entry->object.vm_object; + if (obj == NULL) + continue; + if ((entry->eflags & MAP_ENTRY_NEEDS_COPY) != 0 && + obj->ref_count != 1) + continue; + switch (obj->type) { + case OBJT_DEFAULT: + case OBJT_SWAP: + case OBJT_PHYS: + case OBJT_VNODE: + res += obj->resident_page_count; + break; + } + } + return (res); +} + void vm_pageout_oom(int shortage) { @@ -1583,12 +1658,13 @@ vm_pageout_oom(int shortage) } PROC_UNLOCK(p); size = vmspace_swap_count(vm); - vm_map_unlock_read(&vm->vm_map); if (shortage == VM_OOM_MEM) - size += vmspace_resident_count(vm); + size += vm_pageout_oom_pagecount(vm); + vm_map_unlock_read(&vm->vm_map); vmspace_free(vm); + /* - * if the this process is bigger than the biggest one + * If this process is bigger than the biggest one, * remember it. */ if (size > bigsize) { diff --git a/tools/regression/acct/Makefile b/tools/regression/acct/Makefile deleted file mode 100644 index 581cc5f..0000000 --- a/tools/regression/acct/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# -# $FreeBSD$ -# -# "make" will compile the acct test programs -# - -PROG= pack -SRCS= pack.c -MAN= -CFLAGS+= -I${.OBJDIR} - -pack.o: convert.c - -CLEANFILES+= convert.c -convert.c: ../../../sys/kern/kern_acct.c - sed -n -e 's/log(/syslog(/g' \ - -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? >$@ - -regress: pack regress.t - ${.CURDIR}/regress.t - -.include diff --git a/tools/regression/acct/pack.c b/tools/regression/acct/pack.c deleted file mode 100644 index d1d3085..0000000 --- a/tools/regression/acct/pack.c +++ /dev/null @@ -1,108 +0,0 @@ -/*- - * Copyright (c) 2007 Diomidis Spinellis. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define KASSERT(val, msg) assert(val) - -typedef u_int32_t comp_t; - -#define AHZ 1000000 - -#include "convert.c" - -static int nerr; - -union cf { - comp_t c; - float f; -}; - -static void -check_result(const char *name, float expected, union cf v) -{ - double eps; - - eps = fabs(expected - v.f) / expected; - if (eps > FLT_EPSILON) { - printf("Error in %s\n", name); - printf("Got 0x%08x %12g\n", v.c, v.f); - v.f = expected; - printf("Expected 0x%08x %12g (%.15lg)\n", v.c, v.f, expected); - printf("Epsilon=%lg, rather than %g\n", eps, FLT_EPSILON); - nerr++; - } -} - -int -main(int argc, char *argv[]) -{ - union cf v; - long l; - int i, end; - struct timeval tv; - - if (argc == 2) { - /* Loop test */ - end = atoi(argv[1]); - for (i = 0; i < end; i++) { - tv.tv_sec = random(); - tv.tv_usec = (random() % 1000000); - v.c = encode_timeval(tv); - check_result("encode_timeval", - (float)tv.tv_sec * AHZ + tv.tv_usec, v); - l = random(); - v.c = encode_long(l); - check_result("encode_long", l, v); - } - } else if (argc == 3) { - /* Single-value timeval/long test */ - tv.tv_sec = atol(argv[1]); - tv.tv_usec = atol(argv[2]); - v.c = encode_timeval(tv); - check_result("encode_timeval", - (float)tv.tv_sec * AHZ + tv.tv_usec, v); - v.c = encode_long(tv.tv_sec); - check_result("encode_long", tv.tv_sec, v); - } else { - fprintf(stderr, "usage:\n%s repetitions\n%s sec usec\n", - argv[0], argv[0]); - return (1); - } - return (nerr); -} diff --git a/tools/regression/acct/regress.t b/tools/regression/acct/regress.t deleted file mode 100755 index 3f63c3a..0000000 --- a/tools/regression/acct/regress.t +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -if test -z "${DIR}" ; then - DIR=$( make -V .OBJDIR ) -fi -if test -z "${DIR}" ; then - DIR=$( dirname $0 ) -fi - -check() -{ - NUM=$1 - shift - if $DIR/pack $* - then - echo "ok $NUM" - else - echo "not ok $NUM" - fi -} - -(cd $DIR ; make pack) >/dev/null 2>&1 - -echo 1..7 - -check 1 0 0 -check 2 0 1 -check 3 1 0 -check 4 1 999999 -check 5 1 1000000 -check 6 2147483647 999999 -check 7 10000000 - -(cd $DIR ; make clean) >/dev/null 2>&1 - -exit 0 diff --git a/usr.sbin/ypserv/yp_access.c b/usr.sbin/ypserv/yp_access.c index a4ba504..dddde74 100644 --- a/usr.sbin/ypserv/yp_access.c +++ b/usr.sbin/ypserv/yp_access.c @@ -129,7 +129,7 @@ load_securenets(void) if ((fp = fopen(path, "r")) == NULL) { if (errno == ENOENT) { - securenets = (struct securenet *)malloc(sizeof(struct securenet)); + securenets = malloc(sizeof(struct securenet)); securenets->net.s_addr = INADDR_ANY; securenets->mask.s_addr = INADDR_ANY; securenets->next = NULL; @@ -154,7 +154,7 @@ load_securenets(void) continue; } - tmp = (struct securenet *)malloc(sizeof(struct securenet)); + tmp = malloc(sizeof(struct securenet)); if (!inet_aton((char *)&addr1, (struct in_addr *)&tmp->net)) { yp_error("badly formatted securenets entry: %s", addr1); diff --git a/usr.sbin/ypserv/yp_dblookup.c b/usr.sbin/ypserv/yp_dblookup.c index 6a3bf1c..ecd9052 100644 --- a/usr.sbin/ypserv/yp_dblookup.c +++ b/usr.sbin/ypserv/yp_dblookup.c @@ -103,13 +103,13 @@ yp_malloc_qent(void) { register struct circleq_entry *q; - q = (struct circleq_entry *)malloc(sizeof(struct circleq_entry)); + q = malloc(sizeof(struct circleq_entry)); if (q == NULL) { yp_error("failed to malloc() circleq entry"); return(NULL); } bzero((char *)q, sizeof(struct circleq_entry)); - q->dbptr = (struct dbent *)malloc(sizeof(struct dbent)); + q->dbptr = malloc(sizeof(struct dbent)); if (q->dbptr == NULL) { yp_error("failed to malloc() circleq entry"); free(q); diff --git a/usr.sbin/ypserv/yp_dnslookup.c b/usr.sbin/ypserv/yp_dnslookup.c index dfb5594..1d83b64 100644 --- a/usr.sbin/ypserv/yp_dnslookup.c +++ b/usr.sbin/ypserv/yp_dnslookup.c @@ -149,7 +149,7 @@ circleq_dnsentry *yp_malloc_dnsent(void) { register struct circleq_dnsentry *q; - q = (struct circleq_dnsentry *)malloc(sizeof(struct circleq_dnsentry)); + q = malloc(sizeof(struct circleq_dnsentry)); if (q == NULL) { yp_error("failed to malloc() circleq dns entry"); -- cgit v1.1 From 2a27bc575c82aa6bbac7094fb9cffd00aed7fe62 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 08:58:03 +0000 Subject: Integrate tools/regression/geom* into the FreeBSD test suite under sbin/geom/... XXX: test --- etc/mtree/BSD.tests.dist | 36 ++ sbin/geom/class/tests/Makefile | 18 + sbin/geom/class/tests/concat/1_test.sh | 30 ++ sbin/geom/class/tests/concat/2_test.sh | 35 ++ sbin/geom/class/tests/concat/conf.sh | 8 + sbin/geom/class/tests/eli/attach_d_test.sh | 38 ++ sbin/geom/class/tests/eli/configure_b_B_test.sh | 130 ++++++ sbin/geom/class/tests/eli/delkey_test.sh | 140 ++++++ sbin/geom/class/tests/eli/detach_l_test.sh | 44 ++ sbin/geom/class/tests/eli/init_B_test.sh | 106 +++++ sbin/geom/class/tests/eli/init_J_test.sh | 126 ++++++ sbin/geom/class/tests/eli/init_a_test.sh | 59 +++ sbin/geom/class/tests/eli/init_i_P_test.sh | 22 + sbin/geom/class/tests/eli/init_test.sh | 64 +++ sbin/geom/class/tests/eli/integrity_copy_test.sh | 98 +++++ sbin/geom/class/tests/eli/integrity_data_test.sh | 68 +++ sbin/geom/class/tests/eli/integrity_hmac_test.sh | 68 +++ sbin/geom/class/tests/eli/kill_test.sh | 97 ++++ sbin/geom/class/tests/eli/nokey_test.sh | 65 +++ sbin/geom/class/tests/eli/onetime_a_test.sh | 53 +++ sbin/geom/class/tests/eli/onetime_d_test.sh | 33 ++ sbin/geom/class/tests/eli/onetime_test.sh | 58 +++ sbin/geom/class/tests/eli/readonly_test.sh | 93 ++++ sbin/geom/class/tests/eli/resize_test.sh | 150 +++++++ sbin/geom/class/tests/eli/setkey_test.sh | 156 +++++++ sbin/geom/class/tests/gate/1_test.sh | 40 ++ sbin/geom/class/tests/gate/2_test.sh | 31 ++ sbin/geom/class/tests/gate/3_test.sh | 34 ++ sbin/geom/class/tests/gate/Makefile | 7 + sbin/geom/class/tests/geom_subr.sh | 14 + sbin/geom/class/tests/gpt/gctl.c | 166 +++++++ sbin/geom/class/tests/gpt/gctl_test.pl | 202 +++++++++ sbin/geom/class/tests/mirror/1_test.sh | 34 ++ sbin/geom/class/tests/mirror/2_test.sh | 59 +++ sbin/geom/class/tests/mirror/3_test.sh | 70 +++ sbin/geom/class/tests/mirror/4_test.sh | 70 +++ sbin/geom/class/tests/mirror/5_test.sh | 70 +++ sbin/geom/class/tests/mirror/6_test.sh | 52 +++ sbin/geom/class/tests/mirror/7_test.sh | 70 +++ sbin/geom/class/tests/mirror/conf.sh | 8 + sbin/geom/class/tests/nop/1_test.sh | 25 ++ sbin/geom/class/tests/nop/2_test.sh | 29 ++ sbin/geom/class/tests/nop/conf.sh | 7 + sbin/geom/class/tests/raid3/10_test.sh | 39 ++ sbin/geom/class/tests/raid3/11_test.sh | 39 ++ sbin/geom/class/tests/raid3/12_test.sh | 46 ++ sbin/geom/class/tests/raid3/1_test.sh | 37 ++ sbin/geom/class/tests/raid3/2_test.sh | 39 ++ sbin/geom/class/tests/raid3/3_test.sh | 43 ++ sbin/geom/class/tests/raid3/4_test.sh | 43 ++ sbin/geom/class/tests/raid3/5_test.sh | 43 ++ sbin/geom/class/tests/raid3/6_test.sh | 47 ++ sbin/geom/class/tests/raid3/7_test.sh | 50 +++ sbin/geom/class/tests/raid3/8_test.sh | 46 ++ sbin/geom/class/tests/raid3/9_test.sh | 49 +++ sbin/geom/class/tests/raid3/conf.sh | 8 + sbin/geom/class/tests/shsec/1_test.sh | 37 ++ sbin/geom/class/tests/shsec/2_test.sh | 59 +++ sbin/geom/class/tests/shsec/conf.sh | 8 + sbin/geom/class/tests/stripe/1_test.sh | 30 ++ sbin/geom/class/tests/stripe/2_test.sh | 35 ++ sbin/geom/class/tests/stripe/conf.sh | 8 + sbin/geom/class/tests/uzip/1.sh | 37 ++ sbin/geom/class/tests/uzip/2.sh | 18 + sbin/geom/class/tests/uzip/Makefile | 34 ++ sbin/geom/class/tests/uzip/etalon/etalon.txt | 43 ++ sbin/geom/core/tests/ConfCmp/ConfCmp.c | 379 ++++++++++++++++ sbin/geom/core/tests/ConfCmp/Makefile | 43 ++ sbin/geom/core/tests/ConfCmp/a1.conf | 414 ++++++++++++++++++ sbin/geom/core/tests/ConfCmp/a1a.conf | 414 ++++++++++++++++++ sbin/geom/core/tests/ConfCmp/a1b.conf | 414 ++++++++++++++++++ sbin/geom/core/tests/ConfCmp/a1c.conf | 414 ++++++++++++++++++ sbin/geom/core/tests/ConfCmp/a1d.conf | 414 ++++++++++++++++++ sbin/geom/core/tests/ConfCmp/a2.conf | 207 +++++++++ sbin/geom/core/tests/ConfCmp/a2a.conf | 207 +++++++++ sbin/geom/core/tests/ConfCmp/a2b.conf | 207 +++++++++ sbin/geom/core/tests/ConfCmp/a2c.conf | 206 +++++++++ sbin/geom/core/tests/ConfCmp/a2d.conf | 211 +++++++++ sbin/geom/core/tests/Data/disk.alpha.da0.xml | 33 ++ sbin/geom/core/tests/Data/disk.alpha2.da0.xml | 33 ++ sbin/geom/core/tests/Data/disk.apple.xml | 93 ++++ sbin/geom/core/tests/Data/disk.beast.da0.xml | 33 ++ sbin/geom/core/tests/Data/disk.critter.ad0.xml | 178 ++++++++ sbin/geom/core/tests/Data/disk.empty.flp.xml | 12 + sbin/geom/core/tests/Data/disk.far.ad0.xml | 51 +++ sbin/geom/core/tests/Data/disk.flat.da1.xml | 97 ++++ sbin/geom/core/tests/Data/disk.kern.flp.xml | 51 +++ sbin/geom/core/tests/Data/disk.msdos.ext.xml | 534 +++++++++++++++++++++++ sbin/geom/core/tests/Data/disk.msdos.flp.xml | 51 +++ sbin/geom/core/tests/Data/disk.pc98.wdc0.xml | 75 ++++ sbin/geom/core/tests/Data/disk.sun.da0.xml | 33 ++ sbin/geom/core/tests/Data/disk.sun.da1.xml | 33 ++ sbin/geom/core/tests/Data/disk.typo.ad0.xml | 219 ++++++++++ sbin/geom/core/tests/MdLoad/Makefile | 18 + sbin/geom/core/tests/MdLoad/MdLoad.c | 271 ++++++++++++ sbin/geom/core/tests/Ref/disk.alpha.da0.xml | 7 + sbin/geom/core/tests/Ref/disk.alpha2.da0.xml | 5 + sbin/geom/core/tests/Ref/disk.apple.xml | 5 + sbin/geom/core/tests/Ref/disk.beast.da0.xml | 5 + sbin/geom/core/tests/Ref/disk.critter.ad0.xml | 11 + sbin/geom/core/tests/Ref/disk.empty.flp.xml | 2 + sbin/geom/core/tests/Ref/disk.far.ad0.xml | 4 + sbin/geom/core/tests/Ref/disk.flat.da1.xml | 12 + sbin/geom/core/tests/Ref/disk.kern.flp.xml | 5 + sbin/geom/core/tests/Ref/disk.msdos.ext.xml | 27 ++ sbin/geom/core/tests/Ref/disk.msdos.flp.xml | 2 + sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml | 8 + sbin/geom/core/tests/Ref/disk.sun.da0.xml | 6 + sbin/geom/core/tests/Ref/disk.sun.da1.xml | 9 + sbin/geom/core/tests/Ref/disk.typo.ad0.xml | 14 + sbin/geom/core/tests/run_test.sh | 50 +++ tools/regression/geom/ConfCmp/ConfCmp.c | 377 ---------------- tools/regression/geom/ConfCmp/Makefile | 35 -- tools/regression/geom/ConfCmp/a1.conf | 414 ------------------ tools/regression/geom/ConfCmp/a1a.conf | 414 ------------------ tools/regression/geom/ConfCmp/a1b.conf | 414 ------------------ tools/regression/geom/ConfCmp/a1c.conf | 414 ------------------ tools/regression/geom/ConfCmp/a1d.conf | 414 ------------------ tools/regression/geom/ConfCmp/a2.conf | 207 --------- tools/regression/geom/ConfCmp/a2a.conf | 207 --------- tools/regression/geom/ConfCmp/a2b.conf | 207 --------- tools/regression/geom/ConfCmp/a2c.conf | 206 --------- tools/regression/geom/ConfCmp/a2d.conf | 211 --------- tools/regression/geom/Data/disk.alpha.da0.xml | 33 -- tools/regression/geom/Data/disk.alpha2.da0.xml | 33 -- tools/regression/geom/Data/disk.apple.xml | 93 ---- tools/regression/geom/Data/disk.beast.da0.xml | 33 -- tools/regression/geom/Data/disk.critter.ad0.xml | 178 -------- tools/regression/geom/Data/disk.empty.flp.xml | 12 - tools/regression/geom/Data/disk.far.ad0.xml | 51 --- tools/regression/geom/Data/disk.flat.da1.xml | 97 ---- tools/regression/geom/Data/disk.kern.flp.xml | 51 --- tools/regression/geom/Data/disk.msdos.ext.xml | 534 ----------------------- tools/regression/geom/Data/disk.msdos.flp.xml | 51 --- tools/regression/geom/Data/disk.pc98.wdc0.xml | 75 ---- tools/regression/geom/Data/disk.sun.da0.xml | 33 -- tools/regression/geom/Data/disk.sun.da1.xml | 33 -- tools/regression/geom/Data/disk.typo.ad0.xml | 219 ---------- tools/regression/geom/MdLoad/Makefile | 14 - tools/regression/geom/MdLoad/MdLoad.c | 271 ------------ tools/regression/geom/Ref/disk.alpha.da0.xml | 7 - tools/regression/geom/Ref/disk.alpha2.da0.xml | 5 - tools/regression/geom/Ref/disk.apple.xml | 5 - tools/regression/geom/Ref/disk.beast.da0.xml | 5 - tools/regression/geom/Ref/disk.critter.ad0.xml | 11 - tools/regression/geom/Ref/disk.empty.flp.xml | 2 - tools/regression/geom/Ref/disk.far.ad0.xml | 4 - tools/regression/geom/Ref/disk.flat.da1.xml | 12 - tools/regression/geom/Ref/disk.kern.flp.xml | 5 - tools/regression/geom/Ref/disk.msdos.ext.xml | 27 -- tools/regression/geom/Ref/disk.msdos.flp.xml | 2 - tools/regression/geom/Ref/disk.pc98.wdc0.xml | 8 - tools/regression/geom/Ref/disk.sun.da0.xml | 6 - tools/regression/geom/Ref/disk.sun.da1.xml | 9 - tools/regression/geom/Ref/disk.typo.ad0.xml | 14 - tools/regression/geom/RunTest.sh | 44 -- tools/regression/geom/RunTest.t | 50 --- tools/regression/geom_concat/conf.sh | 8 - tools/regression/geom_concat/test-1.t | 30 -- tools/regression/geom_concat/test-2.t | 35 -- tools/regression/geom_eli/attach-d.t | 38 -- tools/regression/geom_eli/configure-b-B.t | 130 ------ tools/regression/geom_eli/delkey.t | 140 ------ tools/regression/geom_eli/detach-l.t | 44 -- tools/regression/geom_eli/init-B.t | 106 ----- tools/regression/geom_eli/init-J.t | 126 ------ tools/regression/geom_eli/init-a.t | 59 --- tools/regression/geom_eli/init-i-P.t | 22 - tools/regression/geom_eli/init.t | 64 --- tools/regression/geom_eli/integrity-copy.t | 98 ----- tools/regression/geom_eli/integrity-data.t | 68 --- tools/regression/geom_eli/integrity-hmac.t | 68 --- tools/regression/geom_eli/kill.t | 97 ---- tools/regression/geom_eli/nokey.t | 65 --- tools/regression/geom_eli/onetime-a.t | 53 --- tools/regression/geom_eli/onetime-d.t | 33 -- tools/regression/geom_eli/onetime.t | 58 --- tools/regression/geom_eli/readonly.t | 93 ---- tools/regression/geom_eli/resize.t | 150 ------- tools/regression/geom_eli/setkey.t | 156 ------- tools/regression/geom_gate/Makefile | 8 - tools/regression/geom_gate/runtests.sh | 8 - tools/regression/geom_gate/test-1.sh | 36 -- tools/regression/geom_gate/test-1.t | 40 -- tools/regression/geom_gate/test-2.sh | 28 -- tools/regression/geom_gate/test-2.t | 31 -- tools/regression/geom_gate/test-3.sh | 31 -- tools/regression/geom_gate/test-3.t | 34 -- tools/regression/geom_gpt/gctl.t | 207 --------- tools/regression/geom_gpt/test.c | 165 ------- tools/regression/geom_mirror/conf.sh | 8 - tools/regression/geom_mirror/test-1.t | 34 -- tools/regression/geom_mirror/test-2.t | 59 --- tools/regression/geom_mirror/test-3.t | 70 --- tools/regression/geom_mirror/test-4.t | 70 --- tools/regression/geom_mirror/test-5.t | 70 --- tools/regression/geom_mirror/test-6.t | 52 --- tools/regression/geom_mirror/test-7.t | 70 --- tools/regression/geom_nop/conf.sh | 7 - tools/regression/geom_nop/test-1.t | 25 -- tools/regression/geom_nop/test-2.t | 29 -- tools/regression/geom_raid3/conf.sh | 8 - tools/regression/geom_raid3/test-1.t | 37 -- tools/regression/geom_raid3/test-10.t | 39 -- tools/regression/geom_raid3/test-11.t | 39 -- tools/regression/geom_raid3/test-12.t | 46 -- tools/regression/geom_raid3/test-2.t | 39 -- tools/regression/geom_raid3/test-3.t | 43 -- tools/regression/geom_raid3/test-4.t | 43 -- tools/regression/geom_raid3/test-5.t | 43 -- tools/regression/geom_raid3/test-6.t | 47 -- tools/regression/geom_raid3/test-7.t | 50 --- tools/regression/geom_raid3/test-8.t | 46 -- tools/regression/geom_raid3/test-9.t | 49 --- tools/regression/geom_shsec/conf.sh | 8 - tools/regression/geom_shsec/test-1.t | 37 -- tools/regression/geom_shsec/test-2.t | 59 --- tools/regression/geom_stripe/conf.sh | 8 - tools/regression/geom_stripe/test-1.t | 30 -- tools/regression/geom_stripe/test-2.t | 35 -- tools/regression/geom_subr.sh | 14 - tools/regression/geom_uzip/Makefile | 23 - tools/regression/geom_uzip/etalon/etalon.txt | 43 -- tools/regression/geom_uzip/runtests.sh | 10 - tools/regression/geom_uzip/test-1.img.uzip.uue | 110 ----- tools/regression/geom_uzip/test-1.sh | 36 -- tools/regression/geom_uzip/test-2.sh | 15 - 227 files changed, 9138 insertions(+), 9327 deletions(-) create mode 100644 sbin/geom/class/tests/Makefile create mode 100755 sbin/geom/class/tests/concat/1_test.sh create mode 100755 sbin/geom/class/tests/concat/2_test.sh create mode 100755 sbin/geom/class/tests/concat/conf.sh create mode 100755 sbin/geom/class/tests/eli/attach_d_test.sh create mode 100755 sbin/geom/class/tests/eli/configure_b_B_test.sh create mode 100755 sbin/geom/class/tests/eli/delkey_test.sh create mode 100755 sbin/geom/class/tests/eli/detach_l_test.sh create mode 100755 sbin/geom/class/tests/eli/init_B_test.sh create mode 100755 sbin/geom/class/tests/eli/init_J_test.sh create mode 100755 sbin/geom/class/tests/eli/init_a_test.sh create mode 100755 sbin/geom/class/tests/eli/init_i_P_test.sh create mode 100755 sbin/geom/class/tests/eli/init_test.sh create mode 100755 sbin/geom/class/tests/eli/integrity_copy_test.sh create mode 100755 sbin/geom/class/tests/eli/integrity_data_test.sh create mode 100755 sbin/geom/class/tests/eli/integrity_hmac_test.sh create mode 100755 sbin/geom/class/tests/eli/kill_test.sh create mode 100755 sbin/geom/class/tests/eli/nokey_test.sh create mode 100755 sbin/geom/class/tests/eli/onetime_a_test.sh create mode 100755 sbin/geom/class/tests/eli/onetime_d_test.sh create mode 100755 sbin/geom/class/tests/eli/onetime_test.sh create mode 100755 sbin/geom/class/tests/eli/readonly_test.sh create mode 100755 sbin/geom/class/tests/eli/resize_test.sh create mode 100755 sbin/geom/class/tests/eli/setkey_test.sh create mode 100755 sbin/geom/class/tests/gate/1_test.sh create mode 100755 sbin/geom/class/tests/gate/2_test.sh create mode 100755 sbin/geom/class/tests/gate/3_test.sh create mode 100644 sbin/geom/class/tests/gate/Makefile create mode 100644 sbin/geom/class/tests/geom_subr.sh create mode 100644 sbin/geom/class/tests/gpt/gctl.c create mode 100755 sbin/geom/class/tests/gpt/gctl_test.pl create mode 100755 sbin/geom/class/tests/mirror/1_test.sh create mode 100755 sbin/geom/class/tests/mirror/2_test.sh create mode 100755 sbin/geom/class/tests/mirror/3_test.sh create mode 100755 sbin/geom/class/tests/mirror/4_test.sh create mode 100755 sbin/geom/class/tests/mirror/5_test.sh create mode 100755 sbin/geom/class/tests/mirror/6_test.sh create mode 100755 sbin/geom/class/tests/mirror/7_test.sh create mode 100755 sbin/geom/class/tests/mirror/conf.sh create mode 100755 sbin/geom/class/tests/nop/1_test.sh create mode 100755 sbin/geom/class/tests/nop/2_test.sh create mode 100755 sbin/geom/class/tests/nop/conf.sh create mode 100755 sbin/geom/class/tests/raid3/10_test.sh create mode 100755 sbin/geom/class/tests/raid3/11_test.sh create mode 100755 sbin/geom/class/tests/raid3/12_test.sh create mode 100755 sbin/geom/class/tests/raid3/1_test.sh create mode 100755 sbin/geom/class/tests/raid3/2_test.sh create mode 100755 sbin/geom/class/tests/raid3/3_test.sh create mode 100755 sbin/geom/class/tests/raid3/4_test.sh create mode 100755 sbin/geom/class/tests/raid3/5_test.sh create mode 100755 sbin/geom/class/tests/raid3/6_test.sh create mode 100755 sbin/geom/class/tests/raid3/7_test.sh create mode 100755 sbin/geom/class/tests/raid3/8_test.sh create mode 100755 sbin/geom/class/tests/raid3/9_test.sh create mode 100755 sbin/geom/class/tests/raid3/conf.sh create mode 100755 sbin/geom/class/tests/shsec/1_test.sh create mode 100755 sbin/geom/class/tests/shsec/2_test.sh create mode 100755 sbin/geom/class/tests/shsec/conf.sh create mode 100755 sbin/geom/class/tests/stripe/1_test.sh create mode 100755 sbin/geom/class/tests/stripe/2_test.sh create mode 100755 sbin/geom/class/tests/stripe/conf.sh create mode 100755 sbin/geom/class/tests/uzip/1.sh create mode 100755 sbin/geom/class/tests/uzip/2.sh create mode 100644 sbin/geom/class/tests/uzip/Makefile create mode 100644 sbin/geom/class/tests/uzip/etalon/etalon.txt create mode 100644 sbin/geom/core/tests/ConfCmp/ConfCmp.c create mode 100644 sbin/geom/core/tests/ConfCmp/Makefile create mode 100644 sbin/geom/core/tests/ConfCmp/a1.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a1a.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a1b.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a1c.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a1d.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a2.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a2a.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a2b.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a2c.conf create mode 100644 sbin/geom/core/tests/ConfCmp/a2d.conf create mode 100644 sbin/geom/core/tests/Data/disk.alpha.da0.xml create mode 100644 sbin/geom/core/tests/Data/disk.alpha2.da0.xml create mode 100644 sbin/geom/core/tests/Data/disk.apple.xml create mode 100644 sbin/geom/core/tests/Data/disk.beast.da0.xml create mode 100644 sbin/geom/core/tests/Data/disk.critter.ad0.xml create mode 100644 sbin/geom/core/tests/Data/disk.empty.flp.xml create mode 100644 sbin/geom/core/tests/Data/disk.far.ad0.xml create mode 100644 sbin/geom/core/tests/Data/disk.flat.da1.xml create mode 100644 sbin/geom/core/tests/Data/disk.kern.flp.xml create mode 100644 sbin/geom/core/tests/Data/disk.msdos.ext.xml create mode 100644 sbin/geom/core/tests/Data/disk.msdos.flp.xml create mode 100644 sbin/geom/core/tests/Data/disk.pc98.wdc0.xml create mode 100644 sbin/geom/core/tests/Data/disk.sun.da0.xml create mode 100644 sbin/geom/core/tests/Data/disk.sun.da1.xml create mode 100644 sbin/geom/core/tests/Data/disk.typo.ad0.xml create mode 100644 sbin/geom/core/tests/MdLoad/Makefile create mode 100644 sbin/geom/core/tests/MdLoad/MdLoad.c create mode 100644 sbin/geom/core/tests/Ref/disk.alpha.da0.xml create mode 100644 sbin/geom/core/tests/Ref/disk.alpha2.da0.xml create mode 100644 sbin/geom/core/tests/Ref/disk.apple.xml create mode 100644 sbin/geom/core/tests/Ref/disk.beast.da0.xml create mode 100644 sbin/geom/core/tests/Ref/disk.critter.ad0.xml create mode 100644 sbin/geom/core/tests/Ref/disk.empty.flp.xml create mode 100644 sbin/geom/core/tests/Ref/disk.far.ad0.xml create mode 100644 sbin/geom/core/tests/Ref/disk.flat.da1.xml create mode 100644 sbin/geom/core/tests/Ref/disk.kern.flp.xml create mode 100644 sbin/geom/core/tests/Ref/disk.msdos.ext.xml create mode 100644 sbin/geom/core/tests/Ref/disk.msdos.flp.xml create mode 100644 sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml create mode 100644 sbin/geom/core/tests/Ref/disk.sun.da0.xml create mode 100644 sbin/geom/core/tests/Ref/disk.sun.da1.xml create mode 100644 sbin/geom/core/tests/Ref/disk.typo.ad0.xml create mode 100644 sbin/geom/core/tests/run_test.sh delete mode 100644 tools/regression/geom/ConfCmp/ConfCmp.c delete mode 100644 tools/regression/geom/ConfCmp/Makefile delete mode 100644 tools/regression/geom/ConfCmp/a1.conf delete mode 100644 tools/regression/geom/ConfCmp/a1a.conf delete mode 100644 tools/regression/geom/ConfCmp/a1b.conf delete mode 100644 tools/regression/geom/ConfCmp/a1c.conf delete mode 100644 tools/regression/geom/ConfCmp/a1d.conf delete mode 100644 tools/regression/geom/ConfCmp/a2.conf delete mode 100644 tools/regression/geom/ConfCmp/a2a.conf delete mode 100644 tools/regression/geom/ConfCmp/a2b.conf delete mode 100644 tools/regression/geom/ConfCmp/a2c.conf delete mode 100644 tools/regression/geom/ConfCmp/a2d.conf delete mode 100644 tools/regression/geom/Data/disk.alpha.da0.xml delete mode 100644 tools/regression/geom/Data/disk.alpha2.da0.xml delete mode 100644 tools/regression/geom/Data/disk.apple.xml delete mode 100644 tools/regression/geom/Data/disk.beast.da0.xml delete mode 100644 tools/regression/geom/Data/disk.critter.ad0.xml delete mode 100644 tools/regression/geom/Data/disk.empty.flp.xml delete mode 100644 tools/regression/geom/Data/disk.far.ad0.xml delete mode 100644 tools/regression/geom/Data/disk.flat.da1.xml delete mode 100644 tools/regression/geom/Data/disk.kern.flp.xml delete mode 100644 tools/regression/geom/Data/disk.msdos.ext.xml delete mode 100644 tools/regression/geom/Data/disk.msdos.flp.xml delete mode 100644 tools/regression/geom/Data/disk.pc98.wdc0.xml delete mode 100644 tools/regression/geom/Data/disk.sun.da0.xml delete mode 100644 tools/regression/geom/Data/disk.sun.da1.xml delete mode 100644 tools/regression/geom/Data/disk.typo.ad0.xml delete mode 100644 tools/regression/geom/MdLoad/Makefile delete mode 100644 tools/regression/geom/MdLoad/MdLoad.c delete mode 100644 tools/regression/geom/Ref/disk.alpha.da0.xml delete mode 100644 tools/regression/geom/Ref/disk.alpha2.da0.xml delete mode 100644 tools/regression/geom/Ref/disk.apple.xml delete mode 100644 tools/regression/geom/Ref/disk.beast.da0.xml delete mode 100644 tools/regression/geom/Ref/disk.critter.ad0.xml delete mode 100644 tools/regression/geom/Ref/disk.empty.flp.xml delete mode 100644 tools/regression/geom/Ref/disk.far.ad0.xml delete mode 100644 tools/regression/geom/Ref/disk.flat.da1.xml delete mode 100644 tools/regression/geom/Ref/disk.kern.flp.xml delete mode 100644 tools/regression/geom/Ref/disk.msdos.ext.xml delete mode 100644 tools/regression/geom/Ref/disk.msdos.flp.xml delete mode 100644 tools/regression/geom/Ref/disk.pc98.wdc0.xml delete mode 100644 tools/regression/geom/Ref/disk.sun.da0.xml delete mode 100644 tools/regression/geom/Ref/disk.sun.da1.xml delete mode 100644 tools/regression/geom/Ref/disk.typo.ad0.xml delete mode 100644 tools/regression/geom/RunTest.sh delete mode 100644 tools/regression/geom/RunTest.t delete mode 100644 tools/regression/geom_concat/conf.sh delete mode 100644 tools/regression/geom_concat/test-1.t delete mode 100644 tools/regression/geom_concat/test-2.t delete mode 100644 tools/regression/geom_eli/attach-d.t delete mode 100644 tools/regression/geom_eli/configure-b-B.t delete mode 100644 tools/regression/geom_eli/delkey.t delete mode 100644 tools/regression/geom_eli/detach-l.t delete mode 100644 tools/regression/geom_eli/init-B.t delete mode 100644 tools/regression/geom_eli/init-J.t delete mode 100644 tools/regression/geom_eli/init-a.t delete mode 100644 tools/regression/geom_eli/init-i-P.t delete mode 100644 tools/regression/geom_eli/init.t delete mode 100644 tools/regression/geom_eli/integrity-copy.t delete mode 100644 tools/regression/geom_eli/integrity-data.t delete mode 100644 tools/regression/geom_eli/integrity-hmac.t delete mode 100644 tools/regression/geom_eli/kill.t delete mode 100644 tools/regression/geom_eli/nokey.t delete mode 100644 tools/regression/geom_eli/onetime-a.t delete mode 100644 tools/regression/geom_eli/onetime-d.t delete mode 100644 tools/regression/geom_eli/onetime.t delete mode 100644 tools/regression/geom_eli/readonly.t delete mode 100644 tools/regression/geom_eli/resize.t delete mode 100644 tools/regression/geom_eli/setkey.t delete mode 100644 tools/regression/geom_gate/Makefile delete mode 100644 tools/regression/geom_gate/runtests.sh delete mode 100644 tools/regression/geom_gate/test-1.sh delete mode 100644 tools/regression/geom_gate/test-1.t delete mode 100644 tools/regression/geom_gate/test-2.sh delete mode 100644 tools/regression/geom_gate/test-2.t delete mode 100644 tools/regression/geom_gate/test-3.sh delete mode 100644 tools/regression/geom_gate/test-3.t delete mode 100644 tools/regression/geom_gpt/gctl.t delete mode 100644 tools/regression/geom_gpt/test.c delete mode 100644 tools/regression/geom_mirror/conf.sh delete mode 100644 tools/regression/geom_mirror/test-1.t delete mode 100644 tools/regression/geom_mirror/test-2.t delete mode 100644 tools/regression/geom_mirror/test-3.t delete mode 100644 tools/regression/geom_mirror/test-4.t delete mode 100644 tools/regression/geom_mirror/test-5.t delete mode 100644 tools/regression/geom_mirror/test-6.t delete mode 100644 tools/regression/geom_mirror/test-7.t delete mode 100644 tools/regression/geom_nop/conf.sh delete mode 100644 tools/regression/geom_nop/test-1.t delete mode 100644 tools/regression/geom_nop/test-2.t delete mode 100644 tools/regression/geom_raid3/conf.sh delete mode 100644 tools/regression/geom_raid3/test-1.t delete mode 100644 tools/regression/geom_raid3/test-10.t delete mode 100644 tools/regression/geom_raid3/test-11.t delete mode 100644 tools/regression/geom_raid3/test-12.t delete mode 100644 tools/regression/geom_raid3/test-2.t delete mode 100644 tools/regression/geom_raid3/test-3.t delete mode 100644 tools/regression/geom_raid3/test-4.t delete mode 100644 tools/regression/geom_raid3/test-5.t delete mode 100644 tools/regression/geom_raid3/test-6.t delete mode 100644 tools/regression/geom_raid3/test-7.t delete mode 100644 tools/regression/geom_raid3/test-8.t delete mode 100644 tools/regression/geom_raid3/test-9.t delete mode 100644 tools/regression/geom_shsec/conf.sh delete mode 100644 tools/regression/geom_shsec/test-1.t delete mode 100644 tools/regression/geom_shsec/test-2.t delete mode 100644 tools/regression/geom_stripe/conf.sh delete mode 100644 tools/regression/geom_stripe/test-1.t delete mode 100644 tools/regression/geom_stripe/test-2.t delete mode 100644 tools/regression/geom_subr.sh delete mode 100644 tools/regression/geom_uzip/Makefile delete mode 100644 tools/regression/geom_uzip/etalon/etalon.txt delete mode 100644 tools/regression/geom_uzip/runtests.sh delete mode 100644 tools/regression/geom_uzip/test-1.img.uzip.uue delete mode 100644 tools/regression/geom_uzip/test-1.sh delete mode 100644 tools/regression/geom_uzip/test-2.sh diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index ae20a55..3bfa30c 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -336,6 +336,42 @@ .. devd .. + geom + class + concat + .. + eli + .. + gate + .. + gpt + .. + mirror + .. + nop + .. + raid3 + .. + shsec + .. + stripe + .. + uzip + etalon + .. + .. + .. + core + ConfCmp + .. + Data + .. + MdLoad + .. + Ref + .. + .. + .. growfs .. ifconfig diff --git a/sbin/geom/class/tests/Makefile b/sbin/geom/class/tests/Makefile new file mode 100644 index 0000000..0be484c --- /dev/null +++ b/sbin/geom/class/tests/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +TESTS_SUBDIRS+= concat +TESTS_SUBDIRS+= eli +TESTS_SUBDIRS+= gate +TESTS_SUBDIRS+= gpt +TESTS_SUBDIRS+= mirror +TESTS_SUBDIRS+= nop +TESTS_SUBDIRS+= raid3 +TESTS_SUBDIRS+= shsec +TESTS_SUBDIRS+= stripe +TESTS_SUBDIRS+= uzip + +BINDIR= ${TESTSBASE}/sbin/geom/class + +FILES+= geom_subr.sh + +.include diff --git a/sbin/geom/class/tests/concat/1_test.sh b/sbin/geom/class/tests/concat/1_test.sh new file mode 100755 index 0000000..8984f79 --- /dev/null +++ b/sbin/geom/class/tests/concat/1_test.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo '1..1' + +us=45 + +mdconfig -a -t malloc -s 1M -u $us || exit 1 +mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 +mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 + +gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +devwait + +# Size of created device should be 1MB + 2MB + 3MB. + +size=`diskinfo /dev/concat/${name} | awk '{print $3}'` + +if [ $size -eq 6291456 ]; then + echo "ok - Size is 6291456" +else + echo "not ok - Size is 6291456" +fi + +gconcat destroy $name +mdconfig -d -u $us +mdconfig -d -u `expr $us + 1` +mdconfig -d -u `expr $us + 2` diff --git a/sbin/geom/class/tests/concat/2_test.sh b/sbin/geom/class/tests/concat/2_test.sh new file mode 100755 index 0000000..445d9bc --- /dev/null +++ b/sbin/geom/class/tests/concat/2_test.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo '1..1' + +us=45 +tsize=6 +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 + +mdconfig -a -t malloc -s 1M -u $us || exit 1 +mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 +mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 + +gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +devwait + +dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1 +dd if=/dev/concat/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 + +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok - md5 checksum comparison" +else + echo "ok - md5 checksum comparison" +fi + +gconcat destroy $name +mdconfig -d -u $us +mdconfig -d -u `expr $us + 1` +mdconfig -d -u `expr $us + 2` +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/concat/conf.sh b/sbin/geom/class/tests/concat/conf.sh new file mode 100755 index 0000000..0eaf1ba --- /dev/null +++ b/sbin/geom/class/tests/concat/conf.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# $FreeBSD$ + +name="test" +class="concat" +base=`basename $0` + +. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/eli/attach_d_test.sh b/sbin/geom/class/tests/eli/attach_d_test.sh new file mode 100755 index 0000000..d1a57ce --- /dev/null +++ b/sbin/geom/class/tests/eli/attach_d_test.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..3" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile md${no} +geli attach -d -p -k $keyfile md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 1" +else + echo "not ok 1" +fi +# Be sure it doesn't detach on read. +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ -c /dev/md${no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi +true > /dev/md${no}.eli +sleep 1 +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +mdconfig -d -u $no +rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/configure_b_B_test.sh b/sbin/geom/class/tests/eli/configure_b_B_test.sh new file mode 100755 index 0000000..23aa412 --- /dev/null +++ b/sbin/geom/class/tests/eli/configure_b_B_test.sh @@ -0,0 +1,130 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..17" + +geli init -B none -P -K /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +geli init -B none -b -P -K /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +geli configure -B md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi + +geli configure -b md${no} +if [ $? -eq 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +geli attach -p -k /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +geli configure -B md${no} +if [ $? -eq 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -ne 0 ]; then + echo "ok 12" +else + echo "not ok 12" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 13" +else + echo "not ok 13" +fi + +geli configure -b md${no} +if [ $? -eq 0 ]; then + echo "ok 14" +else + echo "not ok 14" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 15" +else + echo "not ok 15" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 16" +else + echo "not ok 16" +fi + +geli detach md${no} +if [ $? -eq 0 ]; then + echo "ok 17" +else + echo "not ok 17" +fi + +mdconfig -d -u $no diff --git a/sbin/geom/class/tests/eli/delkey_test.sh b/sbin/geom/class/tests/eli/delkey_test.sh new file mode 100755 index 0000000..ec839e6 --- /dev/null +++ b/sbin/geom/class/tests/eli/delkey_test.sh @@ -0,0 +1,140 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..14" + +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile1 md${no} +geli attach -p -k $keyfile1 md${no} +geli setkey -n 1 -P -K $keyfile2 md${no} + +# Remove key 0 for attached provider. +geli delkey -n 0 md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +geli detach md${no} + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +# Attach with key 1. +geli attach -p -k $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +# We cannot remove last key without -f option (for attached provider). +geli delkey -n 1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +# Remove last key for attached provider. +geli delkey -f -n 1 md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi + +# If there are no valid keys, but provider is attached, we can save situation. +geli setkey -n 0 -P -K $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi +geli detach md${no} + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +# Attach with key 0. +geli attach -p -k $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +# Setup key 1. +geli setkey -n 1 -P -K $keyfile4 md${no} +if [ $? -eq 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi +geli detach md${no} + +# Remove key 1 for detached provider. +geli delkey -n 1 md${no} +if [ $? -eq 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +# We cannot use keyfile4 anymore. +geli attach -p -k $keyfile4 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi + +# We cannot remove last key without -f option (for detached provider). +geli delkey -n 0 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 12" +else + echo "not ok 12" +fi + +# Remove last key for detached provider. +geli delkey -f -n 0 md${no} +if [ $? -eq 0 ]; then + echo "ok 13" +else + echo "not ok 13" +fi + +# We cannot use keyfile3 anymore. +geli attach -p -k $keyfile3 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 14" +else + echo "not ok 14" +fi + +mdconfig -d -u $no +rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 diff --git a/sbin/geom/class/tests/eli/detach_l_test.sh b/sbin/geom/class/tests/eli/detach_l_test.sh new file mode 100755 index 0000000..6645501 --- /dev/null +++ b/sbin/geom/class/tests/eli/detach_l_test.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..4" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile md${no} +geli attach -p -k $keyfile md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 1" +else + echo "not ok 1" +fi +# Be sure it doesn't detach before 'detach -l'. +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ -c /dev/md${no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi +geli detach -l md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 3" +else + echo "not ok 3" +fi +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +mdconfig -d -u $no +rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_B_test.sh b/sbin/geom/class/tests/eli/init_B_test.sh new file mode 100755 index 0000000..70036af --- /dev/null +++ b/sbin/geom/class/tests/eli/init_B_test.sh @@ -0,0 +1,106 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +backupfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..13" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +mdconfig -a -t malloc -s $sectors -u $no || exit 1 + +# -B none +rm -f /var/backups/md${no}.eli +geli init -B none -P -K $keyfile md${no} 2>/dev/null +if [ ! -f /var/backups/md${no}.eli ]; then + echo "ok 1 - -B none" +else + echo "not ok 1 - -B none" +fi + +# no -B +rm -f /var/backups/md${no}.eli +geli init -P -K $keyfile md${no} >/dev/null 2>&1 +if [ -f /var/backups/md${no}.eli ]; then + echo "ok 2 - no -B" +else + echo "not ok 2 - no -B" +fi +geli clear md${no} +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3 - no -B" +else + echo "not ok 3 - no -B" +fi +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 4 - no -B" +else + echo "not ok 4 - no -B" +fi +geli restore /var/backups/md${no}.eli md${no} +if [ $? -eq 0 ]; then + echo "ok 5 - no -B" +else + echo "not ok 5 - no -B" +fi +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 6 - no -B" +else + echo "not ok 6 - no -B" +fi +if [ -c /dev/md${no}.eli ]; then + echo "ok 7 - no -B" +else + echo "not ok 7 - no -B" +fi +geli detach md${no} +rm -f /var/backups/md${no}.eli + +# -B file +rm -f $backupfile +geli init -B $backupfile -P -K $keyfile md${no} >/dev/null 2>&1 +if [ -f $backupfile ]; then + echo "ok 8 - -B file" +else + echo "not ok 8 - -B file" +fi +geli clear md${no} +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 9 - -B file" +else + echo "not ok 9 - -B file" +fi +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 10 - -B file" +else + echo "not ok 10 - -B file" +fi +geli restore $backupfile md${no} +if [ $? -eq 0 ]; then + echo "ok 11 - -B file" +else + echo "not ok 11 - -B file" +fi +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 12 - -B file" +else + echo "not ok 12 - -B file" +fi +if [ -c /dev/md${no}.eli ]; then + echo "ok 13 - -B file" +else + echo "not ok 13 - -B file" +fi +geli detach md${no} +rm -f $backupfile + +mdconfig -d -u $no +rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_J_test.sh b/sbin/geom/class/tests/eli/init_J_test.sh new file mode 100755 index 0000000..3408637 --- /dev/null +++ b/sbin/geom/class/tests/eli/init_J_test.sh @@ -0,0 +1,126 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile0=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +passfile0=`mktemp $base.XXXXXX` || exit 1 +passfile1=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..150" + +dd if=/dev/random of=${keyfile0} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile0} +dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile1} + +i=1 +for iter in -1 0 64; do + geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) +done + +mdconfig -d -u $no +rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} diff --git a/sbin/geom/class/tests/eli/init_a_test.sh b/sbin/geom/class/tests/eli/init_a_test.sh new file mode 100755 index 0000000..e1f1b3f --- /dev/null +++ b/sbin/geom/class/tests/eli/init_a_test.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..1380" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done + done +done + +rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_i_P_test.sh b/sbin/geom/class/tests/eli/init_i_P_test.sh new file mode 100755 index 0000000..df0d138 --- /dev/null +++ b/sbin/geom/class/tests/eli/init_i_P_test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..1" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -i 64 -P -K ${keyfile} md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +mdconfig -d -u $no +rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_test.sh b/sbin/geom/class/tests/eli/init_test.sh new file mode 100755 index 0000000..c5765d0 --- /dev/null +++ b/sbin/geom/class/tests/eli/init_test.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..460" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + if [ ${md_rnd} != ${md_edev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done +done + +rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/integrity_copy_test.sh b/sbin/geom/class/tests/eli/integrity_copy_test.sh new file mode 100755 index 0000000..742fb21 --- /dev/null +++ b/sbin/geom/class/tests/eli/integrity_copy_test.sh @@ -0,0 +1,98 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 + +echo "1..5520" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + #mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + mdconfig -a -t malloc -s $sectors -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Copy first small sector to the second small sector. + # This should be detected as corruption. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'` + ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Copy first big sector to the second big sector. + # This should be detected as corruption. + dd if=/dev/md${no} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no + done + done +done + +rm -f $keyfile $sector diff --git a/sbin/geom/class/tests/eli/integrity_data_test.sh b/sbin/geom/class/tests/eli/integrity_data_test.sh new file mode 100755 index 0000000..e02950b --- /dev/null +++ b/sbin/geom/class/tests/eli/integrity_data_test.sh @@ -0,0 +1,68 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 + +echo "1..2760" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Corrupt 8 bytes of data. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=/dev/random of=${sector} bs=1 count=8 seek=64 conv=notrunc >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no + done + done +done + +rm -f $keyfile $sector diff --git a/sbin/geom/class/tests/eli/integrity_hmac_test.sh b/sbin/geom/class/tests/eli/integrity_hmac_test.sh new file mode 100755 index 0000000..3cb4f8a --- /dev/null +++ b/sbin/geom/class/tests/eli/integrity_hmac_test.sh @@ -0,0 +1,68 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 + +echo "1..2760" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Corrupt 8 bytes of HMAC. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=/dev/random of=${sector} bs=1 count=16 conv=notrunc >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no + done + done +done + +rm -f $keyfile $sector diff --git a/sbin/geom/class/tests/eli/kill_test.sh b/sbin/geom/class/tests/eli/kill_test.sh new file mode 100755 index 0000000..513e853 --- /dev/null +++ b/sbin/geom/class/tests/eli/kill_test.sh @@ -0,0 +1,97 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..9" + +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile1 md${no} +geli attach -p -k $keyfile1 md${no} +geli setkey -n 1 -P -K $keyfile2 md${no} + +# Kill attached provider. +geli kill md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +sleep 1 +# Provider should be automatically detached. +if [ ! -c /dev/md{$no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +geli init -B none -P -K $keyfile1 md${no} +geli setkey -n 1 -p -k $keyfile1 -P -K $keyfile2 md${no} + +# Should be possible to attach with keyfile1. +geli attach -p -k $keyfile1 md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi +geli detach md${no} + +# Should be possible to attach with keyfile2. +geli attach -p -k $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi +geli detach md${no} + +# Kill detached provider. +geli kill md${no} +if [ $? -eq 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +mdconfig -d -u $no +rm -f $keyfile1 $keyfile2 diff --git a/sbin/geom/class/tests/eli/nokey_test.sh b/sbin/geom/class/tests/eli/nokey_test.sh new file mode 100755 index 0000000..f29150b --- /dev/null +++ b/sbin/geom/class/tests/eli/nokey_test.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..8" + +geli init -B none -P md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K ${keyfile} md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi +geli attach -p md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi +geli attach -p -k ${keyfile} md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi +geli setkey -n 0 -P md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi +geli detach md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi +geli setkey -n 0 -p -P -K ${keyfile} md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi +geli setkey -n 0 -p -k ${keyfile} -P md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +mdconfig -d -u $no +rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/onetime_a_test.sh b/sbin/geom/class/tests/eli/onetime_a_test.sh new file mode 100755 index 0000000..0fb3e5e --- /dev/null +++ b/sbin/geom/class/tests/eli/onetime_a_test.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 + +echo "1..1380" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done + done +done diff --git a/sbin/geom/class/tests/eli/onetime_d_test.sh b/sbin/geom/class/tests/eli/onetime_d_test.sh new file mode 100755 index 0000000..d49cb64 --- /dev/null +++ b/sbin/geom/class/tests/eli/onetime_d_test.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +mdconfig -a -t malloc -s $sectors -u $no || exit 1 + +echo "1..3" + +geli onetime -d md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 1" +else + echo "not ok 1" +fi +# Be sure it doesn't detach on read. +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ -c /dev/md${no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi +true > /dev/md${no}.eli +sleep 1 +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +mdconfig -d -u $no diff --git a/sbin/geom/class/tests/eli/onetime_test.sh b/sbin/geom/class/tests/eli/onetime_test.sh new file mode 100755 index 0000000..267fc27 --- /dev/null +++ b/sbin/geom/class/tests/eli/onetime_test.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 + +echo "1..460" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors`b -u $no || exit 1 + + geli onetime -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + if [ ${md_rnd} != ${md_edev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done +done diff --git a/sbin/geom/class/tests/eli/readonly_test.sh b/sbin/geom/class/tests/eli/readonly_test.sh new file mode 100755 index 0000000..74396b5 --- /dev/null +++ b/sbin/geom/class/tests/eli/readonly_test.sh @@ -0,0 +1,93 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..11" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +geli attach -r -p -k $keyfile md${no} +if [ $? -eq 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +sh -c "true >/dev/md${no}.eli" 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +geli kill md${no} +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +# kill should detach provider... +if [ ! -c /dev/md{$no}.eli ]; then + echo "ok 5" +else + echo "not ok 5" +fi + +# ...but not destroy the metadata. +geli attach -r -p -k $keyfile md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi + +geli setkey -n 1 -P -K /dev/null md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +geli delkey -n 0 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +geli delkey -f -n 0 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +geli list md${no}.eli | egrep '^Flags: .*READ-ONLY' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +geli detach md${no} +if [ $? -eq 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi + +mdconfig -d -u $no +rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/resize_test.sh b/sbin/geom/class/tests/eli/resize_test.sh new file mode 100755 index 0000000..86ee364 --- /dev/null +++ b/sbin/geom/class/tests/eli/resize_test.sh @@ -0,0 +1,150 @@ +#! /bin/sh +# +# $FreeBSD$ + +echo 1..27 + +BLK=512 +BLKS_PER_MB=2048 + +md=$(mdconfig -s40m) || exit 1 +unit=${md#md} +i=1 + +setsize() { + partszMB=$1 unitszMB=$2 + + { + echo a: $(($partszMB * $BLKS_PER_MB)) 0 4.2BSD 1024 8192 + echo c: $(($unitszMB * $BLKS_PER_MB)) 0 unused 0 0 + } | disklabel -R $md /dev/stdin +} + +# Initialise + +kldload geom_eli >/dev/null 2>&1 + +setsize 10 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 10m" +i=$((i + 1)) + +echo secret >tmp.key +geli init -Bnone -PKtmp.key ${md}a || echo -n "not " +echo ok $i - "Initialised geli on ${md}a" +i=$((i + 1)) +geli attach -pk tmp.key ${md}a || echo -n "not " +echo ok $i - "Attached ${md}a as ${md}a.eli" +i=$((i + 1)) + +newfs -U ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Initialised the filesystem on ${md}a.eli" +i=$((i + 1)) +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + + +# Doing a backup, resize & restore must be forced (with -f) as geli +# verifies that the provider size in the metadata matches the consumer. + +geli backup ${md}a tmp.meta || echo -n "not " +echo ok $i - "Backed up ${md}a metadata" +i=$((i + 1)) + +geli detach ${md}a.eli || echo -n "not " +echo ok $i - "Detached ${md}a.eli" +i=$((i + 1)) + +setsize 20 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 20m" +i=$((i + 1)) +geli attach -pktmp.key ${md}a && echo -n "not " +echo ok $i - "Attaching ${md}a fails after resizing the consumer" +i=$((i + 1)) + +geli restore tmp.meta ${md}a && echo -n "not " +echo ok $i - "Restoring metadata on ${md}a.eli fails without -f" +i=$((i + 1)) +geli restore -f tmp.meta ${md}a || echo -n "not " +echo ok $i - "Restoring metadata on ${md}a.eli can be forced" +i=$((i + 1)) + +geli attach -pktmp.key ${md}a || echo -n "not " +echo ok $i - "Attaching ${md}a is now possible" +i=$((i + 1)) + +growfs -y ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Extended the filesystem on ${md}a.eli" +i=$((i + 1)) + +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + + +# Now do the resize properly + +geli detach ${md}a.eli || echo -n "not " +echo ok $i - "Detached ${md}a.eli" +i=$((i + 1)) + +setsize 30 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 30m" +i=$((i + 1)) + +geli resize -s20m ${md}a || echo -n "not " +echo ok $i - "Resizing works ok" +i=$((i + 1)) +geli resize -s20m ${md}a && echo -n "not " +echo ok $i - "Resizing doesn't work a 2nd time (no old metadata)" +i=$((i + 1)) + +geli attach -pktmp.key ${md}a || echo -n "not " +echo ok $i - "Attaching ${md}a works ok" +i=$((i + 1)) + +growfs -y ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Extended the filesystem on ${md}a.eli" +i=$((i + 1)) + +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + +geli detach ${md}a.eli +gpart destroy -F $md >/dev/null + + +# Verify that the man page example works, changing ada0 to $md, +# 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none +# to geli init. + +gpart create -s GPT $md || echo -n "not " +echo ok $i - "Installed a GPT on ${md}" +i=$((i + 1)) +gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " +echo ok $i - "Added a 20m partition in slot 1" +i=$((i + 1)) +geli init -B none -K tmp.key -P ${md}p1 || echo -n "not " +echo ok $i - "Initialised geli on ${md}p1" +i=$((i + 1)) +gpart resize -s 30m -i 1 $md || echo -n "not " +echo ok $i - "Resized partition ${md}p1 to 30m" +i=$((i + 1)) +geli resize -s 20m ${md}p1 || echo -n "not " +echo ok $i - "Resized geli on ${md}p1 to 30m" +i=$((i + 1)) +geli attach -k tmp.key -p ${md}p1 || echo -n "not " +echo ok $i - "Attached ${md}p1.eli" +i=$((i + 1)) + +geli detach ${md}p1.eli +mdconfig -du$unit + +rm tmp.* diff --git a/sbin/geom/class/tests/eli/setkey_test.sh b/sbin/geom/class/tests/eli/setkey_test.sh new file mode 100755 index 0000000..f2ebe77 --- /dev/null +++ b/sbin/geom/class/tests/eli/setkey_test.sh @@ -0,0 +1,156 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +rnd=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 +keyfile5=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..16" + +dd if=/dev/random of=${rnd} bs=512 count=${sectors} >/dev/null 2>&1 +hash1=`dd if=${rnd} bs=512 count=${sectors} 2>/dev/null | md5` +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile5} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile1 md${no} +geli attach -p -k $keyfile1 md${no} + +dd if=${rnd} of=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null +rm -f $rnd +hash2=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` + +# Change current key (0) for attached provider. +geli setkey -P -K $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +geli detach md${no} + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +# Attach with new key. +geli attach -p -k $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi +hash3=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` + +# Change key 1 for attached provider. +geli setkey -n 1 -P -K $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi +geli detach md${no} + +# Attach with key 1. +geli attach -p -k $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi +hash4=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` +geli detach md${no} + +# Change current (1) key for detached provider. +geli setkey -p -k $keyfile3 -P -K $keyfile4 md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi + +# We cannot use keyfile3 anymore. +geli attach -p -k $keyfile3 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +# Attach with key 1. +geli attach -p -k $keyfile4 md${no} +if [ $? -eq 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi +hash5=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` +geli detach md${no} + +# Change key 0 for detached provider. +geli setkey -n 0 -p -k $keyfile4 -P -K $keyfile5 md${no} +if [ $? -eq 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +# Attach with key 0. +geli attach -p -k $keyfile5 md${no} +if [ $? -eq 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi +hash6=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` +geli detach md${no} + +if [ ${hash1} = ${hash2} ]; then + echo "ok 12" +else + echo "not ok 12" +fi +if [ ${hash1} = ${hash3} ]; then + echo "ok 13" +else + echo "not ok 13" +fi +if [ ${hash1} = ${hash4} ]; then + echo "ok 14" +else + echo "not ok 14" +fi +if [ ${hash1} = ${hash5} ]; then + echo "ok 15" +else + echo "not ok 15" +fi +if [ ${hash1} = ${hash6} ]; then + echo "ok 16" +else + echo "not ok 16" +fi + +mdconfig -d -u $no +rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 $keyfile5 diff --git a/sbin/geom/class/tests/gate/1_test.sh b/sbin/geom/class/tests/gate/1_test.sh new file mode 100755 index 0000000..279e316 --- /dev/null +++ b/sbin/geom/class/tests/gate/1_test.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +us=45 +work="/dev/md${us}" +src="/dev/md`expr $us + 1`" +conf=`mktemp /tmp/$base.XXXXXX` || exit 1 + +mdconfig -a -t malloc -s 1M -u $us || exit 1 +mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 +dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 +sum=`cat $src | md5 -q` + +echo "127.0.0.1 RW $work" > $conf +ggated $conf +ggatec create -u $us 127.0.0.1 $work + +dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 + +echo '1..2' + +if [ `cat $work | md5 -q` != $sum ]; then + echo 'not ok 1 - md5 checksum' +else + echo 'ok 1 - md5 checksum' + + if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then + echo 'not ok 2 - md5 checksum' + else + echo 'ok 2 - md5 checksum' + fi +fi + +ggatec destroy -u $us +mdconfig -d -u $us +mdconfig -d -u `expr $us + 1` +pkill ggated $conf +rm -f $conf diff --git a/sbin/geom/class/tests/gate/2_test.sh b/sbin/geom/class/tests/gate/2_test.sh new file mode 100755 index 0000000..2e5e254 --- /dev/null +++ b/sbin/geom/class/tests/gate/2_test.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +us=45 +work=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 +sum=`md5 -q $src` + +ggatel create -u $us $work + +dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 + +echo '1..2' + +if [ `md5 -q $work` != $sum ]; then + echo 'not ok 1 - md5 checksum' +else + echo 'ok 1 - md5 checksum' + if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then + echo 'not ok 2 - md5 checksum' + else + echo 'ok 2 - md5 checksum' + fi +fi + +ggatel destroy -u $us +rm -f $work $src diff --git a/sbin/geom/class/tests/gate/3_test.sh b/sbin/geom/class/tests/gate/3_test.sh new file mode 100755 index 0000000..ba2b3c7 --- /dev/null +++ b/sbin/geom/class/tests/gate/3_test.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +us=45 +work="/dev/md${us}" +src="/dev/md`expr $us + 1`" + +mdconfig -a -t malloc -s 1M -u $us || exit 1 +mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 +dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 +sum=`cat $src | md5 -q` + +ggatel create -u $us $work + +dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 + +echo '1..2' + +if [ `cat $work | md5 -q` != $sum ]; then + echo 'not ok 1 - md5 checksum' +else + echo 'ok 1 - md5 checksum' + if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then + echo 'not ok 2 - md5 checksum' + else + echo 'ok 2 - md5 checksum' + fi +fi + +ggatel destroy -u $us +mdconfig -d -u $us +mdconfig -d -u `expr $us + 1` diff --git a/sbin/geom/class/tests/gate/Makefile b/sbin/geom/class/tests/gate/Makefile new file mode 100644 index 0000000..45249a1 --- /dev/null +++ b/sbin/geom/class/tests/gate/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test +TAP_TESTS_SH+= 3_test + +.include diff --git a/sbin/geom/class/tests/geom_subr.sh b/sbin/geom/class/tests/geom_subr.sh new file mode 100644 index 0000000..6047829 --- /dev/null +++ b/sbin/geom/class/tests/geom_subr.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# $FreeBSD$ + +kldstat -q -m g_${class} || g${class} load || exit 1 + +devwait() +{ + while :; do + if [ -c /dev/${class}/${name} ]; then + return + fi + sleep 0.2 + done +} diff --git a/sbin/geom/class/tests/gpt/gctl.c b/sbin/geom/class/tests/gpt/gctl.c new file mode 100644 index 0000000..136a616 --- /dev/null +++ b/sbin/geom/class/tests/gpt/gctl.c @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2005, 2006 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +struct retval { + struct retval *retval; + const char *param; + char *value; +}; + +struct retval *retval; +int verbose; + +static void +usage() +{ + fprintf(stdout, "usage: %s [-v] param[:len][=value] ...\n", + getprogname()); + exit(1); +} + +static int +parse(char *arg, char **param, char **value, int *len) +{ + char *e, *colon, *equal; + + if (*arg == '\0') + return (EINVAL); + + colon = strchr(arg, ':'); + equal = strchr(arg, '='); + if (colon == NULL && equal == NULL) + return (EINVAL); + if (colon == arg || equal == arg) + return (EINVAL); + if (colon != NULL && equal != NULL && equal < colon) + return (EINVAL); + + if (colon != NULL) + *colon++ = '\0'; + if (equal != NULL) + *equal++ = '\0'; + + *param = arg; + if (colon != NULL) { + /* Length specification. This parameter is RW. */ + if (*colon == '\0') + return (EINVAL); + *len = strtol(colon, &e, 0); + if (*e != '\0') + return (EINVAL); + if (*len <= 0 || *len > PATH_MAX) + return (EINVAL); + *value = malloc(*len); + if (*value == NULL) + return (ENOMEM); + memset(*value, 0, *len); + if (equal != NULL) { + if (strlen(equal) >= PATH_MAX) + return (ENOMEM); + strcpy(*value, equal); + } + } else { + /* This parameter is RO. */ + *len = -1; + if (*equal == '\0') + return (EINVAL); + *value = equal; + } + + return (0); +} + +int main(int argc, char *argv[]) +{ + struct retval *rv; + struct gctl_req *req; + char *param, *value; + const char *s; + int c, len; + + req = gctl_get_handle(); + gctl_ro_param(req, "class", -1, "GPT"); + + while ((c = getopt(argc, argv, "v")) != -1) { + switch (c) { + case 'v': + verbose = 1; + break; + case '?': + default: + usage(); + /* NOTREACHED */ + break; + } + } + + while (optind < argc) { + if (!parse(argv[optind++], ¶m, &value, &len)) { + if (len > 0) { + rv = malloc(sizeof(struct retval)); + rv->param = param; + rv->value = value; + rv->retval = retval; + retval = rv; + gctl_rw_param(req, param, len, value); + } else + gctl_ro_param(req, param, -1, value); + } + } + + if (verbose) + gctl_dump(req, stdout); + + s = gctl_issue(req); + if (s == NULL) { + printf("PASS"); + while (retval != NULL) { + rv = retval->retval; + printf(" %s=%s", retval->param, retval->value); + free(retval->value); + free(retval); + retval = rv; + } + printf("\n"); + } else + printf("FAIL %s\n", s); + + gctl_free(req); + return (0); +} diff --git a/sbin/geom/class/tests/gpt/gctl_test.pl b/sbin/geom/class/tests/gpt/gctl_test.pl new file mode 100755 index 0000000..0f30805 --- /dev/null +++ b/sbin/geom/class/tests/gpt/gctl_test.pl @@ -0,0 +1,202 @@ +#!/usr/bin/env perl -w +# +# Copyright (c) 2005, 2006 Marcel Moolenaar +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +my $srcdir = `dirname $0`; +chomp $srcdir; + +my $tmpdir = $ENV{TMPDIR} || "/tmp"; + +my $cmd = "$srcdir/gctl"; +my $out = "$cmd.out"; +my $disk = "$tmpdir/disk-$$"; +my $mntpt = "$tmpdir/mount-$$"; + +my %steps = ( + "000" => "gctl", + "001" => "gctl verb=bogus", + "010" => "gctl verb=create", + "011" => "gctl verb=create provider=bogus", + "020" => "mdcfg create pristine", + "021" => "gctl verb=create provider=%dev% entries=-1", + "022" => "gctl verb=create provider=%dev% entries=128", + "023" => "gctl verb=create provider=%dev%", + "024" => "gctl verb=modify geom=%dev%", + "025" => "conf", + "030" => "gctl verb=add", + "031" => "gctl verb=add geom=bogus", + "032" => "gctl verb=add geom=%dev%", + "033" => "gctl verb=add geom=%dev% type=bogus", + "034" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", + "035" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", + "036" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", + "037" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", + "038" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", + "039" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", + "040" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", + "041" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", + "042" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", + "043" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", + "044" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", + "045" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", + "046" => "gctl verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", + "047" => "conf", + "050" => "gctl verb=remove geom=%dev% entry=5", + "051" => "gctl verb=remove geom=%dev% entry=2", + "052" => "gctl verb=remove geom=%dev% entry=1", + "053" => "gctl verb=remove geom=%dev% entry=1", + "054" => "conf", + "060" => "gctl verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", + "061" => "mount %dev%p1", + "062" => "gctl verb=remove geom=%dev% entry=1", + "063" => "umount %dev%p1", + "064" => "gctl verb=remove geom=%dev% entry=1", + "065" => "conf", + "100" => "mdcfg destroy", + "110" => "mdcfg create corrupted", + "111" => "gctl verb=add geom=%dev%", + "120" => "mdcfg destroy", +); + +my %result = ( + "000" => "FAIL Verb missing", + "001" => "FAIL 22 verb 'bogus'", + "010" => "FAIL 87 provider", + "011" => "FAIL 22 provider 'bogus'", + "020" => "", + "021" => "FAIL 22 entries -1", + "022" => "PASS", + "023" => "FAIL 17 geom '%dev%'", + "024" => "FAIL 87 entry", + "025" => "b1856477950e5786898c8f01361196cf", + "030" => "FAIL 87 geom", + "031" => "FAIL 22 geom 'bogus'", + "032" => "FAIL 87 type", + "033" => "FAIL 22 type 'bogus'", + "034" => "FAIL 87 start", + "035" => "FAIL 22 start 1", + "036" => "FAIL 87 end", + "037" => "FAIL 22 end 12345678", + "038" => "FAIL 22 entry 129", + "039" => "PASS entry=5", + "040" => "FAIL 17 entry 5", + "041" => "FAIL 28 start/end 34/546", + "042" => "FAIL 28 start/end 162/417", + "043" => "FAIL 28 start/end 100/300", + "044" => "FAIL 28 start/end 300/500", + "045" => "PASS entry=1", + "046" => "PASS entry=2", + "047" => "50783a39eecfc62a29db24381e12b9d8", + "050" => "PASS", + "051" => "PASS", + "052" => "PASS", + "053" => "FAIL 2 entry 1", + "054" => "b1856477950e5786898c8f01361196cf", + "060" => "PASS", + "061" => "PASS", + "062" => "FAIL 16", + "063" => "PASS", + "064" => "PASS", + "065" => "b1856477950e5786898c8f01361196cf", + "100" => "", + "110" => "", + "111" => "FAIL 6 geom '%dev%'", + "120" => "", +); + +my $verbose = ""; +if (exists $ENV{'TEST_VERBOSE'}) { + $verbose = "-v"; +} + +# Make sure we have permission to use gctl... +if (`$cmd` =~ "^FAIL Permission denied") { + print "1..0 # SKIP not enough permission\n"; + unlink $cmd; + exit 0; +} + +$count = keys (%steps); +print "1..$count\n"; + +my $nr = 1; +my $dev = "n/a"; +foreach my $key (sort keys %steps) { + my ($action, $args) = split(/ /, $steps{$key}, 2); + my $res = $result{$key}; + $args = "" if (not defined $args); + $args =~ s/%dev%/$dev/g; + $res =~ s/%dev%/$dev/g; + + if ($action =~ "^gctl") { + system("$cmd $verbose $args | tee $out 2>&1"); + $st = `tail -1 $out`; + if ($st =~ "^$res") { + print "ok $nr \# gctl($key)\n"; + } else { + print "not ok $nr \# gctl($key) - $st\n"; + } + unlink $out; + } elsif ($action =~ "^mdcfg") { + if ($args =~ "^create") { + system("dd if=/dev/zero of=$disk count=1024 2>&1"); + if ($args =~ "corrupted") { + system("gpt create -p $disk"); + } + $dev = `mdconfig -a -t vnode -f $disk`; + chomp $dev; + } elsif ($args =~ "^destroy") { + $dev =~ s/md/-u /g; + system("mdconfig -d $dev"); + unlink $disk; + $dev = "n/a"; + } + print "ok $nr \# mdcfg($key)\n"; + } elsif ($action =~ "^conf") { + system("sysctl -b kern.geom.conftxt | grep -a $dev | sed -e s:$disk:DISK:g -e s:$dev:DEV:g | sort | md5 -p | tee $out 2>&1"); + $st = `tail -1 $out`; + if ($st =~ "^$res") { + print "ok $nr \# conf($key)\n"; + } else { + print "not ok $nr \# conf($key) - $st\n"; + } + unlink $out; + } elsif ($action =~ "^mount") { + system("mkdir $mntpt-$args"); + system("newfs $args"); + system("mount -t ufs /dev/$args $mntpt-$args"); + print "ok $nr \# mount($key)\n"; + } elsif ($action =~ "^umount") { + system("umount $mntpt-$args"); + system("rmdir $mntpt-$args"); + print "ok $nr \# umount($key)\n"; + } + $nr += 1; +} + +unlink $cmd; +exit 0; diff --git a/sbin/geom/class/tests/mirror/1_test.sh b/sbin/geom/class/tests/mirror/1_test.sh new file mode 100755 index 0000000..b07a8d1 --- /dev/null +++ b/sbin/geom/class/tests/mirror/1_test.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` + +mdconfig -a -t malloc -s 1M -u $us0 || exit 1 +mdconfig -a -t malloc -s 2M -u $us1 || exit 1 +mdconfig -a -t malloc -s 3M -u $us2 || exit 1 + +gmirror label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +# Size of created device should be 1MB - 512b. + +size=`diskinfo /dev/mirror/${name} | awk '{print $3}'` + +if [ $size -eq 1048064 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +gmirror remove $name md${us0} +gmirror remove $name md${us1} +gmirror remove $name md${us2} +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 diff --git a/sbin/geom/class/tests/mirror/2_test.sh b/sbin/geom/class/tests/mirror/2_test.sh new file mode 100755 index 0000000..3fb0822 --- /dev/null +++ b/sbin/geom/class/tests/mirror/2_test.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..4" + +balance="round-robin" +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi +dd if=/dev/md${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi +dd if=/dev/md${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +gmirror remove $name md${us0} md${us1} md${us2} +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/3_test.sh b/sbin/geom/class/tests/mirror/3_test.sh new file mode 100755 index 0000000..5bdd2ab --- /dev/null +++ b/sbin/geom/class/tests/mirror/3_test.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..5" + +balance="round-robin" +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gmirror remove $name md${us0} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name md${us1} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +gmirror remove $name md${us2} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +# mirror/${name} should be removed. +if [ -c /dev/${name} ]; then + echo "not ok 5" +else + echo "ok 5" +fi + +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/4_test.sh b/sbin/geom/class/tests/mirror/4_test.sh new file mode 100755 index 0000000..0786bdb --- /dev/null +++ b/sbin/geom/class/tests/mirror/4_test.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..5" + +balance="load" +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gmirror remove $name md${us0} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name md${us1} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +gmirror remove $name md${us2} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +# mirror/${name} should be removed. +if [ -c /dev/${name} ]; then + echo "not ok 5" +else + echo "ok 5" +fi + +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/5_test.sh b/sbin/geom/class/tests/mirror/5_test.sh new file mode 100755 index 0000000..5b0a5ed --- /dev/null +++ b/sbin/geom/class/tests/mirror/5_test.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..5" + +balance="split" +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=8192 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gmirror remove $name md${us0} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name md${us1} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +gmirror remove $name md${us2} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +# mirror/${name} should be removed. +if [ -c /dev/${name} ]; then + echo "not ok 5" +else + echo "ok 5" +fi + +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/6_test.sh b/sbin/geom/class/tests/mirror/6_test.sh new file mode 100755 index 0000000..ec86d06 --- /dev/null +++ b/sbin/geom/class/tests/mirror/6_test.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..2" + +balance="split" +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=8192 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/zero of=/dev/md${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +# Connect disk to the mirror. +gmirror insert ${name} md${us2} +# Wait for synchronization. +sleep 1 +dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name md${us0} md${us1} md${us2} +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/7_test.sh b/sbin/geom/class/tests/mirror/7_test.sh new file mode 100755 index 0000000..c911c03 --- /dev/null +++ b/sbin/geom/class/tests/mirror/7_test.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..5" + +balance="prefer" +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gmirror remove $name md${us0} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name md${us1} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +gmirror remove $name md${us2} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +# mirror/${name} should be removed. +if [ -c /dev/${name} ]; then + echo "not ok 5" +else + echo "ok 5" +fi + +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/conf.sh b/sbin/geom/class/tests/mirror/conf.sh new file mode 100755 index 0000000..8a60a16 --- /dev/null +++ b/sbin/geom/class/tests/mirror/conf.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# $FreeBSD$ + +name="test" +class="mirror" +base=`basename $0` + +. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/nop/1_test.sh b/sbin/geom/class/tests/nop/1_test.sh new file mode 100755 index 0000000..f08f71d --- /dev/null +++ b/sbin/geom/class/tests/nop/1_test.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us=45 + +mdconfig -a -t malloc -s 1M -u $us || exit 1 + +gnop create /dev/md${us} || exit 1 + +# Size of created device should be 1MB. + +size=`diskinfo /dev/md${us}.nop | awk '{print $3}'` + +if [ $size -eq 1048576 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +gnop destroy md${us}.nop +mdconfig -d -u $us diff --git a/sbin/geom/class/tests/nop/2_test.sh b/sbin/geom/class/tests/nop/2_test.sh new file mode 100755 index 0000000..e0ddb17 --- /dev/null +++ b/sbin/geom/class/tests/nop/2_test.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +us=45 +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +echo "1..1" + +dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1 + +mdconfig -a -t malloc -s 1M -u $us || exit 1 + +gnop create /dev/md${us} || exit 1 + +dd if=${src} of=/dev/md${us}.nop bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/md${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 + +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gnop destroy md${us}.nop +mdconfig -d -u $us +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/nop/conf.sh b/sbin/geom/class/tests/nop/conf.sh new file mode 100755 index 0000000..0dc9797 --- /dev/null +++ b/sbin/geom/class/tests/nop/conf.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# $FreeBSD$ + +class="nop" +base=`basename $0` + +. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/raid3/10_test.sh b/sbin/geom/class/tests/raid3/10_test.sh new file mode 100755 index 0000000..1320120 --- /dev/null +++ b/sbin/geom/class/tests/raid3/10_test.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label -r $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/11_test.sh b/sbin/geom/class/tests/raid3/11_test.sh new file mode 100755 index 0000000..3382214 --- /dev/null +++ b/sbin/geom/class/tests/raid3/11_test.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/12_test.sh b/sbin/geom/class/tests/raid3/12_test.sh new file mode 100755 index 0000000..3dec406 --- /dev/null +++ b/sbin/geom/class/tests/raid3/12_test.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +nblocks1=9 +nblocks2=`expr $nblocks1 - 1` +nblocks3=`expr $nblocks2 / 2` + +mdconfig -a -t malloc -s $nblocks1 -u $us0 || exit 1 +mdconfig -a -t malloc -s $nblocks1 -u $us1 || exit 1 +mdconfig -a -t malloc -s $nblocks1 -u $us2 || exit 1 + +dd if=/dev/random of=/dev/md${us0} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/md${us1} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/md${us2} count=$nblocks1 >/dev/null 2>&1 + +graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait +# Wait for synchronization. +sleep 2 +graid3 stop $name +# Break one component. +dd if=/dev/random of=/dev/md${us1} count=$nblocks2 >/dev/null 2>&1 +# Provoke retaste of the rest components. +true > /dev/md${us0} +true > /dev/md${us2} +sleep 1 + +dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 +ec=$? +if [ $ec -eq 0 ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 diff --git a/sbin/geom/class/tests/raid3/1_test.sh b/sbin/geom/class/tests/raid3/1_test.sh new file mode 100755 index 0000000..9202967 --- /dev/null +++ b/sbin/geom/class/tests/raid3/1_test.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..2" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` + +mdconfig -a -t malloc -s 1M -u $us0 || exit 1 +mdconfig -a -t malloc -s 2M -u $us1 || exit 1 +mdconfig -a -t malloc -s 3M -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +devwait + +# Size of created device should be 2MB - 1024B. + +mediasize=`diskinfo /dev/raid3/${name} | awk '{print $3}'` +if [ $mediasize -eq 2096128 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +sectorsize=`diskinfo /dev/raid3/${name} | awk '{print $2}'` +if [ $sectorsize -eq 1024 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 diff --git a/sbin/geom/class/tests/raid3/2_test.sh b/sbin/geom/class/tests/raid3/2_test.sh new file mode 100755 index 0000000..88daf78 --- /dev/null +++ b/sbin/geom/class/tests/raid3/2_test.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/3_test.sh b/sbin/geom/class/tests/raid3/3_test.sh new file mode 100755 index 0000000..d2c1a5f --- /dev/null +++ b/sbin/geom/class/tests/raid3/3_test.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +# +# Reading without one DATA component (so with parity). +# +graid3 remove -n 1 $name +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/4_test.sh b/sbin/geom/class/tests/raid3/4_test.sh new file mode 100755 index 0000000..d437ec0 --- /dev/null +++ b/sbin/geom/class/tests/raid3/4_test.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +# +# Writing without one DATA component. +# +graid3 remove -n 1 $name +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/5_test.sh b/sbin/geom/class/tests/raid3/5_test.sh new file mode 100755 index 0000000..ffd85f6 --- /dev/null +++ b/sbin/geom/class/tests/raid3/5_test.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +# +# Writing without PARITY component. +# +graid3 remove -n 2 $name +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/6_test.sh b/sbin/geom/class/tests/raid3/6_test.sh new file mode 100755 index 0000000..97b5503 --- /dev/null +++ b/sbin/geom/class/tests/raid3/6_test.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +# +# Rebuild of DATA component. +# +graid3 remove -n 1 $name +dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +graid3 insert -n 1 $name md${us1} +sleep 1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/7_test.sh b/sbin/geom/class/tests/raid3/7_test.sh new file mode 100755 index 0000000..3d89873 --- /dev/null +++ b/sbin/geom/class/tests/raid3/7_test.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +# +# Rebuild of PARITY component. +# +graid3 remove -n 2 $name +dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +graid3 insert -n 2 $name md${us2} +sleep 1 +# Remove DATA component, so PARITY component can be used while reading. +graid3 remove -n 1 $name +dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/8_test.sh b/sbin/geom/class/tests/raid3/8_test.sh new file mode 100755 index 0000000..b9621f4 --- /dev/null +++ b/sbin/geom/class/tests/raid3/8_test.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +# +# Writing without DATA component and rebuild of DATA component. +# +graid3 remove -n 1 $name +dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +graid3 insert -n 1 $name md${us1} +sleep 1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/9_test.sh b/sbin/geom/class/tests/raid3/9_test.sh new file mode 100755 index 0000000..0695011 --- /dev/null +++ b/sbin/geom/class/tests/raid3/9_test.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 +mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 + +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +# +# Writing without PARITY component and rebuild of PARITY component. +# +graid3 remove -n 2 $name +dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +graid3 insert -n 2 $name md${us2} +sleep 1 +# Remove DATA component, so PARITY component can be used while reading. +graid3 remove -n 1 $name +dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +graid3 stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/conf.sh b/sbin/geom/class/tests/raid3/conf.sh new file mode 100755 index 0000000..93e7dea --- /dev/null +++ b/sbin/geom/class/tests/raid3/conf.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# $FreeBSD$ + +name="test" +class="raid3" +base=`basename $0` + +. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/shsec/1_test.sh b/sbin/geom/class/tests/shsec/1_test.sh new file mode 100755 index 0000000..5cb5b4f --- /dev/null +++ b/sbin/geom/class/tests/shsec/1_test.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..2" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` + +mdconfig -a -t malloc -s 1M -u $us0 || exit 1 +mdconfig -a -t malloc -s 2M -u $us1 || exit 1 +mdconfig -a -t malloc -s 3M -u $us2 || exit 1 + +gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +devwait + +# Size of created device should be 1MB - 512B. + +mediasize=`diskinfo /dev/shsec/${name} | awk '{print $3}'` +if [ $mediasize -eq 1048064 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +sectorsize=`diskinfo /dev/shsec/${name} | awk '{print $2}'` +if [ $sectorsize -eq 512 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +gshsec stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 diff --git a/sbin/geom/class/tests/shsec/2_test.sh b/sbin/geom/class/tests/shsec/2_test.sh new file mode 100755 index 0000000..19a4e0a --- /dev/null +++ b/sbin/geom/class/tests/shsec/2_test.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..4" + +us0=45 +us1=`expr $us0 + 1` +us2=`expr $us0 + 2` +nblocks1=1024 +nblocks2=`expr $nblocks1 + 1` +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 + +mdconfig -a -t malloc -s $nblocks2 -u $us0 || exit 1 +mdconfig -a -t malloc -s $nblocks2 -u $us1 || exit 1 +mdconfig -a -t malloc -s $nblocks2 -u $us2 || exit 1 + +gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait + +dd if=${src} of=/dev/shsec/${name} count=$nblocks1 >/dev/null 2>&1 + +dd if=/dev/shsec/${name} of=${dst} count=$nblocks1 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +dd if=/dev/md${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 +if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +dd if=/dev/md${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 +if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +dd if=/dev/md${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 +if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +gshsec stop $name +mdconfig -d -u $us0 +mdconfig -d -u $us1 +mdconfig -d -u $us2 +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/shsec/conf.sh b/sbin/geom/class/tests/shsec/conf.sh new file mode 100755 index 0000000..7648862 --- /dev/null +++ b/sbin/geom/class/tests/shsec/conf.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# $FreeBSD$ + +name="test" +class="shsec" +base=`basename $0` + +. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/stripe/1_test.sh b/sbin/geom/class/tests/stripe/1_test.sh new file mode 100755 index 0000000..9b398f0 --- /dev/null +++ b/sbin/geom/class/tests/stripe/1_test.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us=45 + +mdconfig -a -t malloc -s 1M -u $us || exit 1 +mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 +mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 + +gstripe create -s 16384 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +devwait + +# Size of created device should be 1MB * 3. + +size=`diskinfo /dev/stripe/${name} | awk '{print $3}'` + +if [ $size -eq 3145728 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +gstripe destroy $name +mdconfig -d -u $us +mdconfig -d -u `expr $us + 1` +mdconfig -d -u `expr $us + 2` diff --git a/sbin/geom/class/tests/stripe/2_test.sh b/sbin/geom/class/tests/stripe/2_test.sh new file mode 100755 index 0000000..73937f4 --- /dev/null +++ b/sbin/geom/class/tests/stripe/2_test.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us=45 +tsize=3 +src=`mktemp /tmp/$base.XXXXXX` || exit 1 +dst=`mktemp /tmp/$base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 + +mdconfig -a -t malloc -s 1M -u $us || exit 1 +mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 +mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 + +gstripe create -s 8192 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +devwait + +dd if=${src} of=/dev/stripe/${name} bs=1m count=$tsize >/dev/null 2>&1 +dd if=/dev/stripe/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 + +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gstripe destroy $name +mdconfig -d -u $us +mdconfig -d -u `expr $us + 1` +mdconfig -d -u `expr $us + 2` +rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/stripe/conf.sh b/sbin/geom/class/tests/stripe/conf.sh new file mode 100755 index 0000000..22e5864 --- /dev/null +++ b/sbin/geom/class/tests/stripe/conf.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# $FreeBSD$ + +name="test" +class="stripe" +base=`basename $0` + +. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/uzip/1.sh b/sbin/geom/class/tests/uzip/1.sh new file mode 100755 index 0000000..af3e889 --- /dev/null +++ b/sbin/geom/class/tests/uzip/1.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +mntpoint="/mnt/test-1" + +# +# prepare +kldload geom_uzip +UUE=$(dirname $0)/1.img.uzip.uue +uudecode $UUE +num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 +sleep 1 + +# +# mount +mkdir -p "${mntpoint}" +mount -o ro /dev/md${num}.uzip "${mntpoint}" || exit 1 + +# +# compare +#cat "${mntpoint}/etalon.txt" +diff -u etalon/etalon.txt "${mntpoint}/etalon.txt" +if [ $? -eq 0 ]; then + echo "PASS" +else + echo "FAIL" +fi + +# +# cleanup +umount "${mntpoint}" +rmdir "${mntpoint}" +mdconfig -d -u ${num} +sleep 1 +kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/2.sh b/sbin/geom/class/tests/uzip/2.sh new file mode 100755 index 0000000..bf66169 --- /dev/null +++ b/sbin/geom/class/tests/uzip/2.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# +# prepare + +UUE=$(dirname $0)/1.img.uzip.uue + +kldload geom_uzip +uudecode $UUE +num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 +sleep 1 + +# +# destroy +kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/Makefile b/sbin/geom/class/tests/uzip/Makefile new file mode 100644 index 0000000..a9a7341 --- /dev/null +++ b/sbin/geom/class/tests/uzip/Makefile @@ -0,0 +1,34 @@ +# +# $FreeBSD$ +# +# Regression test for geom_uzip. +# + +IMAGE= 1.img +ZIMAGE= ${IMAGE}.uzip +UZIMAGE= ${ZIMAGE}.uue + +CLEANFILES+= ${IMAGE} ${UZIMAGE} ${ZIMAGE} + +${IMAGE}: + makefs -s 1048576 ${.TARGET} ${.CURDIR}/etalon + +${ZIMAGE}: ${IMAGE} + mkuzip -o ${.TARGET} ${.ALLSRC} + +${UZIMAGE}: ${IMAGE} ${ZIMAGE} + printf "#\n# $$" >${.TARGET} + printf "FreeBSD$$\n#\n\n" >> ${.TARGET} + uuencode ${ZIMAGE} ${ZIMAGE} >>${.TARGET} + +FILES+= ${UZIMAGE} +FILESDIR= ${TESTSDIR} + +FILESGROUPS= FILES etalon +etalon+= etalon/etalon.txt +etalonDIR= ${TESTSDIR}/etalon + +PLAIN_TESTS_SH+= 1 +PLAIN_TESTS_SH+= 2 + +.include diff --git a/sbin/geom/class/tests/uzip/etalon/etalon.txt b/sbin/geom/class/tests/uzip/etalon/etalon.txt new file mode 100644 index 0000000..cb8acf3 --- /dev/null +++ b/sbin/geom/class/tests/uzip/etalon/etalon.txt @@ -0,0 +1,43 @@ +# +# $FreeBSD$ +# + +JABBERWOCKY + +Lewis Carroll +(from Through the Looking-Glass and What Alice Found There, 1872) + +`Twas brillig, and the slithy toves +Did gyre and gimble in the wabe: +All mimsy were the borogoves, +And the mome raths outgrabe. + +"Beware the Jabberwock, my son! +The jaws that bite, the claws that catch! +Beware the Jubjub bird, and shun +The frumious Bandersnatch!" + +He took his vorpal sword in hand: +Long time the manxome foe he sought -- +So rested he by the Tumtum tree, +And stood awhile in thought. + +And, as in uffish thought he stood, +The Jabberwock, with eyes of flame, +Came whiffling through the tulgey wood, +And burbled as it came! + +One, two! One, two! And through and through +The vorpal blade went snicker-snack! +He left it dead, and with its head +He went galumphing back. + +"And, has thou slain the Jabberwock? +Come to my arms, my beamish boy! +O frabjous day! Callooh! Callay!' +He chortled in his joy. + +`Twas brillig, and the slithy toves +Did gyre and gimble in the wabe; +All mimsy were the borogoves, +And the mome raths outgrabe. diff --git a/sbin/geom/core/tests/ConfCmp/ConfCmp.c b/sbin/geom/core/tests/ConfCmp/ConfCmp.c new file mode 100644 index 0000000..161b5cc --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/ConfCmp.c @@ -0,0 +1,379 @@ +/*- + * Copyright (c) 2002 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +FILE *fsubs; + +struct node { + LIST_HEAD(, node) children; + LIST_ENTRY(node) siblings; + struct node *parent; + const char *name; + struct sbuf *cont; + struct sbuf *key; + char *id; + char *ref; +}; + +struct mytree { + struct node *top; + struct node *cur; + int indent; + int ignore; +}; + +struct ref { + LIST_ENTRY(ref) next; + char *k1; + char *k2; +}; + +LIST_HEAD(, ref) refs = LIST_HEAD_INITIALIZER(refs); + +static struct node * +new_node(void) +{ + struct node *np; + + np = calloc(1, sizeof *np); + np->cont = sbuf_new_auto(); + sbuf_clear(np->cont); + np->key = sbuf_new_auto(); + sbuf_clear(np->key); + LIST_INIT(&np->children); + return (np); +} + +static void +indent(int n) +{ + + printf("%*.*s", n, n, ""); +} + +static void +StartElement(void *userData, const char *name, const char **attr) +{ + struct mytree *mt; + struct node *np; + int i; + + mt = userData; + if (!strcmp(name, "FreeBSD")) { + mt->ignore = 1; + return; + } + mt->ignore = 0; + mt->indent += 2; + np = new_node(); + for (i = 0; attr[i]; i += 2) { + if (!strcmp(attr[i], "id")) + np->id = strdup(attr[i+1]); + else if (!strcmp(attr[i], "ref")) + np->ref = strdup(attr[i+1]); + } + np->name = strdup(name); + sbuf_cat(np->key, name); + sbuf_cat(np->key, "::"); + np->parent = mt->cur; + LIST_INSERT_HEAD(&mt->cur->children, np, siblings); + mt->cur = np; +} + +static void +EndElement(void *userData, const char *name __unused) +{ + struct mytree *mt; + struct node *np; + + mt = userData; + if (mt->ignore) + return; + + mt->indent -= 2; + sbuf_finish(mt->cur->cont); + LIST_FOREACH(np, &mt->cur->children, siblings) { + if (strcmp(np->name, "name")) + continue; + sbuf_cat(mt->cur->key, sbuf_data(np->cont)); + break; + } + sbuf_finish(mt->cur->key); + mt->cur = mt->cur->parent; +} + +static void +CharData(void *userData , const XML_Char *s , int len) +{ + struct mytree *mt; + const char *b, *e; + + mt = userData; + if (mt->ignore) + return; + b = s; + e = s + len - 1; + while (isspace(*b) && b < e) + b++; + while (isspace(*e) && e > b) + e--; + if (e != b || *b) + sbuf_bcat(mt->cur->cont, b, e - b + 1); +} + +static struct mytree * +dofile(char *filename) +{ + XML_Parser parser; + struct mytree *mt; + struct stat st; + int fd; + char *p; + int i; + + parser = XML_ParserCreate(NULL); + mt = calloc(1, sizeof *mt); + mt->top = new_node(); + mt->top->name = "(top)"; + mt->top->parent = mt->top; + mt->cur = mt->top; + sbuf_finish(mt->top->key); + sbuf_finish(mt->top->cont); + XML_SetUserData(parser, mt); + XML_SetElementHandler(parser, StartElement, EndElement); + XML_SetCharacterDataHandler(parser, CharData); + fd = open(filename, O_RDONLY); + if (fd < 0) + err(1, "%s", filename); + fstat(fd, &st); + p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0); + i = XML_Parse(parser, p, st.st_size, 1); + if (i != 1) + errx(1, "XML_Parse complained -> %d", i); + munmap(p, st.st_size); + close(fd); + XML_ParserFree(parser); + sbuf_finish(mt->top->cont); + if (i) + return (mt); + else + return (NULL); +} + +static void +print_node(struct node *np) +{ + printf("\"%s\" -- \"%s\" -- \"%s\"", np->name, sbuf_data(np->cont), sbuf_data(np->key)); + if (np->id) + printf(" id=\"%s\"", np->id); + if (np->ref) + printf(" ref=\"%s\"", np->ref); + printf("\n"); +} + +#if 0 +static void +print_tree(struct node *np, int n) +{ + struct node *np1; + + indent(n); printf("%s id=%s ref=%s\n", np->name, np->id, np->ref); + LIST_FOREACH(np1, &np->children, siblings) + print_tree(np1, n + 2); +} +#endif + +static void +sort_node(struct node *np) +{ + struct node *np1, *np2; + int n; + + LIST_FOREACH(np1, &np->children, siblings) + sort_node(np1); + do { + np1 = LIST_FIRST(&np->children); + n = 0; + for (;;) { + if (np1 == NULL) + return; + np2 = LIST_NEXT(np1, siblings); + if (np2 == NULL) + return; + if (strcmp(sbuf_data(np1->key), sbuf_data(np2->key)) > 0) { + LIST_REMOVE(np2, siblings); + LIST_INSERT_BEFORE(np1, np2, siblings); + n++; + break; + } + np1 = np2; + } + } while (n); +} + +static int +refcmp(char *r1, char *r2) +{ + struct ref *r; + + LIST_FOREACH(r, &refs, next) { + if (!strcmp(r1, r->k1)) + return (strcmp(r2, r->k2)); + } + r = calloc(1, sizeof(*r)); + r->k1 = strdup(r1); + r->k2 = strdup(r2); + LIST_INSERT_HEAD(&refs, r, next); + if (fsubs != NULL) { + fprintf(fsubs, "s/%s/%s/g\n", r1, r2); + fflush(fsubs); + } + return (0); +} + +static int compare_node2(struct node *n1, struct node *n2, int in); + +static int +compare_node(struct node *n1, struct node *n2, int in) +{ + int i; + struct node *n1a, *n2a; + + i = strcmp(n1->name, n2->name); + if (i) + return (i); + if (n1->id && n2->id) + i = refcmp(n1->id, n2->id); + else if (n1->id || n2->id) + i = -1; + if (i) + return (i); + if (n1->ref && n2->ref) + i = refcmp(n1->ref, n2->ref); + else if (n1->ref || n2->ref) + i = -1; + if (i) + return (i); + if (!strcmp(n1->name, "ref")) + i = refcmp(sbuf_data(n1->cont), sbuf_data(n2->cont)); + else + i = strcmp(sbuf_data(n1->cont), sbuf_data(n2->cont)); + if (i) + return (1); + n1a = LIST_FIRST(&n1->children); + n2a = LIST_FIRST(&n2->children); + for (;;) { + if (n1a == NULL && n2a == NULL) + return (0); + if (n1a != NULL && n2a == NULL) { + printf("1>"); + indent(in); + print_node(n1a); + printf("2>\n"); + return (1); + } + if (n1a == NULL && n2a != NULL) { + printf("1>\n"); + printf("2>"); + indent(in); + print_node(n2a); + return (1); + } + i = compare_node2(n1a, n2a, in + 2); + if (i) + return (1); + n1a = LIST_NEXT(n1a, siblings); + n2a = LIST_NEXT(n2a, siblings); + } + return (0); +} + +static int +compare_node2(struct node *n1, struct node *n2, int in) +{ + int i; + + i = compare_node(n1, n2, in); + if (i) { + printf("1>"); + indent(in); + print_node(n1); + printf("2>"); + indent(in); + print_node(n2); + } + return (i); +} + + + +int +main(int argc, char **argv) +{ + struct mytree *t1, *t2; + int i; + + fsubs = fopen("_.subs", "w"); + setbuf(stdout, NULL); + setbuf(stderr, NULL); + if (argc != 3) + errx(1, "usage: %s file1 file2", argv[0]); + + t1 = dofile(argv[1]); + if (t1 == NULL) + errx(2, "XML parser error on file %s", argv[1]); + sort_node(t1->top); + t2 = dofile(argv[2]); + if (t2 == NULL) + errx(2, "XML parser error on file %s", argv[2]); + sort_node(t2->top); + i = compare_node(t1->top, t2->top, 0); + return (i); +} + diff --git a/sbin/geom/core/tests/ConfCmp/Makefile b/sbin/geom/core/tests/ConfCmp/Makefile new file mode 100644 index 0000000..ffd814e --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/Makefile @@ -0,0 +1,43 @@ +# $FreeBSD$ + +BINDIR= ${TESTSBASE}/sbin/geom/core/ConfCmp + +PROG= ConfCmp +SRCS+= ConfCmp.c +SRCS+= subr_sbuf.c + +.PATH: ${SRCTOP}/sys/kern + +# Uncomment for ElectricFence +#LDADD+= -lefence -L/usr/local/lib + +DPADD+= ${LIBBSDXML} +LDADD+= -lbsdxml + +LDFLAGS+= -static + +MAN= +CLEANFILES+= _* + +# XXX: this should be in a test script +check: .PHONY +check: ${PROG} + cd ${.CURDIR} && env PATH="$$PATH:${.OBJDIR}" ${MAKE} _check + +_check: .PHONY +_check: ${PROG} + rm -f _* *.core + cd ${.CURDIR}; ${PROG} a1.conf a1.conf + cd ${.CURDIR}; ${PROG} a1.conf a1a.conf + cd ${.CURDIR}; if ${PROG} a1.conf a1b.conf > /dev/null 2>&1 ; then exit 1 ; fi + cd ${.CURDIR}; if ${PROG} a1.conf a1c.conf > /dev/null 2>&1 ; then exit 1 ; fi + cd ${.CURDIR}; if ${PROG} a1.conf a1d.conf > /dev/null 2>&1 ; then exit 1 ; fi + cd ${.CURDIR}; ${PROG} a2.conf a2.conf + cd ${.CURDIR}; ${PROG} a2.conf a2a.conf + cd ${.CURDIR}; if ${PROG} a2.conf a2b.conf > /dev/null 2>&1 ; then exit 1 ; fi + cd ${.CURDIR}; if ${PROG} a2.conf a2c.conf > /dev/null 2>&1 ; then exit 1 ; fi + cd ${.CURDIR}; if ${PROG} a2.conf a2d.conf > /dev/null 2>&1 ; then exit 1 ; fi + +WARNS?= 5 + +.include diff --git a/sbin/geom/core/tests/ConfCmp/a1.conf b/sbin/geom/core/tests/ConfCmp/a1.conf new file mode 100644 index 0000000..94171cd --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a1.conf @@ -0,0 +1,414 @@ + + $FreeBSD$ + + 0x80712c0 + DEV-method + + 0x80bfd00 + 0x80712c0 + ad0s3d + 4 + + 0x80b9500 + 0x80bfd00 + 0x80bf880 + r0w0e0 + + + + 0x80bfc80 + 0x80712c0 + ad0s3c + 4 + + 0x80b94c0 + 0x80bfc80 + 0x80bf800 + r0w0e0 + + + + 0x80bfc00 + 0x80712c0 + ad0s3a + 4 + + 0x80b9480 + 0x80bfc00 + 0x80bf780 + r0w0e0 + + + + 0x80bfb80 + 0x80712c0 + ad0s2c + 4 + + 0x80b9440 + 0x80bfb80 + 0x80bf600 + r0w0e0 + + + + 0x80bfb00 + 0x80712c0 + ad0s1f + 4 + + 0x80b9400 + 0x80bfb00 + 0x80bf480 + r0w0e0 + + + + 0x80bfa80 + 0x80712c0 + ad0s1e + 4 + + 0x80b93c0 + 0x80bfa80 + 0x80bf400 + r0w0e0 + + + + 0x80bfa00 + 0x80712c0 + ad0s1c + 4 + + 0x80b9380 + 0x80bfa00 + 0x80bf380 + r0w0e0 + + + + 0x80bf980 + 0x80712c0 + ad0s1b + 4 + + 0x80b9340 + 0x80bf980 + 0x80bf300 + r0w0e0 + + + + 0x80bf900 + 0x80712c0 + ad0s1a + 4 + + 0x80b9300 + 0x80bf900 + 0x80bf280 + r0w0e0 + + + + 0x80bf680 + 0x80712c0 + ad0s3 + 3 + + 0x80b9280 + 0x80bf680 + 0x80bf100 + r0w0e0 + + + + 0x80bf500 + 0x80712c0 + ad0s2 + 3 + + 0x80b9200 + 0x80bf500 + 0x80bf080 + r0w0e0 + + + + 0x80bf180 + 0x80712c0 + ad0s1 + 3 + + 0x80b9180 + 0x80bf180 + 0x80bf000 + r0w0e0 + + + + 0x80b9080 + 0x80712c0 + ad0 + 2 + + 0x80b90c0 + 0x80b9080 + 0x80b9040 + r0w0e0 + + + + + 0x8071280 + MBREXT-method + + + 0x8071260 + MBR-method + + 0x80b9100 + 0x8071260 + ad0 + 2 + + + + 0x80b9140 + 0x80b9100 + 0x80b9040 + r0w0e0 + + + + + 0x80bf100 + 0x80b9100 + r0w0e0 + ad0s3 + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + 165 + + + + 0x80bf080 + 0x80b9100 + r0w0e0 + ad0s2 + + 1 + 5364817920 + 10478160 + 3220439040 + 6289920 + 165 + + + + 0x80bf000 + 0x80b9100 + r0w0e0 + ad0s1 + + 0 + 3220406784 + 6289857 + 32256 + 63 + 165 + + + + + + 0x80712a0 + BSD-method + + 0x80bf700 + 0x80712a0 + ad0s3 + 3 + + + + 0x80b92c0 + 0x80bf700 + 0x80bf100 + r0w0e0 + + + + + 0x80bf880 + 0x80bf700 + r0w0e0 + ad0s3d + + 3 + 6488104960 + 12672080 + 10682408960 + 20864080 + + + + 0x80bf800 + 0x80bf700 + r0w0e0 + ad0s3c + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + + + + 0x80bf780 + 0x80bf700 + r0w0e0 + ad0s3a + + 0 + 2097152000 + 4096000 + 8585256960 + 16768080 + + + + + 0x80bf580 + 0x80712a0 + ad0s2 + 3 + + + + 0x80b9240 + 0x80bf580 + 0x80bf080 + r0w0e0 + + + + + 0x80bf600 + 0x80bf580 + r0w0e0 + ad0s2c + + 2 + 5364817920 + 10478160 + 3220439040 + 6289920 + + + + + 0x80bf200 + 0x80712a0 + ad0s1 + 3 + + + + 0x80b91c0 + 0x80bf200 + 0x80bf000 + r0w0e0 + + + + + 0x80bf480 + 0x80bf200 + r0w0e0 + ad0s1f + + 5 + 2066973184 + 4037057 + 1153465856 + 2252863 + + + + 0x80bf400 + 0x80bf200 + r0w0e0 + ad0s1e + + 4 + 524288000 + 1024000 + 629177856 + 1228863 + + + + 0x80bf380 + 0x80bf200 + r0w0e0 + ad0s1c + + 2 + 3220406784 + 6289857 + 32256 + 63 + + + + 0x80bf300 + 0x80bf200 + r0w0e0 + ad0s1b + + 1 + 524288000 + 1024000 + 104889856 + 204863 + + + + 0x80bf280 + 0x80bf200 + r0w0e0 + ad0s1a + + 0 + 104857600 + 204800 + 32256 + 63 + + + + + + 0x80711c0 + SIMDISK-method + + 0x80b9000 + 0x80711c0 + ad0 + 1 + + 0x80b9040 + 0x80b9000 + r0w0e0 + ad0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a1a.conf b/sbin/geom/core/tests/ConfCmp/a1a.conf new file mode 100644 index 0000000..01110f3 --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a1a.conf @@ -0,0 +1,414 @@ + + $FreeBSD$ + + 0x90712c0 + DEV-method + + 0x90bfd00 + 0x90712c0 + ad0s3d + 4 + + 0x90b9500 + 0x90bfd00 + 0x90bf880 + r0w0e0 + + + + 0x90bfc80 + 0x90712c0 + ad0s3c + 4 + + 0x90b94c0 + 0x90bfc80 + 0x90bf800 + r0w0e0 + + + + 0x90bfc00 + 0x90712c0 + ad0s3a + 4 + + 0x90b9480 + 0x90bfc00 + 0x90bf780 + r0w0e0 + + + + 0x90bfb80 + 0x90712c0 + ad0s2c + 4 + + 0x90b9440 + 0x90bfb80 + 0x90bf600 + r0w0e0 + + + + 0x90bfb00 + 0x90712c0 + ad0s1f + 4 + + 0x90b9400 + 0x90bfb00 + 0x90bf480 + r0w0e0 + + + + 0x90bfa80 + 0x90712c0 + ad0s1e + 4 + + 0x90b93c0 + 0x90bfa80 + 0x90bf400 + r0w0e0 + + + + 0x90bfa00 + 0x90712c0 + ad0s1c + 4 + + 0x90b9380 + 0x90bfa00 + 0x90bf380 + r0w0e0 + + + + 0x90bf980 + 0x90712c0 + ad0s1b + 4 + + 0x90b9340 + 0x90bf980 + 0x90bf300 + r0w0e0 + + + + 0x90bf900 + 0x90712c0 + ad0s1a + 4 + + 0x90b9300 + 0x90bf900 + 0x90bf280 + r0w0e0 + + + + 0x90bf680 + 0x90712c0 + ad0s3 + 3 + + 0x90b9280 + 0x90bf680 + 0x90bf100 + r0w0e0 + + + + 0x90bf500 + 0x90712c0 + ad0s2 + 3 + + 0x90b9200 + 0x90bf500 + 0x90bf080 + r0w0e0 + + + + 0x90bf180 + 0x90712c0 + ad0s1 + 3 + + 0x90b9180 + 0x90bf180 + 0x90bf000 + r0w0e0 + + + + 0x90b9080 + 0x90712c0 + ad0 + 2 + + 0x90b90c0 + 0x90b9080 + 0x90b9040 + r0w0e0 + + + + + 0x9071280 + MBREXT-method + + + 0x9071260 + MBR-method + + 0x90b9100 + 0x9071260 + ad0 + 2 + + + + 0x90b9140 + 0x90b9100 + 0x90b9040 + r0w0e0 + + + + + 0x90bf100 + 0x90b9100 + r0w0e0 + ad0s3 + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + 165 + + + + 0x90bf080 + 0x90b9100 + r0w0e0 + ad0s2 + + 1 + 5364817920 + 10478160 + 3220439040 + 6289920 + 165 + + + + 0x90bf000 + 0x90b9100 + r0w0e0 + ad0s1 + + 0 + 3220406784 + 6289857 + 32256 + 63 + 165 + + + + + + 0x90712a0 + BSD-method + + 0x90bf700 + 0x90712a0 + ad0s3 + 3 + + + + 0x90b92c0 + 0x90bf700 + 0x90bf100 + r0w0e0 + + + + + 0x90bf880 + 0x90bf700 + r0w0e0 + ad0s3d + + 3 + 6488104960 + 12672080 + 10682408960 + 20864080 + + + + 0x90bf800 + 0x90bf700 + r0w0e0 + ad0s3c + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + + + + 0x90bf780 + 0x90bf700 + r0w0e0 + ad0s3a + + 0 + 2097152000 + 4096000 + 8585256960 + 16768080 + + + + + 0x90bf580 + 0x90712a0 + ad0s2 + 3 + + + + 0x90b9240 + 0x90bf580 + 0x90bf080 + r0w0e0 + + + + + 0x90bf600 + 0x90bf580 + r0w0e0 + ad0s2c + + 2 + 5364817920 + 10478160 + 3220439040 + 6289920 + + + + + 0x90bf200 + 0x90712a0 + ad0s1 + 3 + + + + 0x90b91c0 + 0x90bf200 + 0x90bf000 + r0w0e0 + + + + + 0x90bf480 + 0x90bf200 + r0w0e0 + ad0s1f + + 5 + 2066973184 + 4037057 + 1153465856 + 2252863 + + + + 0x90bf400 + 0x90bf200 + r0w0e0 + ad0s1e + + 4 + 524288000 + 1024000 + 629177856 + 1228863 + + + + 0x90bf380 + 0x90bf200 + r0w0e0 + ad0s1c + + 2 + 3220406784 + 6289857 + 32256 + 63 + + + + 0x90bf300 + 0x90bf200 + r0w0e0 + ad0s1b + + 1 + 524288000 + 1024000 + 104889856 + 204863 + + + + 0x90bf280 + 0x90bf200 + r0w0e0 + ad0s1a + + 0 + 104857600 + 204800 + 32256 + 63 + + + + + + 0x90711c0 + SIMDISK-method + + 0x90b9000 + 0x90711c0 + ad0 + 1 + + 0x90b9040 + 0x90b9000 + r0w0e0 + ad0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a1b.conf b/sbin/geom/core/tests/ConfCmp/a1b.conf new file mode 100644 index 0000000..46f423b --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a1b.conf @@ -0,0 +1,414 @@ + + $FreeBSD$ + + 0x80712c0 + DEV-method + + 0x80bfd00 + 0x80712c0 + ad0s3d + 4 + + 0x80b9500 + 0x80bfd00 + 0x80bf880 + r0w0e0 + + + + 0x80bfc80 + 0x80712c0 + ad0s3c + 4 + + 0x80b94c0 + 0x80bfc80 + 0x80bf800 + r0w0e0 + + + + 0x80bfc00 + 0x80712c0 + ad0s3a + 4 + + 0x80b9480 + 0x80bfc00 + 0x80bf780 + r0w0e0 + + + + 0x80bfb80 + 0x80712c0 + ad0s2c + 4 + + 0x80b9440 + 0x80bfb80 + 0x80bf600 + r0w0e0 + + + + 0x80bfb00 + 0x80712c0 + ad0s1f + 4 + + 0x80b9400 + 0x80bfb00 + 0x80bf480 + r0w0e0 + + + + 0x80bfa80 + 0x80712c0 + ad0s1e + 4 + + 0x80b93c0 + 0x80bfa80 + 0x80bf400 + r0w0e0 + + + + 0x80bfa00 + 0x80712c0 + ad0s1c + 4 + + 0x80b9380 + 0x80bfa00 + 0x80bf380 + r0w0e0 + + + + 0x80bf980 + 0x80712c0 + ad0s1b + 4 + + 0x80b9340 + 0x80bf980 + 0x80bf300 + r0w0e0 + + + + 0x80bf900 + 0x80712c0 + ad0s1a + 4 + + 0x80b9300 + 0x80bf900 + 0x80bf280 + r0w0e0 + + + + 0x80bf680 + 0x80712c0 + ad0s3 + 3 + + 0x80b9280 + 0x80bf680 + 0x80bf100 + r0w0e0 + + + + 0x80bf500 + 0x80712c0 + ad0s2 + 3 + + 0x80b9200 + 0x80bf500 + 0x80bf080 + r0w0e0 + + + + 0x80bf180 + 0x80712c0 + ad0s1 + 3 + + 0x80b9180 + 0x80bf180 + 0x80bf000 + r0w0e0 + + + + 0x80b9080 + 0x80712c0 + ad0 + 2 + + 0x80b90c0 + 0x80b9080 + 0x80b9040 + r0w0e0 + + + + + 0x8071280 + MBREXT-method + + + 0x8071260 + MBR-method + + 0x80b9100 + 0x8071260 + ad0 + 2 + + + + 0x80b9140 + 0x80b9100 + 0x80b9040 + r0w0e0 + + + + + 0x80bf100 + 0x80b9100 + r0w0e0 + ad0s3 + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + 165 + + + + 0x80bf080 + 0x80b9100 + r0w0e0 + ad0s2 + + 1 + 5364817920 + 10478160 + 3220439040 + 6289920 + 165 + + + + 0x80bf000 + 0x80b9100 + r0w0e0 + ad0s1 + + 0 + 3220406784 + 6289857 + 32256 + 63 + 165 + + + + + + 0x80712a0 + BSD-method + + 0x80bf700 + 0x80712a0 + ad0s3 + 3 + + + + 0x80b92c0 + 0x80bf700 + 0x80bf100 + r0w0e0 + + + + + 0x80bf880 + 0x80bf700 + r0w0e0 + ad0s3d + + 3 + 6488104960 + 12672080 + 10682408960 + 20864080 + + + + 0x80bf800 + 0x80bf700 + r0w0e0 + ad0s3c + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + + + + 0x80bf780 + 0x80bf700 + r0w0e0 + ad0s3a + + 0 + 2097152000 + 4096000 + 8585256960 + 16768080 + + + + + 0x80bf580 + 0x80712a0 + ad0s2 + 3 + + + + 0x80b9240 + 0x80bf580 + 0x80bf080 + r0w0e0 + + + + + 0x80bf600 + 0x80bf580 + r0w0e0 + ad0s2c + + 2 + 5364817920 + 10478160 + 3220439040 + 6289920 + + + + + 0x80bf200 + 0x80712a0 + ad0s1 + 3 + + + + 0x80b91c0 + 0x80bf200 + 0x80bf000 + r0w0e0 + + + + + 0x80bf480 + 0x80bf200 + r0w0e0 + ad0s1f + + 5 + 2066973184 + 4037057 + 1153465856 + 2252863 + + + + 0x80bf400 + 0x80bf200 + r0w0e0 + ad0s1e + + 4 + 524288000 + 1024000 + 629177856 + 1228863 + + + + 0x80bf380 + 0x80bf200 + r0w0e0 + ad0s1c + + 2 + 3220406784 + 6289857 + 32256 + 63 + + + + 0x80bf300 + 0x80bf200 + r0w0e0 + ad0s1b + + 1 + 524288000 + 1024000 + 104889856 + 204863 + + + + 0x80bf280 + 0x80bf200 + r0w0e0 + ad0s1a + + 0 + 104857600 + 204800 + 32256 + 63 + + + + + + 0x80711c0 + SIMDISK-method + + 0x80b9000 + 0x80711c0 + ad0 + 1 + + 0x80b9041 + 0x80b9000 + r0w0e0 + ad0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a1c.conf b/sbin/geom/core/tests/ConfCmp/a1c.conf new file mode 100644 index 0000000..1b5a2b9 --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a1c.conf @@ -0,0 +1,414 @@ + + $FreeBSD$ + + 0x80712c0 + DEV-method + + 0x80bfd00 + 0x80712c0 + ad0s3d + 4 + + 0x80b9500 + 0x80bfd00 + 0x80bf880 + r0w0e0 + + + + 0x80bfc80 + 0x80712c0 + ad0s3c + 4 + + 0x80b94c0 + 0x80bfc80 + 0x80bf800 + r0w0e0 + + + + 0x80bfc00 + 0x80712c0 + ad0s3a + 4 + + 0x80b9480 + 0x80bfc00 + 0x80bf780 + r0w0e0 + + + + 0x80bfb80 + 0x80712c0 + ad0s2c + 4 + + 0x80b9440 + 0x80bfb80 + 0x80bf600 + r0w0e0 + + + + 0x80bfb00 + 0x80712c0 + ad0s1f + 4 + + 0x80b9400 + 0x80bfb00 + 0x80bf480 + r0w0e0 + + + + 0x80bfa80 + 0x80712c0 + ad0s1e + 4 + + 0x80b93c0 + 0x80bfa80 + 0x80bf400 + r0w0e0 + + + + 0x80bfa00 + 0x80712c0 + ad0s1c + 4 + + 0x80b9380 + 0x80bfa00 + 0x80bf380 + r0w0e0 + + + + 0x80bf980 + 0x80712c0 + ad0s1b + 4 + + 0x80b9340 + 0x80bf980 + 0x80bf300 + r0w0e0 + + + + 0x80bf900 + 0x80712c0 + ad0s1a + 4 + + 0x80b9300 + 0x80bf900 + 0x80bf280 + r0w0e0 + + + + 0x80bf680 + 0x80712c0 + ad0s3 + 3 + + 0x80b9280 + 0x80bf680 + 0x80bf100 + r0w0e0 + + + + 0x80bf500 + 0x80712c0 + ad0s2 + 3 + + 0x80b9200 + 0x80bf500 + 0x80bf080 + r0w0e0 + + + + 0x80bf180 + 0x80712c0 + ad0s1 + 3 + + 0x80b9180 + 0x80bf180 + 0x80bf000 + r0w0e0 + + + + 0x80b9080 + 0x80712c0 + ad0 + 2 + + 0x80b90c0 + 0x80b9080 + 0x80b9040 + r0w0e0 + + + + + 0x8071280 + MBREXT-method + + + 0x8071260 + MBR-method + + 0x80b9100 + 0x8071260 + ad0 + 2 + + + + 0x80b9140 + 0x80b9100 + 0x80b9040 + r0w0e0 + + + + + 0x80bf100 + 0x80b9100 + r0w0e0 + ad0s3 + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + 165 + + + + 0x80bf080 + 0x80b9100 + r0w0e0 + ad0s2 + + 1 + 5364817920 + 10478160 + 3220439040 + 6289920 + 165 + + + + 0x80bf000 + 0x80b9100 + r0w0e0 + ad0s1 + + 0 + 3220406784 + 6289857 + 32256 + 63 + 165 + + + + + + 0x80712a0 + BSD-method + + 0x80bf700 + 0x80712a0 + ad0s3 + 3 + + + + 0x80b92c0 + 0x80bf700 + 0x80bf100 + r0w0e0 + + + + + 0x80bf880 + 0x80bf700 + r0w0e0 + ad0s3d + + 3 + 6488104960 + 12672080 + 10682408960 + 20864080 + + + + 0x80bf800 + 0x80bf700 + r0w0e0 + ad0s3c + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + + + + 0x80bf780 + 0x80bf700 + r0w0e0 + ad0s3a + + 0 + 2097152000 + 4096000 + 8585256960 + 16768080 + + + + + 0x80bf580 + 0x80712a0 + ad0s2 + 3 + + + + 0x80b9240 + 0x80bf580 + 0x80bf080 + r0w0e0 + + + + + 0x80bf600 + 0x80bf580 + r0w0e0 + ad0s2c + + 2 + 5364817920 + 10478160 + 3220439040 + 6289920 + + + + + 0x80bf200 + 0x80712a0 + ad0s1 + 3 + + + + 0x80b91c0 + 0x80bf200 + 0x80bf000 + r0w0e0 + + + + + 0x80bf480 + 0x80bf200 + r0w0e0 + ad0s1f + + 5 + 2066973184 + 4037057 + 1153465856 + 2252863 + + + + 0x80bf400 + 0x80bf200 + r0w0e0 + ad0s1e + + 4 + 524288000 + 1024000 + 629177856 + 1228863 + + + + 0x80bf380 + 0x80bf200 + r0w0e0 + ad0s1c + + 2 + 3220406784 + 6289857 + 32256 + 63 + + + + 0x80bf300 + 0x80bf200 + r0w0e0 + ad0s1b + + 1 + 524288000 + 1024000 + 104889856 + 204863 + + + + 0x80bf280 + 0x80bf200 + r0w0e0 + ad0s1a + + 0 + 104857600 + 204800 + 32256 + 63 + + + + + + 0x80711c0 + SIMDISK-method + + 0x80b9000 + 0x80711c0 + ad0 + 1 + + 0x80b9040 + 0x80b9000 + r0w0e1 + ad0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a1d.conf b/sbin/geom/core/tests/ConfCmp/a1d.conf new file mode 100644 index 0000000..a9063c5 --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a1d.conf @@ -0,0 +1,414 @@ + + $FreeBSD$ + + 0x80712c0 + DEV-method + + 0x80bfd00 + 0x80712c0 + ad0s3d + 4 + + 0x80b9500 + 0x80bfd00 + 0x80bf880 + r0w0e0 + + + + 0x80bfc80 + 0x80712c0 + ad0s3c + 4 + + 0x80b94c0 + 0x80bfc80 + 0x80bf800 + r0w0e0 + + + + 0x80bfc00 + 0x80712c0 + ad0s3a + 4 + + 0x80b9480 + 0x80bfc00 + 0x80bf780 + r0w0e0 + + + + 0x80bfb80 + 0x80712c0 + ad0s2c + 4 + + 0x80b9440 + 0x80bfb80 + 0x80bf600 + r0w0e0 + + + + 0x80bfb00 + 0x80712c0 + ad0s1f + 4 + + 0x80b9400 + 0x80bfb00 + 0x80bf480 + r0w0e0 + + + + 0x80bfa80 + 0x80712c0 + ad0s1e + 4 + + 0x80b93c0 + 0x80bfa80 + 0x80bf400 + r0w0e0 + + + + 0x80bfa00 + 0x80712c0 + ad0s1c + 4 + + 0x80b9380 + 0x80bfa00 + 0x80bf380 + r0w0e0 + + + + 0x80bf980 + 0x80712c0 + ad0s1b + 4 + + 0x80b9340 + 0x80bf980 + 0x80bf300 + r0w0e0 + + + + 0x80bf900 + 0x80712c0 + ad0s1a + 4 + + 0x80b9300 + 0x80bf900 + 0x80bf280 + r0w0e0 + + + + 0x80bf680 + 0x80712c0 + ad0s3 + 3 + + 0x80b9280 + 0x80bf680 + 0x80bf100 + r0w0e0 + + + + 0x80bf500 + 0x80712c0 + ad0s2 + 3 + + 0x80b9200 + 0x80bf500 + 0x80bf080 + r0w0e0 + + + + 0x80bf180 + 0x80712c0 + ad0s1 + 3 + + 0x80b9180 + 0x80bf180 + 0x80bf000 + r0w0e0 + + + + 0x80b9080 + 0x80712c0 + ad0 + 2 + + 0x80b90c0 + 0x80b9080 + 0x80b9040 + r0w0e0 + + + + + 0x8071280 + MBREXT-method + + + 0x8071260 + MBR-method + + 0x80b9100 + 0x8071260 + ad0 + 2 + + + + 0x80b9140 + 0x80b9100 + 0x80b9040 + r0w0e0 + + + + + 0x80bf100 + 0x80b9100 + r0w0e0 + ad0s3 + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + 165 + + + + 0x80bf080 + 0x80b9100 + r0w0e0 + ad0s2 + + 1 + 5364817920 + 10478160 + 3220439040 + 6289920 + 165 + + + + 0x80bf000 + 0x80b9100 + r0w0e0 + ad0s1 + + 0 + 3220406784 + 6289857 + 32256 + 63 + 165 + + + + + + 0x80712a0 + BSD-method + + 0x80bf700 + 0x80712a0 + ad0s3 + 3 + + + + 0x80b92c0 + 0x80bf700 + 0x80bf100 + r0w0e0 + + + + + 0x80bf880 + 0x80bf700 + r0w0e0 + ad0s3d + + 3 + 6488104960 + 12672080 + 10682408960 + 20864080 + + + + 0x80bf800 + 0x80bf700 + r0w0e0 + ad0s3c + + 2 + 8585256960 + 16768080 + 8585256960 + 16768080 + + + + 0x80bf780 + 0x80bf700 + r0w0e0 + ad0s3a + + 0 + 2097152000 + 4096000 + 8585256960 + 16768080 + + + + + 0x80bf580 + 0x80712a0 + ad0s2 + 3 + + + + 0x80b9240 + 0x80bf580 + 0x80bf080 + r0w0e0 + + + + + 0x80bf600 + 0x80bf580 + r0w0e0 + ad0s2c + + 2 + 5364817920 + 10478160 + 3220439040 + 6289920 + + + + + 0x80bf200 + 0x80712a0 + ad0s1 + 3 + + + + 0x80b91c0 + 0x80bf200 + 0x80bf000 + r0w0e0 + + + + + 0x80bf480 + 0x80bf200 + r0w0e0 + ad0s1f + + 5 + 2066973184 + 4037057 + 1153465856 + 2252863 + + + + 0x80bf400 + 0x80bf200 + r0w0e0 + ad0s1e + + 4 + 524288000 + 1024000 + 629177856 + 1228863 + + + + 0x80bf380 + 0x80bf200 + r0w0e0 + ad0s1c + + 2 + 3220406784 + 6289857 + 32256 + 63 + + + + 0x80bf300 + 0x80bf200 + r0w0e0 + ad0s1b + + 1 + 524288000 + 1024000 + 104889856 + 204863 + + + + 0x80bf280 + 0x80bf200 + r0w0e0 + ad0s1a + + 0 + 104857600 + 204800 + 32256 + 63 + + + + + + 0x80711c0 + SIMDISK-method + + 0x80b9000 + 0x80711c0 + ad0 + 1 + + 0x80b9040 + 0x80b9000 + r0w0e0 + ad0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a2.conf b/sbin/geom/core/tests/ConfCmp/a2.conf new file mode 100644 index 0000000..6688fd1 --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a2.conf @@ -0,0 +1,207 @@ + + $FreeBSD$ + + DEV-class + + + wd0s1f + 4 + + + + r0w0e0 + + + + + wd0s1e + 4 + + + + r0w0e0 + + + + + wd0s1c + 4 + + + + r0w0e0 + + + + + wd0s1b + 4 + + + + r0w0e0 + + + + + wd0s1a + 4 + + + + r0w0e0 + + + + + wd0s1 + 3 + + + + r0w0e0 + + + + + wd0 + 2 + + + + r0w0e0 + + + + + PC98-class + + + wd0 + 2 + + 8704 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1 + + 0 + 1626533888 + 3176824 + 69632 + 136 + + + + + + SUNLABEL-class + + + MBREXT-class + + + MBR-class + + + BSD-class + + + wd0s1 + 3 + + 512 + 8192 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1f + + 5 + 1390673920 + 2716160 + 235929600 + 460800 + + + + + r0w0e0 + wd0s1e + + 4 + 52428800 + 102400 + 183500800 + 358400 + + + + + r0w0e0 + wd0s1c + + 2 + 1626603520 + 3176960 + 0 + 0 + + + + + r0w0e0 + wd0s1b + + 1 + 104857600 + 204800 + 78643200 + 153600 + + + + + r0w0e0 + wd0s1a + + 0 + 78643200 + 153600 + 0 + 0 + + + + + + SIMDISK-class + + + wd0 + 1 + + + r0w0e0 + wd0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a2a.conf b/sbin/geom/core/tests/ConfCmp/a2a.conf new file mode 100644 index 0000000..3d35fe9 --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a2a.conf @@ -0,0 +1,207 @@ + + $FreeBSD$ + + DEV-class + + + wd0s1f + 4 + + + + r0w0e0 + + + + + wd0s1e + 4 + + + + r0w0e0 + + + + + wd0s1c + 4 + + + + r0w0e0 + + + + + wd0s1b + 4 + + + + r0w0e0 + + + + + wd0s1a + 4 + + + + r0w0e0 + + + + + wd0s1 + 3 + + + + r0w0e0 + + + + + wd0 + 2 + + + + r0w0e0 + + + + + PC98-class + + + wd0 + 2 + + 8704 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1 + + 0 + 1626533888 + 3176824 + 69632 + 136 + + + + + + SUNLABEL-class + + + MBREXT-class + + + MBR-class + + + BSD-class + + + wd0s1 + 3 + + 512 + 8192 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1f + + 5 + 1390673920 + 2716160 + 235929600 + 460800 + + + + + r0w0e0 + wd0s1e + + 4 + 52428800 + 102400 + 183500800 + 358400 + + + + + r0w0e0 + wd0s1c + + 2 + 1626603520 + 3176960 + 0 + 0 + + + + + r0w0e0 + wd0s1b + + 1 + 104857600 + 204800 + 78643200 + 153600 + + + + + r0w0e0 + wd0s1a + + 0 + 78643200 + 153600 + 0 + 0 + + + + + + SIMDISK-class + + + wd0 + 1 + + + r0w0e0 + wd0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a2b.conf b/sbin/geom/core/tests/ConfCmp/a2b.conf new file mode 100644 index 0000000..58c0e15 --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a2b.conf @@ -0,0 +1,207 @@ + + $FreeBSD$ + + DEV-class + + + wd0s1f + 4 + + + + r0w0e0 + + + + + wd0s1e + 4 + + + + r0w0e0 + + + + + wd0s1c + 4 + + + + r0w0e0 + + + + + wd0s1b + 4 + + + + r0w0e0 + + + + + wd0s1a + 4 + + + + r0w0e0 + + + + + wd0s1 + 3 + + + + r0w0e0 + + + + + wd0 + 2 + + + + r0w0e0 + + + + + PC98-class + + + wd0 + 2 + + 8704 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1 + + 0 + 1626533888 + 3176824 + 69632 + 136 + + + + + + SUNLABEL-class + + + MBREXT-class + + + MBR-class + + + BSD-class + + + wd0s1 + 3 + + 512 + 8192 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1f + + 5 + 1390673920 + 2716160 + 235929600 + 460800 + + + + + r0w0e0 + wd0s1e + + 4 + 52428800 + 102400 + 183500800 + 358400 + + + + + r0w0e0 + wd0s1c + + 2 + 1626603520 + 3176960 + 0 + 0 + + + + + r0w0e0 + wd0s1b + + 1 + 104857600 + 204800 + 78643200 + 153600 + + + + + r0w0e0 + wd0s1a + + 0 + 78643200 + 153600 + 0 + 0 + + + + + + SIMDISK-class + + + wd0 + 1 + + + r0w0e0 + wd0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a2c.conf b/sbin/geom/core/tests/ConfCmp/a2c.conf new file mode 100644 index 0000000..381c410 --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a2c.conf @@ -0,0 +1,206 @@ + + $FreeBSD$ + + DEV-class + + + wd0s1f + 4 + + + + r0w0e0 + + + + + wd0s1e + 4 + + + + r0w0e0 + + + + + wd0s1c + 4 + + + + r0w0e0 + + + + + wd0s1b + 4 + + + + + + + + wd0s1a + 4 + + + + r0w0e0 + + + + + wd0s1 + 3 + + + + r0w0e0 + + + + + wd0 + 2 + + + + r0w0e0 + + + + + PC98-class + + + wd0 + 2 + + 8704 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1 + + 0 + 1626533888 + 3176824 + 69632 + 136 + + + + + + SUNLABEL-class + + + MBREXT-class + + + MBR-class + + + BSD-class + + + wd0s1 + 3 + + 512 + 8192 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1f + + 5 + 1390673920 + 2716160 + 235929600 + 460800 + + + + + r0w0e0 + wd0s1e + + 4 + 52428800 + 102400 + 183500800 + 358400 + + + + + r0w0e0 + wd0s1c + + 2 + 1626603520 + 3176960 + 0 + 0 + + + + + r0w0e0 + wd0s1b + + 1 + 104857600 + 204800 + 78643200 + 153600 + + + + + r0w0e0 + wd0s1a + + 0 + 78643200 + 153600 + 0 + 0 + + + + + + SIMDISK-class + + + wd0 + 1 + + + r0w0e0 + wd0 + + + + diff --git a/sbin/geom/core/tests/ConfCmp/a2d.conf b/sbin/geom/core/tests/ConfCmp/a2d.conf new file mode 100644 index 0000000..bccaed5 --- /dev/null +++ b/sbin/geom/core/tests/ConfCmp/a2d.conf @@ -0,0 +1,211 @@ + + $FreeBSD$ + + DEV-class + + + wd0s1f + 4 + + + + r0w0e0 + + + + + wd0s1e + 4 + + + + r0w0e0 + + + + + wd0s1c + 4 + + + + r0w0e0 + + + + + wd0s1b + 4 + + + + r0w0e0 + + + + + wd0s1a + 4 + + + + r0w0e0 + + + + r0w0e0 + + + + + wd0s1 + 3 + + + + r0w0e0 + + + + + wd0 + 2 + + + + r0w0e0 + + + + + PC98-class + + + wd0 + 2 + + 8704 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1 + + 0 + 1626533888 + 3176824 + 69632 + 136 + + + + + + SUNLABEL-class + + + MBREXT-class + + + MBR-class + + + BSD-class + + + wd0s1 + 3 + + 512 + 8192 + + + + + r0w0e0 + + + + + + r0w0e0 + wd0s1f + + 5 + 1390673920 + 2716160 + 235929600 + 460800 + + + + + r0w0e0 + wd0s1e + + 4 + 52428800 + 102400 + 183500800 + 358400 + + + + + r0w0e0 + wd0s1c + + 2 + 1626603520 + 3176960 + 0 + 0 + + + + + r0w0e0 + wd0s1b + + 1 + 104857600 + 204800 + 78643200 + 153600 + + + + + r0w0e0 + wd0s1a + + 0 + 78643200 + 153600 + 0 + 0 + + + + + + SIMDISK-class + + + wd0 + 1 + + + r0w0e0 + wd0 + + + + diff --git a/sbin/geom/core/tests/Data/disk.alpha.da0.xml b/sbin/geom/core/tests/Data/disk.alpha.da0.xml new file mode 100644 index 0000000..670fcc3 --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.alpha.da0.xml @@ -0,0 +1,33 @@ + + + $FreeBSD$ + + Yet an alpha disklabel. + + 512 + 0 + 0 + 0 + 0 + + 0 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 574556820400000057444947544c202000000000000000000000000000000000 + 0000000000000000000200003f000000ff000000b2080000c13e00002eae2102 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682a22908000020000000200000008007000000000000040000 + 07081600c05f20000080070000000000010000002eae21020000000000000000 + 000000000000000000000000000000000000000000a00000c0df270000040000 + 070818006e2ef901c07f28000004000007081600000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0e0000000000000001000000000000000000000000000000c51a45ca2ad1dba8 + + + diff --git a/sbin/geom/core/tests/Data/disk.alpha2.da0.xml b/sbin/geom/core/tests/Data/disk.alpha2.da0.xml new file mode 100644 index 0000000..5b341b1 --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.alpha2.da0.xml @@ -0,0 +1,33 @@ + + + $FreeBSD$ + + alpha label which O'brien says blows up libdisk + + 512 + 0 + 0 + 0 + 0 + + 0 + + 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a + 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a + 5745568204000000000000000000000000000000000000000000000000000000 + 0000000000000000000200003f000000ff00000009020000c13e0000c9b67f00 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000005745568219cf0300002000000020000043bc0000c13e000000000000 + 08000000fc867c0004fb00000000000008000000c934020000827d0000000000 + 0100000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000005a5a5a5a5a5a5a5a5a5a5a5a + 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a + 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a + 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a + 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a + 9800000000000000020000000000000000000000000000007a13ad55a1c382b0 + + + diff --git a/sbin/geom/core/tests/Data/disk.apple.xml b/sbin/geom/core/tests/Data/disk.apple.xml new file mode 100644 index 0000000..ecdd523 --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.apple.xml @@ -0,0 +1,93 @@ + + + $FreeBSD$ + 512 + 366530560 + 0 + 0 + 0 + + 0 + + 45520200000aec68000100010000000000010000004000120001000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 512 + + 504d00000000000300000060000aec084d61634f530000000000000000000000 + 000000000000000000000000000000004170706c655f48465300000000000000 + 0000000000000000000000000000000000000000000aec08000000b700000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 1024 + + 504d000000000003000000010000003f4170706c650000000000000000000000 + 000000000000000000000000000000004170706c655f706172746974696f6e5f + 6d617000000000000000000000000000000000000000003f0000003700000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 1536 + + 504d00000000000300000040000000204d6163696e746f736800000000000000 + 000000000000000000000000000000004170706c655f44726976657234330000 + 0000000000000000000000000000000000000000000000200000007f00000000 + 000023ee0000000000000000000000000000000000007c083638303030000000 + 0000000000000000000106000000000000000001000700000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + diff --git a/sbin/geom/core/tests/Data/disk.beast.da0.xml b/sbin/geom/core/tests/Data/disk.beast.da0.xml new file mode 100644 index 0000000..96ad5f7 --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.beast.da0.xml @@ -0,0 +1,33 @@ + + + + $FreeBSD$ + alpha BSD label from beast.freebsd.org + + 512 + 0 + 0 + 0 + 0 + + 0 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 5745568204000000646130000000000000000000000000000000000000000000 + 0000000000000000000200003f000000ff0000000f020000c13e000000338100 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682594e08000020000000200000002079000000000000040000 + 0708100000130800002079000000000001000000003381000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0f0000000000000001000000000000000000000000000000fc8c1983a904da83 + + + diff --git a/sbin/geom/core/tests/Data/disk.critter.ad0.xml b/sbin/geom/core/tests/Data/disk.critter.ad0.xml new file mode 100644 index 0000000..9e93b24 --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.critter.ad0.xml @@ -0,0 +1,178 @@ + + + + $FreeBSD$ + This image contains the MBR and disklabel sectors from my Asus M1300 + laptop. + + 512 + 0 + + 0 + + fc31c08ec08ed88ed0bc007cbe1a7cbf1a06b9e601f3a4e9008a31f6bbbe07b1 + 04382f74087f7885f6757489de80c310e2ef85f67502cd1880fa80720b8a3675 + 0480c68038f272028a1489e78a74018b4c02bb007c80feff753283f9ff752d51 + 53bbaa55b441cd13722081fb55aa751af6c10174155b666a0066ff740806536a + 016a1089e6b80042eb055b59b80102cd1389fc720f81bffe0155aa750cffe3be + bc06eb11bed406eb0cbef306eb07bb0700b40ecd10ac84c075f4ebfe496e7661 + 6c696420706172746974696f6e207461626c65004572726f72206c6f6164696e + 67206f7065726174696e672073797374656d004d697373696e67206f70657261 + 74696e672073797374656d000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008001 + 0100a50fffff3f00000041295402000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 512 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 32768 + + 5745568205000000616430733100000000000000000000000000000000000000 + 0000000000000000000200003f0000001000000067970000f003000041295402 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000574556824fa608000020000000200000000020003f00000000040000 + 07081600000020003f0020000000000001000000412954023f00000000000000 + 00000000418984003fa0cf01000400000708160000a00f003f00400000040000 + 07081600000080003fa04f000004000007081600000060003fa0cf0000040000 + 070816000000a0003fa02f010004000007081600000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 64512 + + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 1073806336 + + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + + + + 1598094336 + + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f + + + + 2147548160 + + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 2671836160 + + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffff00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + diff --git a/sbin/geom/core/tests/Data/disk.empty.flp.xml b/sbin/geom/core/tests/Data/disk.empty.flp.xml new file mode 100644 index 0000000..88c603a --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.empty.flp.xml @@ -0,0 +1,12 @@ + + + + $FreeBSD$ + An empty floppy disk + + 512 + 1474560 + 18 + 2 + 80 + diff --git a/sbin/geom/core/tests/Data/disk.far.ad0.xml b/sbin/geom/core/tests/Data/disk.far.ad0.xml new file mode 100644 index 0000000..0a8d3ca --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.far.ad0.xml @@ -0,0 +1,51 @@ + + + + $FreeBSD$ + A Windows laptop. + + 512 + 0 + + 0 + + 33c08ed0bc007cfb5007501ffcbe1b7cbf1b065057b9e501f3a4cbbebe07b104 + 382c7c09751583c610e2f5cd188b148bee83c610497416382c74f6be10074eac + 3c0074fabb0700b40ecd10ebf2894625968a4604b4063c0e7411b40b3c0c7405 + 3ac4752b40c64625067524bbaa5550b441cd1358721681fb55aa7510f6c10174 + 0b8ae0885624c706a106eb1e886604bf0a00b801028bdc33c983ff057f038b4e + 25034e02cd137229be4607813efe7d55aa745a83ef057fda85f67583be2707eb + 8a9891529903460813560ae812005aebd54f74e433c0cd13ebb8000080093521 + 5633f656565250065351be1000568bf45052b800428a5624cd135a588d641072 + 0a4075014280c702e2f7f85ec3eb74496e76616c696420706172746974696f6e + 207461626c65004572726f72206c6f6164696e67206f7065726174696e672073 + 797374656d004d697373696e67206f7065726174696e672073797374656d0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000008bfc1e578bf5cb00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 0100a05304263f00000092d80800805401260befbf730cd90800340a88000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 512 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + diff --git a/sbin/geom/core/tests/Data/disk.flat.da1.xml b/sbin/geom/core/tests/Data/disk.flat.da1.xml new file mode 100644 index 0000000..2302a7c --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.flat.da1.xml @@ -0,0 +1,97 @@ + + + + $FreeBSD$ + This image contains an interesting setup: there is an MBR+BSD + but also another BSD at sector one which is valid but bogus. + + 512 + 0 + 0 + 0 + 0 + + 0 + + fc31c08ec08ed88ed0bc007cbe1a7cbf1a06b9e601f3a4e9008a31f6bbbe07b1 + 04382f74087f7885f6757489de80c310e2ef85f67502cd1880fa80720b8a3675 + 0480c68038f272028a1489e78a74018b4c02bb007c80feff753283f9ff752d51 + 53bbaa55b441cd13722081fb55aa751af6c10174155b666a0066ff740806536a + 016a1089e6b80042eb055b59b80102cd1389fc720f81bffe0155aa750cffe3be + bc06eb11bed406eb0cbef306eb07bb0700b40ecd10ac84c075f4ebfe496e7661 + 6c696420706172746974696f6e207461626c65004572726f72206c6f6164696e + 67206f7065726174696e672073797374656d004d697373696e67206f70657261 + 74696e672073797374656d000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008001 + 0100a5feffff3f0000003a612302000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 512 + + 5745568204000000534541474154452053543331383433360000000000000000 + 000000000000000000020000000800000100000072440000000800000004fb00 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682e29908000020000000200000002001000000000000040000 + 07081000000008000020010000000000010000000004fb000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000e0f100002009000004000007081000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 32256 + + eb1b9090161f666a005150065331c088f0506a1089e5e8c7008d6610cbfc31c9 + 8ec18ed98ed1bc007c89e6bf0007fec5f3a5beee7d80fa80722cb601e86700b9 + 0100bebe8db601807c04a57507e319f60480751483c610fec680fe0572e949e3 + e1be8b7deb5231d289160009b610e83500bb00908b770a01debf00b0b900ac29 + f1f3a429f930c0f3aae80300e98113fae464a80275fab0d1e664e464a80275fa + b0dfe660fbc3bb008c8b44088b4c0a0ee853ff732abe867de81c00be907de816 + 0030e4cd16c70672043412ea0000ffffbb0700b40ecd10ac84c075f4b401f9c3 + 52b408cd1388f55a72f580e13f74edfa668b460852660fb6d96631d266f7f388 + eb88d54330d266f7f388d75a663dff030000fb774486c4c0c80208e8409188fe + 28e08a660238e0720288e0bf0500c45e0450b402cd135b730a4f741c30e4cd13 + 93ebeb0fb6c30146087303ff460ad0e3005e052846027788c32ef6069908800f + 8479ffbbaa5552b441cd135a0f826fff81fb55aa0f8564fff6c1010f845dff89 + eeb442cd13c35265616400426f6f7400206572726f720d0a0080909090909090 + 9090909090909090909090909090909090909090909090909090909090900000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000080000100a5ffffff0000000050c3000055aa + + + + 32768 + + 5745568204000000646131733100000000000000000000000000000000000000 + 0000000000000000000200003f000000ff000000b8080000c13e00003a612302 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000005745568233c408000020000000200000000000000000000000000000 + 0000000000800c003f800c0000000000010000003a6123023f00000000000000 + 000000000000000000000000000000000000000000800c003f00000000040000 + 07081600000020003f00190000040000070816003a61ea013f00390000040000 + 0708160000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + diff --git a/sbin/geom/core/tests/Data/disk.kern.flp.xml b/sbin/geom/core/tests/Data/disk.kern.flp.xml new file mode 100644 index 0000000..6640c48 --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.kern.flp.xml @@ -0,0 +1,51 @@ + + + + $FreeBSD$ + A FreeBSD kern.flp image. + + 512 + 0 + + 0 + + eb1b9090161f666a005150065331c088f0506a1089e5e8c7008d6610cbfc31c9 + 8ec18ed98ed1bc007c89e6bf0007fec5f3a5beee7d80fa80722cb601e86700b9 + 0100bebe8db601807c04a57507e319f60480751483c610fec680fe0572e949e3 + e1be8b7deb5231d289160009b610e83500bb00908b770a01debf00b0b900ac29 + f1f3a429f930c0f3aae80300e98113fae464a80275fab0d1e664e464a80275fa + b0dfe660fbc3bb008c8b44088b4c0a0ee853ff732abe867de81c00be907de816 + 0030e4cd16c70672043412ea0000ffffbb0700b40ecd10ac84c075f4b401f9c3 + 52b408cd1388f55a72f580e13f74edfa668b460852660fb6d96631d266f7f388 + eb88d54330d266f7f388d75a663dff030000fb774486c4c0c80208e8409188fe + 28e08a660238e0720288e0bf0500c45e0450b402cd135b730a4f741c30e4cd13 + 93ebeb0fb6c30146087303ff460ad0e3005e052846027788c32ef6069908800f + 8479ffbbaa5552b441cd135a0f826fff81fb55aa0f8564fff6c1010f845dff89 + eeb442cd13c35265616400426f6f7400206572726f720d0a0080909090909090 + 9090909090909090909090909090909090909090909090909090909090900000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000080000100a5ffffff0000000050c3000055aa + + + + 512 + + 5745568200000000666431343430000000000000000000000000000000000000 + 00000000000000000002000012000000020000005000000024000000400b0000 + 00000000000000002c0101000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682286903000020000000200000400b00000000000000020000 + 00080000400b0000000000000002000000080000400b00000000000000020000 + 0708060000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + diff --git a/sbin/geom/core/tests/Data/disk.msdos.ext.xml b/sbin/geom/core/tests/Data/disk.msdos.ext.xml new file mode 100644 index 0000000..868a88f7 --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.msdos.ext.xml @@ -0,0 +1,534 @@ + + + + $FreeBSD$ + A MSDOS 6.22 disk with maximal number of extended partitions. + + 512 + 0 + + 0 + + fa33c08ed0bc007c8bf45007501ffbfcbf0006b90001f2a5ea1d060000bebe07 + b304803c80740e803c00751c83c610fecb75efcd188b148b4c028bee83c610fe + cb741a803c0074f4be8b06ac3c00740b56bb0700b40ecd105eebf0ebfebf0500 + bb007cb8010257cd135f730c33c0cd134f75edbea306ebd3bec206bffe7d813d + 55aa75c78bf5ea007c0000496e76616c696420706172746974696f6e20746162 + 6c65004572726f72206c6f6164696e67206f7065726174696e67207379737465 + 6d004d697373696e67206f7065726174696e672073797374656d000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008001 + 010006fe7f043f00000086fa3f000000410505fe7f38c5fa3f0034bf0c000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 512 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 2146798080 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410501fe7f053f000000823e00000000410605fe7f06c13e0000c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2155023360 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410601fe7f063f000000823e00000000410705fe7f07827d0000c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2163248640 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410701fe7f073f000000823e00000000410805fe7f0843bc0000c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2171473920 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410801fe7f083f000000823e00000000410905fe7f0904fb0000c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2179699200 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410901fe7f093f000000823e00000000410a05fe7f0ac5390100c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2187924480 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410a01fe7f0a3f000000823e00000000410b05fe7f0b86780100c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2196149760 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410b01fe7f0b3f000000823e00000000410c05fe7f0c47b70100c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2204375040 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410c01fe7f0c3f000000823e00000000410d05fe7f0d08f60100c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2212600320 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410d01fe7f0d3f000000823e00000000410e05fe7f0ec9340200c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2220825600 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410e01fe7f0e3f000000823e00000000410f05fe7f0f8a730200c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2229050880 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 410f01fe7f0f3f000000823e00000000411005fe7f104bb20200c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2237276160 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411001fe7f103f000000823e00000000411105fe7f110cf10200c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2245501440 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411101fe7f113f000000823e00000000411205fe7f12cd2f0300c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2253726720 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411201fe7f123f000000823e00000000411305fe7f138e6e0300c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2261952000 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411301fe7f133f000000823e00000000411405fe7f144fad0300c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2270177280 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411401fe7f143f000000823e00000000411505fe7f1510ec0300c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2278402560 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411501fe7f153f000000823e00000000411605fe7f16d12a0400c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2286627840 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411601fe7f163f000000823e00000000411705fe7f1792690400c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2294853120 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411701fe7f173f000000823e00000000411805fe7f1853a80400c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2303078400 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411801fe7f183f000000823e00000000411905fe7f1914e70400c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2311303680 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411901fe7f193f000000823e00000000411a05fe7f1ad5250500c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2319528960 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411a01fe7f1a3f000000823e00000000411b05fe7f1b96640500c13e00000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + + 2327754240 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000001 + 411b01fe7f1b3f000000823e0000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000055aa + + + diff --git a/sbin/geom/core/tests/Data/disk.msdos.flp.xml b/sbin/geom/core/tests/Data/disk.msdos.flp.xml new file mode 100644 index 0000000..d057d1a --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.msdos.flp.xml @@ -0,0 +1,51 @@ + + + + $FreeBSD$ + A MSDOS floppy image. + + 512 + 0 + + 0 + + eb3c904d53444f53352e30000201010002e000400bf009001200020000000000 + 0000000000002911053b114e4f204e414d45202020204641543132202020fa33 + c08ed0bc007c1607bb780036c5371e561653bf3e7cb90b00fcf3a4061fc645fe + 0f8b0e187c884df9894702c7073e7cfbcd13727933c03906137c74088b0e137c + 890e207ca0107cf726167c03061c7c13161e7c03060e7c83d200a3507c891652 + 7ca3497c89164b7cb82000f726117c8b1e0b7c03c348f7f30106497c83164b7c + 00bb00058b16527ca1507ce89200721db001e8ac0072168bfbb90b00bee67df3 + a6750a8d7f20b90b00f3a67418be9e7de85f0033c0cd165e1f8f048f4402cd19 + 585858ebe88b471a48488a1e0d7c32fff7e30306497c13164b7cbb0007b90300 + 505251e83a0072d8b001e85400595a5872bb05010083d200031e0b7ce2e28a2e + 157c8a16247c8b1e497ca14b7cea00007000ac0ac07429b40ebb0700cd10ebf2 + 3b16187c7319f736187cfec288164f7c33d2f7361a7c8816257ca34d7cf8c3f9 + c3b4028b164d7cb106d2e60a364f7c8bca86e98a16247c8a36257ccd13c30d0a + 4e6f6e2d53797374656d206469736b206f72206469736b206572726f720d0a52 + 65706c61636520616e6420707265737320616e79206b6579207768656e207265 + 6164790d0a00494f2020202020205359534d53444f53202020535953000055aa + + + + 512 + + f0ffff03400005600007800009a0000bc0000de0000f00011120011340011560 + 0117800119a0011bc0011de0011f000221200223400225600227800229a0022b + c0022de0022f000331200333400335600337800339a0033bc0033de0033f0004 + 41200443400445600447800449a0044bc0044de0044f000551f0ff5340055560 + 0557800559a0055bc0055de0055f000661200663400665600667800669a0066b + c0066de0066f000771200773400775600777800779a0077bc0077de0077f0008 + 81200883400885600887800889a0088bc0088de0088f00099120099340099560 + 0997800999a0099bc009ffef099f000aa1200aa3400aa5600aa7800aa9a00aab + c00aade00aaf000bb1200bb3400bb5600bb7800bb9a00bbbc00bbde00bbf000c + c1200cc3400cc5600cc7800cc9a00ccbc00ccde00ccf000dd1200dd3400dd560 + 0dd7800dd9a00ddbc00ddde00ddf000ee1200ee3400ee5600ee7800ee9a00eeb + c00eede00eef000ff1200ff3400ff5600ff7800ff9a00ffbc00ffde00fff0010 + 01211003411005611007f1ff09a1100bc1100de1100f01111121111341111561 + 1117811119a1111bc1111de1111f011221211223411225611227811229a1122b + c1122de1122f011331211333411335611337811339a1133bc1133de1133f0114 + 41211443411445611447811449a1144bc1144de1144f01155121155341155561 + + + diff --git a/sbin/geom/core/tests/Data/disk.pc98.wdc0.xml b/sbin/geom/core/tests/Data/disk.pc98.wdc0.xml new file mode 100644 index 0000000..6bae97f --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.pc98.wdc0.xml @@ -0,0 +1,75 @@ + + + $FreeBSD$ + + A PC98 disklabel from Warner + + 512 + 0 + 17 + 8 + 0 + + 0 + + e9fd009049504c310000001ea08405b48ecd1ba820742232dbb414cd1b721a80 + fb847515e896007303eb6b90b424bb0004b93012ba4001cd1bbb0001b484cd1b + b40633c933d2508cc82dc0038ec05833edcd1b7241b406ba010081c50008cd1b + 7234ba0400f7c300aa7403ba0200b406bb001c81c50008cd1b721b508bc5b104 + d3e88cc103c18bf058e815002e89360a002eff1e0800e80800b40ecd1bb90100 + cb56a0840532dbb414cd1b720e80fb8475092ec606d40000e802005ec3b4b0be + d000ba06001e0e1fcd1bb4b0cd1b1fc31e000000010000000000000000000000 + 000000000000000000000000000000000000000000000000000000000d0055aa + fa601e066800d81f33f6b51e813c8b46750e817c0204eb7507817c05b4007405 + 46e2e9eb6032ff8a5c040358f18d7c03be9a012e015c03b00cba6104eeb002ba + 3d05ee68009807b95b00f32ea4b9ff0f33f633d226ad02f402d0e2f8f6def6da + 268914b416b3c2e4f0a840750680cc2080cb048ac3ba3f04ee8ac4ba3d05eeb0 + 08ba6104ee071f612ec7060000eb0a2ec70602009090fbe966fec390e8ebffb9 + 21007402b1118bc1f6660702460612e5912ef66703f7660403c183d200c3fec2 + 26881605205926880e0a20c390909090905191b81100502ef6670291f7f126a3 + 0220599233d2f7f12680260420f02608060420ebc9000000000080010d0055aa + + + + 512 + + 94c4000000000100000001000000405b46726565425344000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 70144 + + 5745568205000000776430733100000000000000000000000000000000000000 + 0000000000000000000200001100000008000000415b000088000000887a3000 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000005745568295f208000020000000200000005802008800000000000000 + 0700000000200300885802000000000001000000007a30008800000000000000 + 0000000000000000000000000000000000000000009001008878050000000000 + 0700000000722900880807000000000007000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + diff --git a/sbin/geom/core/tests/Data/disk.sun.da0.xml b/sbin/geom/core/tests/Data/disk.sun.da0.xml new file mode 100644 index 0000000..826581f --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.sun.da0.xml @@ -0,0 +1,33 @@ + + + + $FreeBSD$ + A Solaris 8 disklabel + + 512 + 0 + 0 + 0 + 0 + + 0 + + 49424d2d444459532d5433363935304d2d533936482063796c20313439373020 + 616c742032206864203132207365632033393900000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000100000000000000000008000200000003000100050000000000000000 + 0000000000000000000000080000003f000000000000000000000000600ddeee + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000027103a7c00000000000000013a7a0002000c018f00000000000000dc + 002d96c000000000001012b0000000000445b1c8000000000000000000000000 + 00000000000000000000000000000000000000000000034c04080858dabe5ec8 + + + diff --git a/sbin/geom/core/tests/Data/disk.sun.da1.xml b/sbin/geom/core/tests/Data/disk.sun.da1.xml new file mode 100644 index 0000000..0aac8e5 --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.sun.da1.xml @@ -0,0 +1,33 @@ + + + + $FreeBSD$ + A Solaris 8 disklabel + + 512 + 0 + 0 + 0 + 0 + + 0 + + 53554e3138472063796c203735303620616c7420322068642031392073656320 + 3234380000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000170686b00000000000008000200000003000100050000000800010000 + 00000007000000040000000800000000000000000000000000000000600ddeee + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000001c201d5400000000000000011d520002001300f80000000000000000 + 0007d6480000006d0020113000000000021bad5000000b4e014b873800000000 + 000000000000022b00400ff8000005a600400ff80000092100280c48dabe971e + + + diff --git a/sbin/geom/core/tests/Data/disk.typo.ad0.xml b/sbin/geom/core/tests/Data/disk.typo.ad0.xml new file mode 100644 index 0000000..56383ab --- /dev/null +++ b/sbin/geom/core/tests/Data/disk.typo.ad0.xml @@ -0,0 +1,219 @@ + + + + $FreeBSD$ + A multislice FreeBSD disk + + 512 + 0 + + 0 + + fc31c08ec08ed88ed0bc007cbd000a89efb108f3abfe45f252bb000689eeb802 + 02e82e015ae9008af686bbfd20750484d278048a96bafd885600e8fc0052bbc2 + 0731d2886ffc0fa396bbfd731c8a07bf0f08b103f2ae7411b10df2ae750481c7 + 0d008a0d01cfe8c1004280c31073d4582c7f3a067504720548740e30c004b088 + 86b8fdbfb207e8a100be0308e8ad008a96b9fd4ee8880030e4cd1a89d703bebc + fdb401cd16751330e4cd1a39fa72f28a86b9fdeb15b007e88e0030e4cd1688e0 + 3c1c74eb2c3b3c0477eb980fa3460c73e48886b9fdbe000a8a1489f33c049c74 + 0ac0e00405be0793c6078053f686bbfd407509bb0006b80103e856005e9d7507 + 8a96b8fd80ea30bb007cb80102e8420072a381bffe0155aa759be81c00ffe3b0 + 46e82400b03100d0eb170fab560cbe0008e8ebff89fee80300be0d08aca88075 + 05e80400ebf6247f53bb0700b40ecd105bc38a74018b4c025689e780feff7540 + 83f9ff753bf686bbfd8074345153bbaa5550b441cd1358720e81fb55aa7508f6 + c101740380cc405b59f6c4407412666a0066ff740806536a006a1089e6864402 + cd1389fc5ec39090909090909090909001014472697665200000808fb6008001 + 0100a5ef7f9f3f000000c1f95f00000041a0a5efffff00fa5f0050e29f0000ff + ffffa5efffff50dcff0050dcff000000000000000000000000000000000055aa + + + + 512 + + 2020a00a44656661756c743aa00d8a00050f010406070b0c0e6383a5a6a9b70e + 141312141d1c1b2124282e3439556e6b6e6f77ee444fd357696e646f7773204e + d457696e646f77f3554e49d84c696e75f8467265654253c44f70656e4253c44e + 65744253c44253442f4fd3000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 32768 + + 5745568205000000616430733100000000000000000000000000000000000000 + 0000000000000000000200003f000000f0000000180a0000103b000080295402 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000005745568204c108000020000000200000002003003f00000000000000 + 0700000000a00f003f2003000000000001000000c1f95f003f00000000000000 + 000000000000000000000000000000000000000000a00f003fc0120000000000 + 07000000c1993d003f6022000000000007000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 64512 + + 0000007c0000010002000400f8ff0000000400f8000000000000000000000004 + 0000004000000008000000000010007e00800000070000fe1f00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 104922112 + + 3310f30d0350fbf66f44ebd906c9963d46b2bf609bb753131e7c24cf9ed194ce + a59117b612772b207ddcb753df72456f98d0cac567f60526c7b9308afd87e657 + dd45b3d1eb075b6820aa6ea5a0f10511f65a257f0d7d89d88e189bef43786ff5 + a0316511a7a07168f2ef001e71fbc56dd8ddc7866c4856dc979742be22f4badd + e1fcba7aebe4b5f4bb8b0c89e84de59f0ba48d7a8b00bb1797fc057e3d3d8058 + 4b1987ac49b74bed74cb4985850d5be64e8188d40ad0323165b355c512a91523 + 5d5211eeb021c754f552b160f9a73c4c5e59370163cf531ca0382cc462f9ac9d + 35612380f7a5d9d5e3bde129ef6fab02347088025d0937fb6c56dc68c283ce9d + 1cfc5b3c7ad1f52faeae05188386cb57cb88c5dccaa2db17a09420ae7d9f9d6e + 058370711f445cff4d4543ee9f0c3054400116304018f68d9c08d05b04680162 + 23172b8b1775157790fe5e5100c530e3377d383a0080468b0125e87e8d7dee5f + 46030a238dc8a0000cb4eafc6ad4735f2c16d1642e3834aefbb5bfc25fcc0062 + 3a89410ab88839e3ed151cd6bc2b5704c5db4c9fc39662bd3a41347212c664be + 04684e551c0a0362bb3139a460a7c8d178c349a47d724b7d456606b2f47a8d99 + d4af7998148ed93443a828ece96cdb7eb158a21189ed1527bdad7b18b74f168b + d01fcfde994977174e41ad8f6ea19fac8bb95e5d68643d0457d746cf32531639 + + + + 629210112 + + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 1153498112 + + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 3220439552 + + 5745568205000000616430733200000000000000000000000000000000000000 + 0000000000000000000200003f000000f0000000180a0000103b000080295402 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682fc1908000020000000200000000000000000000000000000 + 000000000000000000000000000000000000000050e29f0000fa5f0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + + 6440878080 + + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a3c4120200a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a + 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a687265663d22687474703a2f2f777777 + 2e706c6179626f7973746f72652e636f6d2f70626c696e6b2e6367693f616666 + 696c696174653d4d4f3130303030303034353426736b753d4249303130362220 + 7461726765743d225f626c616e6b22206f6e6d6f7573656f7665723d22706172 + 656e742e77696e646f772e7374617475733d27506c6179626f792053746f7265 + 273b2072657475726e2074727565223e3c494d47207372633d22687474703a2f + 2f61313833322e672e616b2e706c6179626f792e636f6d2f372f313833322f32 + 332f3939303232313437302f7777772e706c6179626f792e636f6d2f6d616761 + 7a696e652f63757272656e742f696d782f636f7665725f696e6465782e6a7067 + 2220616c69676e3d72696768742077696474683d223135302220686569676874 + + + + 8585257472 + + 5745568205000000616430733300000000000000000000000000000000000000 + 0000000000000000000200003f000000f000000055040000103b000050dcff00 + 0000000000000000100e01000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000057455682bcbd0800002000000020000000803e0050dcff0000040000 + 070816000000000000000000000000000000000050dcff0050dcff0000000000 + 00000000505cc100505c3e010010000007049f00000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + + + diff --git a/sbin/geom/core/tests/MdLoad/Makefile b/sbin/geom/core/tests/MdLoad/Makefile new file mode 100644 index 0000000..27cf94b --- /dev/null +++ b/sbin/geom/core/tests/MdLoad/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +BINDIR= ${TESTSBASE}/sbin/geom/core/MdLoad + +PROG= MdLoad + +DPADD= ${LIBSBUF} ${LIBBSDXML} +LDADD= -lsbuf -lbsdxml + +MAN= + +WARNS?= 4 + +check: .PHONY +check: ${PROG} + ./${PROG} md34 ../Data/disk.critter.ad0.xml + +.include diff --git a/sbin/geom/core/tests/MdLoad/MdLoad.c b/sbin/geom/core/tests/MdLoad/MdLoad.c new file mode 100644 index 0000000..c2e5a8a --- /dev/null +++ b/sbin/geom/core/tests/MdLoad/MdLoad.c @@ -0,0 +1,271 @@ +/*- + * Copyright (c) 2003 Poul-Henning Kamp + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Poul-Henning Kamp + * and NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct sector { + LIST_ENTRY(sector) sectors; + off_t offset; + unsigned char *data; +}; + +struct simdisk_softc { + int sectorsize; + off_t mediasize; + off_t lastsector; + LIST_HEAD(,sector) sectors; + struct sbuf *sbuf; + struct sector *sp; + u_int fwsectors; + u_int fwheads; + u_int fwcylinders; +}; + +static void +g_simdisk_insertsector(struct simdisk_softc *sc, struct sector *dsp) +{ + struct sector *dsp2, *dsp3; + + if (sc->lastsector < dsp->offset) + sc->lastsector = dsp->offset; + if (LIST_EMPTY(&sc->sectors)) { + LIST_INSERT_HEAD(&sc->sectors, dsp, sectors); + return; + } + dsp3 = NULL; + LIST_FOREACH(dsp2, &sc->sectors, sectors) { + dsp3 = dsp2; + if (dsp2->offset > dsp->offset) { + LIST_INSERT_BEFORE(dsp2, dsp, sectors); + return; + } + } + LIST_INSERT_AFTER(dsp3, dsp, sectors); +} + +static void +startElement(void *userData, const char *name, const char **atts __unused) +{ + struct simdisk_softc *sc; + + sc = userData; + if (!strcasecmp(name, "sector")) { + sc->sp = calloc(1, sizeof(*sc->sp) + sc->sectorsize); + sc->sp->data = (u_char *)(sc->sp + 1); + } + sbuf_clear(sc->sbuf); +} + +static void +endElement(void *userData, const char *name) +{ + struct simdisk_softc *sc; + char *p; + u_char *q; + int i, j; + off_t o; + + sc = userData; + + if (!strcasecmp(name, "comment")) { + sbuf_clear(sc->sbuf); + return; + } + sbuf_finish(sc->sbuf); + if (!strcasecmp(name, "sectorsize")) { + sc->sectorsize = strtoul(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on sectorsize"); + } else if (!strcasecmp(name, "mediasize")) { + o = strtoull(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on mediasize"); + if (o > 0) + sc->mediasize = o; + } else if (!strcasecmp(name, "fwsectors")) { + sc->fwsectors = strtoul(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on fwsectors"); + } else if (!strcasecmp(name, "fwheads")) { + sc->fwheads = strtoul(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on fwheads"); + } else if (!strcasecmp(name, "fwcylinders")) { + sc->fwcylinders = strtoul(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on fwcylinders"); + } else if (!strcasecmp(name, "offset")) { + sc->sp->offset= strtoull(sbuf_data(sc->sbuf), &p, 0); + if (*p != '\0') + errx(1, "strtoul croaked on offset"); + } else if (!strcasecmp(name, "fill")) { + j = strtoul(sbuf_data(sc->sbuf), NULL, 16); + memset(sc->sp->data, j, sc->sectorsize); + } else if (!strcasecmp(name, "hexdata")) { + q = sc->sp->data; + p = sbuf_data(sc->sbuf); + for (i = 0; i < sc->sectorsize; i++) { + if (!isxdigit(*p)) + errx(1, "I croaked on hexdata %d:(%02x)", i, *p); + if (isdigit(*p)) + j = (*p - '0') << 4; + else + j = (tolower(*p) - 'a' + 10) << 4; + p++; + if (!isxdigit(*p)) + errx(1, "I croaked on hexdata %d:(%02x)", i, *p); + if (isdigit(*p)) + j |= *p - '0'; + else + j |= tolower(*p) - 'a' + 10; + p++; + *q++ = j; + } + } else if (!strcasecmp(name, "sector")) { + g_simdisk_insertsector(sc, sc->sp); + sc->sp = NULL; + } else if (!strcasecmp(name, "diskimage")) { + } else if (!strcasecmp(name, "FreeBSD")) { + } else { + printf("<%s>[[%s]]\n", name, sbuf_data(sc->sbuf)); + } + sbuf_clear(sc->sbuf); +} + +static void +characterData(void *userData, const XML_Char *s, int len) +{ + const char *b, *e; + struct simdisk_softc *sc; + + sc = userData; + b = s; + e = s + len - 1; + while (isspace(*b) && b < e) + b++; + while (isspace(*e) && e > b) + e--; + if (e != b || !isspace(*b)) + sbuf_bcat(sc->sbuf, b, e - b + 1); +} + +static struct simdisk_softc * +g_simdisk_xml_load(const char *file) +{ + XML_Parser parser = XML_ParserCreate(NULL); + struct stat st; + char *p; + struct simdisk_softc *sc; + int fd, i; + + sc = calloc(1, sizeof *sc); + sc->sbuf = sbuf_new_auto(); + LIST_INIT(&sc->sectors); + XML_SetUserData(parser, sc); + XML_SetElementHandler(parser, startElement, endElement); + XML_SetCharacterDataHandler(parser, characterData); + + fd = open(file, O_RDONLY); + if (fd < 0) + err(1, "%s", file); + fstat(fd, &st); + p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0); + i = XML_Parse(parser, p, st.st_size, 1); + if (i != 1) + errx(1, "XML_Parse complains: return %d", i); + munmap(p, st.st_size); + close(fd); + XML_ParserFree(parser); + return (sc); +} + +int +main(int argc, char **argv) +{ + struct simdisk_softc *sc; + char buf[BUFSIZ]; + int error, fd; + struct sector *dsp; + + if (argc != 3) + errx(1, "Usage: %s mddevice xmlfile", argv[0]); + + sc = g_simdisk_xml_load(argv[2]); + if (sc->mediasize == 0) + sc->mediasize = sc->lastsector + sc->sectorsize * 10; + if (sc->sectorsize == 0) + sc->sectorsize = 512; + sprintf(buf, "mdconfig -a -t malloc -s %jd -S %d", + (intmax_t)sc->mediasize / sc->sectorsize, sc->sectorsize); + if (sc->fwsectors && sc->fwheads) + sprintf(buf + strlen(buf), " -x %d -y %d", + sc->fwsectors, sc->fwheads); + sprintf(buf + strlen(buf), " -u %s", argv[1]); + error = system(buf); + if (error) + return (error); + fd = open(argv[1], O_RDWR); + if (fd < 0 && errno == ENOENT) { + sprintf(buf, "%s%s", _PATH_DEV, argv[1]); + fd = open(buf, O_RDWR); + } + if (fd < 0) + err(1, "Could not open %s", argv[1]); + LIST_FOREACH(dsp, &sc->sectors, sectors) { + lseek(fd, dsp->offset, SEEK_SET); + error = write(fd, dsp->data, sc->sectorsize); + if (error != sc->sectorsize) + err(1, "write sectordata failed"); + } + close(fd); + exit (0); +} diff --git a/sbin/geom/core/tests/Ref/disk.alpha.da0.xml b/sbin/geom/core/tests/Ref/disk.alpha.da0.xml new file mode 100644 index 0000000..a300f0d --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.alpha.da0.xml @@ -0,0 +1,7 @@ +$FreeBSD$ +/dev/md34 512 5120 10 +/dev/md34a 512 251658240 491520 +/dev/md34b 512 1086291968 2121664 +/dev/md34c 512 18309995520 35761710 +/dev/md34e 512 20971520 40960 +/dev/md34f 512 16951073792 33107566 diff --git a/sbin/geom/core/tests/Ref/disk.alpha2.da0.xml b/sbin/geom/core/tests/Ref/disk.alpha2.da0.xml new file mode 100644 index 0000000..7ef7573 --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.alpha2.da0.xml @@ -0,0 +1,5 @@ +$FreeBSD$ +/dev/md34 512 5120 10 +/dev/md34a 512 24675840 48195 +/dev/md34b 512 4178442240 8161020 +/dev/md34c 512 74027520 144585 diff --git a/sbin/geom/core/tests/Ref/disk.apple.xml b/sbin/geom/core/tests/Ref/disk.apple.xml new file mode 100644 index 0000000..a2a0f98 --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.apple.xml @@ -0,0 +1,5 @@ +$FreeBSD$ +/dev/md34 512 366530560 715880 +/dev/md34s1 512 366481408 715784 +/dev/md34s2 512 32256 63 +/dev/md34s3 512 16384 32 diff --git a/sbin/geom/core/tests/Ref/disk.beast.da0.xml b/sbin/geom/core/tests/Ref/disk.beast.da0.xml new file mode 100644 index 0000000..b6aa32e --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.beast.da0.xml @@ -0,0 +1,5 @@ +$FreeBSD$ +/dev/md34 512 5120 10 +/dev/md34a 512 4064280576 7938048 +/dev/md34b 512 270925824 529152 +/dev/md34c 512 4335206400 8467200 diff --git a/sbin/geom/core/tests/Ref/disk.critter.ad0.xml b/sbin/geom/core/tests/Ref/disk.critter.ad0.xml new file mode 100644 index 0000000..0620bfe --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.critter.ad0.xml @@ -0,0 +1,11 @@ +$FreeBSD$ +/dev/md34 512 2671841280 5218440 +/dev/md34s1 512 20003848704 39070017 +/dev/md34s1a 512 1073741824 2097152 +/dev/md34s1b 512 1073741824 2097152 +/dev/md34s1c 512 20003848704 39070017 +/dev/md34s1d 512 4447175168 8685889 +/dev/md34s1e 512 524288000 1024000 +/dev/md34s1f 512 4294967296 8388608 +/dev/md34s1g 512 3221225472 6291456 +/dev/md34s1h 512 5368709120 10485760 diff --git a/sbin/geom/core/tests/Ref/disk.empty.flp.xml b/sbin/geom/core/tests/Ref/disk.empty.flp.xml new file mode 100644 index 0000000..659b416 --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.empty.flp.xml @@ -0,0 +1,2 @@ +$FreeBSD$ +/dev/md34 512 1474560 2880 80 2 18 diff --git a/sbin/geom/core/tests/Ref/disk.far.ad0.xml b/sbin/geom/core/tests/Ref/disk.far.ad0.xml new file mode 100644 index 0000000..629816a --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.far.ad0.xml @@ -0,0 +1,4 @@ +$FreeBSD$ +/dev/md34 512 5632 11 +/dev/md34s1 512 296821760 579730 +/dev/md34s2 512 4564740096 8915508 diff --git a/sbin/geom/core/tests/Ref/disk.flat.da1.xml b/sbin/geom/core/tests/Ref/disk.flat.da1.xml new file mode 100644 index 0000000..89e2df4 --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.flat.da1.xml @@ -0,0 +1,12 @@ +$FreeBSD$ +/dev/md34 512 37888 74 +/dev/md34a 512 37748736 73728 +/dev/md34b 512 268435456 524288 +/dev/md34c 512 8422686720 16450560 +/dev/md34h 512 8115978240 15851520 +/dev/md34s1 512 18367017984 35873082 +/dev/md34s1b 512 419430400 819200 +/dev/md34s1c 512 18367017984 35873082 +/dev/md34s1e 512 419430400 819200 +/dev/md34s1f 512 1073741824 2097152 +/dev/md34s1g 512 16454415360 32137530 diff --git a/sbin/geom/core/tests/Ref/disk.kern.flp.xml b/sbin/geom/core/tests/Ref/disk.kern.flp.xml new file mode 100644 index 0000000..6ff67a0 --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.kern.flp.xml @@ -0,0 +1,5 @@ +$FreeBSD$ +/dev/md34 512 5632 11 +/dev/md34a 512 1474560 2880 +/dev/md34b 512 1474560 2880 +/dev/md34c 512 1474560 2880 diff --git a/sbin/geom/core/tests/Ref/disk.msdos.ext.xml b/sbin/geom/core/tests/Ref/disk.msdos.ext.xml new file mode 100644 index 0000000..dc2aced --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.msdos.ext.xml @@ -0,0 +1,27 @@ +$FreeBSD$ +/dev/md34 512 2327759360 4546405 +/dev/md34s1 512 2146765824 4192902 +/dev/md34s10 512 8193024 16002 +/dev/md34s11 512 8193024 16002 +/dev/md34s12 512 8193024 16002 +/dev/md34s13 512 8193024 16002 +/dev/md34s14 512 8193024 16002 +/dev/md34s15 512 8193024 16002 +/dev/md34s16 512 8193024 16002 +/dev/md34s17 512 8193024 16002 +/dev/md34s18 512 8193024 16002 +/dev/md34s19 512 8193024 16002 +/dev/md34s2 512 427714560 835380 +/dev/md34s20 512 8193024 16002 +/dev/md34s21 512 8193024 16002 +/dev/md34s22 512 8193024 16002 +/dev/md34s23 512 8193024 16002 +/dev/md34s24 512 8193024 16002 +/dev/md34s25 512 8193024 16002 +/dev/md34s26 512 8193024 16002 +/dev/md34s27 512 8193024 16002 +/dev/md34s5 512 8193024 16002 +/dev/md34s6 512 8193024 16002 +/dev/md34s7 512 8193024 16002 +/dev/md34s8 512 8193024 16002 +/dev/md34s9 512 8193024 16002 diff --git a/sbin/geom/core/tests/Ref/disk.msdos.flp.xml b/sbin/geom/core/tests/Ref/disk.msdos.flp.xml new file mode 100644 index 0000000..c176c58 --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.msdos.flp.xml @@ -0,0 +1,2 @@ +$FreeBSD$ +/dev/md34 512 5632 11 diff --git a/sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml b/sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml new file mode 100644 index 0000000..5ffb0c9 --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml @@ -0,0 +1,8 @@ +$FreeBSD$ +/dev/md34 512 75264 147 1 8 17 +/dev/md34s1 512 1626603520 3176960 23360 8 17 +/dev/md34s1a 512 78643200 153600 1129 8 17 +/dev/md34s1b 512 104857600 204800 1505 8 17 +/dev/md34s1c 512 1626603520 3176960 23360 8 17 +/dev/md34s1e 512 52428800 102400 752 8 17 +/dev/md34s1f 512 1390673920 2716160 19971 8 17 diff --git a/sbin/geom/core/tests/Ref/disk.sun.da0.xml b/sbin/geom/core/tests/Ref/disk.sun.da0.xml new file mode 100644 index 0000000..15b97c8 --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.sun.da0.xml @@ -0,0 +1,6 @@ +$FreeBSD$ +/dev/md34 512 5120 10 +/dev/md34a 512 1529708544 2987712 +/dev/md34b 512 539320320 1053360 +/dev/md34c 512 36698296320 71676360 +/dev/md34h 512 34629267456 67635288 diff --git a/sbin/geom/core/tests/Ref/disk.sun.da1.xml b/sbin/geom/core/tests/Ref/disk.sun.da1.xml new file mode 100644 index 0000000..004771b --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.sun.da1.xml @@ -0,0 +1,9 @@ +$FreeBSD$ +/dev/md34 512 5120 10 +/dev/md34a 512 262967296 513608 +/dev/md34b 512 1075994624 2101552 +/dev/md34c 512 18108555264 35368272 +/dev/md34d 512 11124240384 21727032 +/dev/md34f 512 2149576704 4198392 +/dev/md34g 512 2149576704 4198392 +/dev/md34h 512 1343787008 2624584 diff --git a/sbin/geom/core/tests/Ref/disk.typo.ad0.xml b/sbin/geom/core/tests/Ref/disk.typo.ad0.xml new file mode 100644 index 0000000..6d537dd --- /dev/null +++ b/sbin/geom/core/tests/Ref/disk.typo.ad0.xml @@ -0,0 +1,14 @@ +$FreeBSD$ +/dev/md34 512 8585262592 16768091 +/dev/md34s1 512 3220406784 6289857 +/dev/md34s1a 512 104857600 204800 +/dev/md34s1b 512 524288000 1024000 +/dev/md34s1c 512 3220406784 6289857 +/dev/md34s1e 512 524288000 1024000 +/dev/md34s1f 512 2066973184 4037057 +/dev/md34s2 512 5364817920 10478160 +/dev/md34s2c 512 5364817920 10478160 +/dev/md34s3 512 8585256960 16768080 +/dev/md34s3a 512 2097152000 4096000 +/dev/md34s3c 512 8585256960 16768080 +/dev/md34s3d 512 6488104960 12672080 diff --git a/sbin/geom/core/tests/run_test.sh b/sbin/geom/core/tests/run_test.sh new file mode 100644 index 0000000..96a3530 --- /dev/null +++ b/sbin/geom/core/tests/run_test.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# $FreeBSD$ + +MD=34 +TMP=/tmp/$$ + +set -e + +# Start from the right directory so we can find all our data files. +cd `dirname $0` + +(cd MdLoad && make) > /dev/null 2>&1 + +# Print the test header +echo -n '1..' +echo `ls -1 Data/disk.*.xml | wc -l` + +for f in Data/disk.*.xml +do + b=`basename $f` + mdconfig -d -u $MD > /dev/null 2>&1 || true + if [ -c /dev/md$MD ] ; then + sleep 1 + fi + if [ -c /dev/md$MD ] ; then + sleep 1 + fi + if [ -c /dev/md$MD ] ; then + echo "Bail out!" + echo "/dev/md$MD is busy" + exit 1 + fi + MdLoad/MdLoad md${MD} $f + if [ -f Ref/$b ] ; then + if diskinfo /dev/md${MD}* | + diff -I '$FreeBSD' -u Ref/$b - > $TMP; then + echo "ok - $b" + else + echo "not ok - $b" + sed 's/^/# /' $TMP + fi + else + diskinfo /dev/md${MD}* > Ref/`basename $f` + fi +done + +mdconfig -d -u $MD > /dev/null 2>&1 || true +rm -f $TMP + +exit 0 diff --git a/tools/regression/geom/ConfCmp/ConfCmp.c b/tools/regression/geom/ConfCmp/ConfCmp.c deleted file mode 100644 index 599a953b..0000000 --- a/tools/regression/geom/ConfCmp/ConfCmp.c +++ /dev/null @@ -1,377 +0,0 @@ -/*- - * Copyright (c) 2002 Poul-Henning Kamp - * Copyright (c) 2002 Networks Associates Technology, Inc. - * All rights reserved. - * - * This software was developed for the FreeBSD Project by Poul-Henning Kamp - * and NAI Labs, the Security Research Division of Network Associates, Inc. - * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the - * DARPA CHATS research program. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The names of the authors may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -FILE *fsubs; - -struct node { - LIST_HEAD(, node) children; - LIST_ENTRY(node) siblings; - struct node *parent; - const char *name; - struct sbuf *cont; - struct sbuf *key; - char *id; - char *ref; -}; - -struct mytree { - struct node *top; - struct node *cur; - int indent; - int ignore; -}; - -struct ref { - LIST_ENTRY(ref) next; - char *k1; - char *k2; -}; - -LIST_HEAD(, ref) refs = LIST_HEAD_INITIALIZER(refs); - -static struct node * -new_node(void) -{ - struct node *np; - - np = calloc(1, sizeof *np); - np->cont = sbuf_new_auto(); - sbuf_clear(np->cont); - np->key = sbuf_new_auto(); - sbuf_clear(np->key); - LIST_INIT(&np->children); - return (np); -} - -static void -indent(int n) -{ - - printf("%*.*s", n, n, ""); -} - -static void -StartElement(void *userData, const char *name, const char **attr) -{ - struct mytree *mt; - struct node *np; - int i; - - mt = userData; - if (!strcmp(name, "FreeBSD")) { - mt->ignore = 1; - return; - } - mt->ignore = 0; - mt->indent += 2; - np = new_node(); - for (i = 0; attr[i]; i += 2) { - if (!strcmp(attr[i], "id")) - np->id = strdup(attr[i+1]); - else if (!strcmp(attr[i], "ref")) - np->ref = strdup(attr[i+1]); - } - np->name = strdup(name); - sbuf_cat(np->key, name); - sbuf_cat(np->key, "::"); - np->parent = mt->cur; - LIST_INSERT_HEAD(&mt->cur->children, np, siblings); - mt->cur = np; -} - -static void -EndElement(void *userData, const char *name __unused) -{ - struct mytree *mt; - struct node *np; - - mt = userData; - if (mt->ignore) - return; - - mt->indent -= 2; - sbuf_finish(mt->cur->cont); - LIST_FOREACH(np, &mt->cur->children, siblings) { - if (strcmp(np->name, "name")) - continue; - sbuf_cat(mt->cur->key, sbuf_data(np->cont)); - break; - } - sbuf_finish(mt->cur->key); - mt->cur = mt->cur->parent; -} - -static void -CharData(void *userData , const XML_Char *s , int len) -{ - struct mytree *mt; - const char *b, *e; - - mt = userData; - if (mt->ignore) - return; - b = s; - e = s + len - 1; - while (isspace(*b) && b < e) - b++; - while (isspace(*e) && e > b) - e--; - if (e != b || *b) - sbuf_bcat(mt->cur->cont, b, e - b + 1); -} - -static struct mytree * -dofile(char *filename) -{ - XML_Parser parser; - struct mytree *mt; - struct stat st; - int fd; - char *p; - int i; - - parser = XML_ParserCreate(NULL); - mt = calloc(1, sizeof *mt); - mt->top = new_node(); - mt->top->name = "(top)"; - mt->top->parent = mt->top; - mt->cur = mt->top; - sbuf_finish(mt->top->key); - sbuf_finish(mt->top->cont); - XML_SetUserData(parser, mt); - XML_SetElementHandler(parser, StartElement, EndElement); - XML_SetCharacterDataHandler(parser, CharData); - fd = open(filename, O_RDONLY); - if (fd < 0) - err(1, filename); - fstat(fd, &st); - p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0); - i = XML_Parse(parser, p, st.st_size, 1); - if (i != 1) - errx(1, "XML_Parse complained -> %d", i); - munmap(p, st.st_size); - close(fd); - XML_ParserFree(parser); - sbuf_finish(mt->top->cont); - if (i) - return (mt); - else - return (NULL); -} - -static void -print_node(struct node *np) -{ - printf("\"%s\" -- \"%s\" -- \"%s\"", np->name, sbuf_data(np->cont), sbuf_data(np->key)); - if (np->id) - printf(" id=\"%s\"", np->id); - if (np->ref) - printf(" ref=\"%s\"", np->ref); - printf("\n"); -} - -static void -print_tree(struct node *np, int n) -{ - struct node *np1; - - indent(n); printf("%s id=%s ref=%s\n", np->name, np->id, np->ref); - LIST_FOREACH(np1, &np->children, siblings) - print_tree(np1, n + 2); -} - -static void -sort_node(struct node *np) -{ - struct node *np1, *np2; - int n; - - LIST_FOREACH(np1, &np->children, siblings) - sort_node(np1); - do { - np1 = LIST_FIRST(&np->children); - n = 0; - for (;;) { - if (np1 == NULL) - return; - np2 = LIST_NEXT(np1, siblings); - if (np2 == NULL) - return; - if (strcmp(sbuf_data(np1->key), sbuf_data(np2->key)) > 0) { - LIST_REMOVE(np2, siblings); - LIST_INSERT_BEFORE(np1, np2, siblings); - n++; - break; - } - np1 = np2; - } - } while (n); -} - -static int -refcmp(char *r1, char *r2) -{ - struct ref *r; - - LIST_FOREACH(r, &refs, next) { - if (!strcmp(r1, r->k1)) - return (strcmp(r2, r->k2)); - } - r = calloc(1, sizeof(*r)); - r->k1 = strdup(r1); - r->k2 = strdup(r2); - LIST_INSERT_HEAD(&refs, r, next); - if (fsubs != NULL) { - fprintf(fsubs, "s/%s/%s/g\n", r1, r2); - fflush(fsubs); - } - return (0); -} - -static int compare_node2(struct node *n1, struct node *n2, int in); - -static int -compare_node(struct node *n1, struct node *n2, int in) -{ - int i; - struct node *n1a, *n2a; - - i = strcmp(n1->name, n2->name); - if (i) - return (i); - if (n1->id && n2->id) - i = refcmp(n1->id, n2->id); - else if (n1->id || n2->id) - i = -1; - if (i) - return (i); - if (n1->ref && n2->ref) - i = refcmp(n1->ref, n2->ref); - else if (n1->ref || n2->ref) - i = -1; - if (i) - return (i); - if (!strcmp(n1->name, "ref")) - i = refcmp(sbuf_data(n1->cont), sbuf_data(n2->cont)); - else - i = strcmp(sbuf_data(n1->cont), sbuf_data(n2->cont)); - if (i) - return (1); - n1a = LIST_FIRST(&n1->children); - n2a = LIST_FIRST(&n2->children); - for (;;) { - if (n1a == NULL && n2a == NULL) - return (0); - if (n1a != NULL && n2a == NULL) { - printf("1>"); - indent(in); - print_node(n1a); - printf("2>\n"); - return (1); - } - if (n1a == NULL && n2a != NULL) { - printf("1>\n"); - printf("2>"); - indent(in); - print_node(n2a); - return (1); - } - i = compare_node2(n1a, n2a, in + 2); - if (i) - return (1); - n1a = LIST_NEXT(n1a, siblings); - n2a = LIST_NEXT(n2a, siblings); - } - return (0); -} - -static int -compare_node2(struct node *n1, struct node *n2, int in) -{ - int i; - - i = compare_node(n1, n2, in); - if (i) { - printf("1>"); - indent(in); - print_node(n1); - printf("2>"); - indent(in); - print_node(n2); - } - return (i); -} - - - -int -main(int argc, char **argv) -{ - struct mytree *t1, *t2; - int i; - - fsubs = fopen("_.subs", "w"); - setbuf(stdout, NULL); - setbuf(stderr, NULL); - if (argc != 3) - errx(1, "usage: %s file1 file2", argv[0]); - - t1 = dofile(argv[1]); - if (t1 == NULL) - errx(2, "XML parser error on file %s", argv[1]); - sort_node(t1->top); - t2 = dofile(argv[2]); - if (t2 == NULL) - errx(2, "XML parser error on file %s", argv[2]); - sort_node(t2->top); - i = compare_node(t1->top, t2->top, 0); - return (i); -} - diff --git a/tools/regression/geom/ConfCmp/Makefile b/tools/regression/geom/ConfCmp/Makefile deleted file mode 100644 index f550db3..0000000 --- a/tools/regression/geom/ConfCmp/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# $FreeBSD$ - -PROG= ConfCmp -SRCS+= ConfCmp.c -SRCS+= subr_sbuf.c - -.PATH: ../../../../sys/kern - -NO_OBJ= -WARNS?= 5 -CFLAGS+= -g -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -static -# Uncomment for ElectricFence -#LDADD += -lefence -L/usr/local/lib - -DPADD += ${LIBBSDXML} -LDADD += -lbsdxml - -MAN= -CLEANFILES += _* - -.include - -test: ${PROG} - rm -f _* *.core - ./${PROG} a1.conf a1.conf - ./${PROG} a1.conf a1a.conf - if ./${PROG} a1.conf a1b.conf > /dev/null 2>&1 ; then exit 1 ; fi - if ./${PROG} a1.conf a1c.conf > /dev/null 2>&1 ; then exit 1 ; fi - if ./${PROG} a1.conf a1d.conf > /dev/null 2>&1 ; then exit 1 ; fi - ./${PROG} a2.conf a2.conf - ./${PROG} a2.conf a2a.conf - if ./${PROG} a2.conf a2b.conf > /dev/null 2>&1 ; then exit 1 ; fi - if ./${PROG} a2.conf a2c.conf > /dev/null 2>&1 ; then exit 1 ; fi - if ./${PROG} a2.conf a2d.conf > /dev/null 2>&1 ; then exit 1 ; fi - diff --git a/tools/regression/geom/ConfCmp/a1.conf b/tools/regression/geom/ConfCmp/a1.conf deleted file mode 100644 index 94171cd..0000000 --- a/tools/regression/geom/ConfCmp/a1.conf +++ /dev/null @@ -1,414 +0,0 @@ - - $FreeBSD$ - - 0x80712c0 - DEV-method - - 0x80bfd00 - 0x80712c0 - ad0s3d - 4 - - 0x80b9500 - 0x80bfd00 - 0x80bf880 - r0w0e0 - - - - 0x80bfc80 - 0x80712c0 - ad0s3c - 4 - - 0x80b94c0 - 0x80bfc80 - 0x80bf800 - r0w0e0 - - - - 0x80bfc00 - 0x80712c0 - ad0s3a - 4 - - 0x80b9480 - 0x80bfc00 - 0x80bf780 - r0w0e0 - - - - 0x80bfb80 - 0x80712c0 - ad0s2c - 4 - - 0x80b9440 - 0x80bfb80 - 0x80bf600 - r0w0e0 - - - - 0x80bfb00 - 0x80712c0 - ad0s1f - 4 - - 0x80b9400 - 0x80bfb00 - 0x80bf480 - r0w0e0 - - - - 0x80bfa80 - 0x80712c0 - ad0s1e - 4 - - 0x80b93c0 - 0x80bfa80 - 0x80bf400 - r0w0e0 - - - - 0x80bfa00 - 0x80712c0 - ad0s1c - 4 - - 0x80b9380 - 0x80bfa00 - 0x80bf380 - r0w0e0 - - - - 0x80bf980 - 0x80712c0 - ad0s1b - 4 - - 0x80b9340 - 0x80bf980 - 0x80bf300 - r0w0e0 - - - - 0x80bf900 - 0x80712c0 - ad0s1a - 4 - - 0x80b9300 - 0x80bf900 - 0x80bf280 - r0w0e0 - - - - 0x80bf680 - 0x80712c0 - ad0s3 - 3 - - 0x80b9280 - 0x80bf680 - 0x80bf100 - r0w0e0 - - - - 0x80bf500 - 0x80712c0 - ad0s2 - 3 - - 0x80b9200 - 0x80bf500 - 0x80bf080 - r0w0e0 - - - - 0x80bf180 - 0x80712c0 - ad0s1 - 3 - - 0x80b9180 - 0x80bf180 - 0x80bf000 - r0w0e0 - - - - 0x80b9080 - 0x80712c0 - ad0 - 2 - - 0x80b90c0 - 0x80b9080 - 0x80b9040 - r0w0e0 - - - - - 0x8071280 - MBREXT-method - - - 0x8071260 - MBR-method - - 0x80b9100 - 0x8071260 - ad0 - 2 - - - - 0x80b9140 - 0x80b9100 - 0x80b9040 - r0w0e0 - - - - - 0x80bf100 - 0x80b9100 - r0w0e0 - ad0s3 - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - 165 - - - - 0x80bf080 - 0x80b9100 - r0w0e0 - ad0s2 - - 1 - 5364817920 - 10478160 - 3220439040 - 6289920 - 165 - - - - 0x80bf000 - 0x80b9100 - r0w0e0 - ad0s1 - - 0 - 3220406784 - 6289857 - 32256 - 63 - 165 - - - - - - 0x80712a0 - BSD-method - - 0x80bf700 - 0x80712a0 - ad0s3 - 3 - - - - 0x80b92c0 - 0x80bf700 - 0x80bf100 - r0w0e0 - - - - - 0x80bf880 - 0x80bf700 - r0w0e0 - ad0s3d - - 3 - 6488104960 - 12672080 - 10682408960 - 20864080 - - - - 0x80bf800 - 0x80bf700 - r0w0e0 - ad0s3c - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - - - - 0x80bf780 - 0x80bf700 - r0w0e0 - ad0s3a - - 0 - 2097152000 - 4096000 - 8585256960 - 16768080 - - - - - 0x80bf580 - 0x80712a0 - ad0s2 - 3 - - - - 0x80b9240 - 0x80bf580 - 0x80bf080 - r0w0e0 - - - - - 0x80bf600 - 0x80bf580 - r0w0e0 - ad0s2c - - 2 - 5364817920 - 10478160 - 3220439040 - 6289920 - - - - - 0x80bf200 - 0x80712a0 - ad0s1 - 3 - - - - 0x80b91c0 - 0x80bf200 - 0x80bf000 - r0w0e0 - - - - - 0x80bf480 - 0x80bf200 - r0w0e0 - ad0s1f - - 5 - 2066973184 - 4037057 - 1153465856 - 2252863 - - - - 0x80bf400 - 0x80bf200 - r0w0e0 - ad0s1e - - 4 - 524288000 - 1024000 - 629177856 - 1228863 - - - - 0x80bf380 - 0x80bf200 - r0w0e0 - ad0s1c - - 2 - 3220406784 - 6289857 - 32256 - 63 - - - - 0x80bf300 - 0x80bf200 - r0w0e0 - ad0s1b - - 1 - 524288000 - 1024000 - 104889856 - 204863 - - - - 0x80bf280 - 0x80bf200 - r0w0e0 - ad0s1a - - 0 - 104857600 - 204800 - 32256 - 63 - - - - - - 0x80711c0 - SIMDISK-method - - 0x80b9000 - 0x80711c0 - ad0 - 1 - - 0x80b9040 - 0x80b9000 - r0w0e0 - ad0 - - - - diff --git a/tools/regression/geom/ConfCmp/a1a.conf b/tools/regression/geom/ConfCmp/a1a.conf deleted file mode 100644 index 01110f3..0000000 --- a/tools/regression/geom/ConfCmp/a1a.conf +++ /dev/null @@ -1,414 +0,0 @@ - - $FreeBSD$ - - 0x90712c0 - DEV-method - - 0x90bfd00 - 0x90712c0 - ad0s3d - 4 - - 0x90b9500 - 0x90bfd00 - 0x90bf880 - r0w0e0 - - - - 0x90bfc80 - 0x90712c0 - ad0s3c - 4 - - 0x90b94c0 - 0x90bfc80 - 0x90bf800 - r0w0e0 - - - - 0x90bfc00 - 0x90712c0 - ad0s3a - 4 - - 0x90b9480 - 0x90bfc00 - 0x90bf780 - r0w0e0 - - - - 0x90bfb80 - 0x90712c0 - ad0s2c - 4 - - 0x90b9440 - 0x90bfb80 - 0x90bf600 - r0w0e0 - - - - 0x90bfb00 - 0x90712c0 - ad0s1f - 4 - - 0x90b9400 - 0x90bfb00 - 0x90bf480 - r0w0e0 - - - - 0x90bfa80 - 0x90712c0 - ad0s1e - 4 - - 0x90b93c0 - 0x90bfa80 - 0x90bf400 - r0w0e0 - - - - 0x90bfa00 - 0x90712c0 - ad0s1c - 4 - - 0x90b9380 - 0x90bfa00 - 0x90bf380 - r0w0e0 - - - - 0x90bf980 - 0x90712c0 - ad0s1b - 4 - - 0x90b9340 - 0x90bf980 - 0x90bf300 - r0w0e0 - - - - 0x90bf900 - 0x90712c0 - ad0s1a - 4 - - 0x90b9300 - 0x90bf900 - 0x90bf280 - r0w0e0 - - - - 0x90bf680 - 0x90712c0 - ad0s3 - 3 - - 0x90b9280 - 0x90bf680 - 0x90bf100 - r0w0e0 - - - - 0x90bf500 - 0x90712c0 - ad0s2 - 3 - - 0x90b9200 - 0x90bf500 - 0x90bf080 - r0w0e0 - - - - 0x90bf180 - 0x90712c0 - ad0s1 - 3 - - 0x90b9180 - 0x90bf180 - 0x90bf000 - r0w0e0 - - - - 0x90b9080 - 0x90712c0 - ad0 - 2 - - 0x90b90c0 - 0x90b9080 - 0x90b9040 - r0w0e0 - - - - - 0x9071280 - MBREXT-method - - - 0x9071260 - MBR-method - - 0x90b9100 - 0x9071260 - ad0 - 2 - - - - 0x90b9140 - 0x90b9100 - 0x90b9040 - r0w0e0 - - - - - 0x90bf100 - 0x90b9100 - r0w0e0 - ad0s3 - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - 165 - - - - 0x90bf080 - 0x90b9100 - r0w0e0 - ad0s2 - - 1 - 5364817920 - 10478160 - 3220439040 - 6289920 - 165 - - - - 0x90bf000 - 0x90b9100 - r0w0e0 - ad0s1 - - 0 - 3220406784 - 6289857 - 32256 - 63 - 165 - - - - - - 0x90712a0 - BSD-method - - 0x90bf700 - 0x90712a0 - ad0s3 - 3 - - - - 0x90b92c0 - 0x90bf700 - 0x90bf100 - r0w0e0 - - - - - 0x90bf880 - 0x90bf700 - r0w0e0 - ad0s3d - - 3 - 6488104960 - 12672080 - 10682408960 - 20864080 - - - - 0x90bf800 - 0x90bf700 - r0w0e0 - ad0s3c - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - - - - 0x90bf780 - 0x90bf700 - r0w0e0 - ad0s3a - - 0 - 2097152000 - 4096000 - 8585256960 - 16768080 - - - - - 0x90bf580 - 0x90712a0 - ad0s2 - 3 - - - - 0x90b9240 - 0x90bf580 - 0x90bf080 - r0w0e0 - - - - - 0x90bf600 - 0x90bf580 - r0w0e0 - ad0s2c - - 2 - 5364817920 - 10478160 - 3220439040 - 6289920 - - - - - 0x90bf200 - 0x90712a0 - ad0s1 - 3 - - - - 0x90b91c0 - 0x90bf200 - 0x90bf000 - r0w0e0 - - - - - 0x90bf480 - 0x90bf200 - r0w0e0 - ad0s1f - - 5 - 2066973184 - 4037057 - 1153465856 - 2252863 - - - - 0x90bf400 - 0x90bf200 - r0w0e0 - ad0s1e - - 4 - 524288000 - 1024000 - 629177856 - 1228863 - - - - 0x90bf380 - 0x90bf200 - r0w0e0 - ad0s1c - - 2 - 3220406784 - 6289857 - 32256 - 63 - - - - 0x90bf300 - 0x90bf200 - r0w0e0 - ad0s1b - - 1 - 524288000 - 1024000 - 104889856 - 204863 - - - - 0x90bf280 - 0x90bf200 - r0w0e0 - ad0s1a - - 0 - 104857600 - 204800 - 32256 - 63 - - - - - - 0x90711c0 - SIMDISK-method - - 0x90b9000 - 0x90711c0 - ad0 - 1 - - 0x90b9040 - 0x90b9000 - r0w0e0 - ad0 - - - - diff --git a/tools/regression/geom/ConfCmp/a1b.conf b/tools/regression/geom/ConfCmp/a1b.conf deleted file mode 100644 index 46f423b..0000000 --- a/tools/regression/geom/ConfCmp/a1b.conf +++ /dev/null @@ -1,414 +0,0 @@ - - $FreeBSD$ - - 0x80712c0 - DEV-method - - 0x80bfd00 - 0x80712c0 - ad0s3d - 4 - - 0x80b9500 - 0x80bfd00 - 0x80bf880 - r0w0e0 - - - - 0x80bfc80 - 0x80712c0 - ad0s3c - 4 - - 0x80b94c0 - 0x80bfc80 - 0x80bf800 - r0w0e0 - - - - 0x80bfc00 - 0x80712c0 - ad0s3a - 4 - - 0x80b9480 - 0x80bfc00 - 0x80bf780 - r0w0e0 - - - - 0x80bfb80 - 0x80712c0 - ad0s2c - 4 - - 0x80b9440 - 0x80bfb80 - 0x80bf600 - r0w0e0 - - - - 0x80bfb00 - 0x80712c0 - ad0s1f - 4 - - 0x80b9400 - 0x80bfb00 - 0x80bf480 - r0w0e0 - - - - 0x80bfa80 - 0x80712c0 - ad0s1e - 4 - - 0x80b93c0 - 0x80bfa80 - 0x80bf400 - r0w0e0 - - - - 0x80bfa00 - 0x80712c0 - ad0s1c - 4 - - 0x80b9380 - 0x80bfa00 - 0x80bf380 - r0w0e0 - - - - 0x80bf980 - 0x80712c0 - ad0s1b - 4 - - 0x80b9340 - 0x80bf980 - 0x80bf300 - r0w0e0 - - - - 0x80bf900 - 0x80712c0 - ad0s1a - 4 - - 0x80b9300 - 0x80bf900 - 0x80bf280 - r0w0e0 - - - - 0x80bf680 - 0x80712c0 - ad0s3 - 3 - - 0x80b9280 - 0x80bf680 - 0x80bf100 - r0w0e0 - - - - 0x80bf500 - 0x80712c0 - ad0s2 - 3 - - 0x80b9200 - 0x80bf500 - 0x80bf080 - r0w0e0 - - - - 0x80bf180 - 0x80712c0 - ad0s1 - 3 - - 0x80b9180 - 0x80bf180 - 0x80bf000 - r0w0e0 - - - - 0x80b9080 - 0x80712c0 - ad0 - 2 - - 0x80b90c0 - 0x80b9080 - 0x80b9040 - r0w0e0 - - - - - 0x8071280 - MBREXT-method - - - 0x8071260 - MBR-method - - 0x80b9100 - 0x8071260 - ad0 - 2 - - - - 0x80b9140 - 0x80b9100 - 0x80b9040 - r0w0e0 - - - - - 0x80bf100 - 0x80b9100 - r0w0e0 - ad0s3 - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - 165 - - - - 0x80bf080 - 0x80b9100 - r0w0e0 - ad0s2 - - 1 - 5364817920 - 10478160 - 3220439040 - 6289920 - 165 - - - - 0x80bf000 - 0x80b9100 - r0w0e0 - ad0s1 - - 0 - 3220406784 - 6289857 - 32256 - 63 - 165 - - - - - - 0x80712a0 - BSD-method - - 0x80bf700 - 0x80712a0 - ad0s3 - 3 - - - - 0x80b92c0 - 0x80bf700 - 0x80bf100 - r0w0e0 - - - - - 0x80bf880 - 0x80bf700 - r0w0e0 - ad0s3d - - 3 - 6488104960 - 12672080 - 10682408960 - 20864080 - - - - 0x80bf800 - 0x80bf700 - r0w0e0 - ad0s3c - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - - - - 0x80bf780 - 0x80bf700 - r0w0e0 - ad0s3a - - 0 - 2097152000 - 4096000 - 8585256960 - 16768080 - - - - - 0x80bf580 - 0x80712a0 - ad0s2 - 3 - - - - 0x80b9240 - 0x80bf580 - 0x80bf080 - r0w0e0 - - - - - 0x80bf600 - 0x80bf580 - r0w0e0 - ad0s2c - - 2 - 5364817920 - 10478160 - 3220439040 - 6289920 - - - - - 0x80bf200 - 0x80712a0 - ad0s1 - 3 - - - - 0x80b91c0 - 0x80bf200 - 0x80bf000 - r0w0e0 - - - - - 0x80bf480 - 0x80bf200 - r0w0e0 - ad0s1f - - 5 - 2066973184 - 4037057 - 1153465856 - 2252863 - - - - 0x80bf400 - 0x80bf200 - r0w0e0 - ad0s1e - - 4 - 524288000 - 1024000 - 629177856 - 1228863 - - - - 0x80bf380 - 0x80bf200 - r0w0e0 - ad0s1c - - 2 - 3220406784 - 6289857 - 32256 - 63 - - - - 0x80bf300 - 0x80bf200 - r0w0e0 - ad0s1b - - 1 - 524288000 - 1024000 - 104889856 - 204863 - - - - 0x80bf280 - 0x80bf200 - r0w0e0 - ad0s1a - - 0 - 104857600 - 204800 - 32256 - 63 - - - - - - 0x80711c0 - SIMDISK-method - - 0x80b9000 - 0x80711c0 - ad0 - 1 - - 0x80b9041 - 0x80b9000 - r0w0e0 - ad0 - - - - diff --git a/tools/regression/geom/ConfCmp/a1c.conf b/tools/regression/geom/ConfCmp/a1c.conf deleted file mode 100644 index 1b5a2b9..0000000 --- a/tools/regression/geom/ConfCmp/a1c.conf +++ /dev/null @@ -1,414 +0,0 @@ - - $FreeBSD$ - - 0x80712c0 - DEV-method - - 0x80bfd00 - 0x80712c0 - ad0s3d - 4 - - 0x80b9500 - 0x80bfd00 - 0x80bf880 - r0w0e0 - - - - 0x80bfc80 - 0x80712c0 - ad0s3c - 4 - - 0x80b94c0 - 0x80bfc80 - 0x80bf800 - r0w0e0 - - - - 0x80bfc00 - 0x80712c0 - ad0s3a - 4 - - 0x80b9480 - 0x80bfc00 - 0x80bf780 - r0w0e0 - - - - 0x80bfb80 - 0x80712c0 - ad0s2c - 4 - - 0x80b9440 - 0x80bfb80 - 0x80bf600 - r0w0e0 - - - - 0x80bfb00 - 0x80712c0 - ad0s1f - 4 - - 0x80b9400 - 0x80bfb00 - 0x80bf480 - r0w0e0 - - - - 0x80bfa80 - 0x80712c0 - ad0s1e - 4 - - 0x80b93c0 - 0x80bfa80 - 0x80bf400 - r0w0e0 - - - - 0x80bfa00 - 0x80712c0 - ad0s1c - 4 - - 0x80b9380 - 0x80bfa00 - 0x80bf380 - r0w0e0 - - - - 0x80bf980 - 0x80712c0 - ad0s1b - 4 - - 0x80b9340 - 0x80bf980 - 0x80bf300 - r0w0e0 - - - - 0x80bf900 - 0x80712c0 - ad0s1a - 4 - - 0x80b9300 - 0x80bf900 - 0x80bf280 - r0w0e0 - - - - 0x80bf680 - 0x80712c0 - ad0s3 - 3 - - 0x80b9280 - 0x80bf680 - 0x80bf100 - r0w0e0 - - - - 0x80bf500 - 0x80712c0 - ad0s2 - 3 - - 0x80b9200 - 0x80bf500 - 0x80bf080 - r0w0e0 - - - - 0x80bf180 - 0x80712c0 - ad0s1 - 3 - - 0x80b9180 - 0x80bf180 - 0x80bf000 - r0w0e0 - - - - 0x80b9080 - 0x80712c0 - ad0 - 2 - - 0x80b90c0 - 0x80b9080 - 0x80b9040 - r0w0e0 - - - - - 0x8071280 - MBREXT-method - - - 0x8071260 - MBR-method - - 0x80b9100 - 0x8071260 - ad0 - 2 - - - - 0x80b9140 - 0x80b9100 - 0x80b9040 - r0w0e0 - - - - - 0x80bf100 - 0x80b9100 - r0w0e0 - ad0s3 - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - 165 - - - - 0x80bf080 - 0x80b9100 - r0w0e0 - ad0s2 - - 1 - 5364817920 - 10478160 - 3220439040 - 6289920 - 165 - - - - 0x80bf000 - 0x80b9100 - r0w0e0 - ad0s1 - - 0 - 3220406784 - 6289857 - 32256 - 63 - 165 - - - - - - 0x80712a0 - BSD-method - - 0x80bf700 - 0x80712a0 - ad0s3 - 3 - - - - 0x80b92c0 - 0x80bf700 - 0x80bf100 - r0w0e0 - - - - - 0x80bf880 - 0x80bf700 - r0w0e0 - ad0s3d - - 3 - 6488104960 - 12672080 - 10682408960 - 20864080 - - - - 0x80bf800 - 0x80bf700 - r0w0e0 - ad0s3c - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - - - - 0x80bf780 - 0x80bf700 - r0w0e0 - ad0s3a - - 0 - 2097152000 - 4096000 - 8585256960 - 16768080 - - - - - 0x80bf580 - 0x80712a0 - ad0s2 - 3 - - - - 0x80b9240 - 0x80bf580 - 0x80bf080 - r0w0e0 - - - - - 0x80bf600 - 0x80bf580 - r0w0e0 - ad0s2c - - 2 - 5364817920 - 10478160 - 3220439040 - 6289920 - - - - - 0x80bf200 - 0x80712a0 - ad0s1 - 3 - - - - 0x80b91c0 - 0x80bf200 - 0x80bf000 - r0w0e0 - - - - - 0x80bf480 - 0x80bf200 - r0w0e0 - ad0s1f - - 5 - 2066973184 - 4037057 - 1153465856 - 2252863 - - - - 0x80bf400 - 0x80bf200 - r0w0e0 - ad0s1e - - 4 - 524288000 - 1024000 - 629177856 - 1228863 - - - - 0x80bf380 - 0x80bf200 - r0w0e0 - ad0s1c - - 2 - 3220406784 - 6289857 - 32256 - 63 - - - - 0x80bf300 - 0x80bf200 - r0w0e0 - ad0s1b - - 1 - 524288000 - 1024000 - 104889856 - 204863 - - - - 0x80bf280 - 0x80bf200 - r0w0e0 - ad0s1a - - 0 - 104857600 - 204800 - 32256 - 63 - - - - - - 0x80711c0 - SIMDISK-method - - 0x80b9000 - 0x80711c0 - ad0 - 1 - - 0x80b9040 - 0x80b9000 - r0w0e1 - ad0 - - - - diff --git a/tools/regression/geom/ConfCmp/a1d.conf b/tools/regression/geom/ConfCmp/a1d.conf deleted file mode 100644 index a9063c5..0000000 --- a/tools/regression/geom/ConfCmp/a1d.conf +++ /dev/null @@ -1,414 +0,0 @@ - - $FreeBSD$ - - 0x80712c0 - DEV-method - - 0x80bfd00 - 0x80712c0 - ad0s3d - 4 - - 0x80b9500 - 0x80bfd00 - 0x80bf880 - r0w0e0 - - - - 0x80bfc80 - 0x80712c0 - ad0s3c - 4 - - 0x80b94c0 - 0x80bfc80 - 0x80bf800 - r0w0e0 - - - - 0x80bfc00 - 0x80712c0 - ad0s3a - 4 - - 0x80b9480 - 0x80bfc00 - 0x80bf780 - r0w0e0 - - - - 0x80bfb80 - 0x80712c0 - ad0s2c - 4 - - 0x80b9440 - 0x80bfb80 - 0x80bf600 - r0w0e0 - - - - 0x80bfb00 - 0x80712c0 - ad0s1f - 4 - - 0x80b9400 - 0x80bfb00 - 0x80bf480 - r0w0e0 - - - - 0x80bfa80 - 0x80712c0 - ad0s1e - 4 - - 0x80b93c0 - 0x80bfa80 - 0x80bf400 - r0w0e0 - - - - 0x80bfa00 - 0x80712c0 - ad0s1c - 4 - - 0x80b9380 - 0x80bfa00 - 0x80bf380 - r0w0e0 - - - - 0x80bf980 - 0x80712c0 - ad0s1b - 4 - - 0x80b9340 - 0x80bf980 - 0x80bf300 - r0w0e0 - - - - 0x80bf900 - 0x80712c0 - ad0s1a - 4 - - 0x80b9300 - 0x80bf900 - 0x80bf280 - r0w0e0 - - - - 0x80bf680 - 0x80712c0 - ad0s3 - 3 - - 0x80b9280 - 0x80bf680 - 0x80bf100 - r0w0e0 - - - - 0x80bf500 - 0x80712c0 - ad0s2 - 3 - - 0x80b9200 - 0x80bf500 - 0x80bf080 - r0w0e0 - - - - 0x80bf180 - 0x80712c0 - ad0s1 - 3 - - 0x80b9180 - 0x80bf180 - 0x80bf000 - r0w0e0 - - - - 0x80b9080 - 0x80712c0 - ad0 - 2 - - 0x80b90c0 - 0x80b9080 - 0x80b9040 - r0w0e0 - - - - - 0x8071280 - MBREXT-method - - - 0x8071260 - MBR-method - - 0x80b9100 - 0x8071260 - ad0 - 2 - - - - 0x80b9140 - 0x80b9100 - 0x80b9040 - r0w0e0 - - - - - 0x80bf100 - 0x80b9100 - r0w0e0 - ad0s3 - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - 165 - - - - 0x80bf080 - 0x80b9100 - r0w0e0 - ad0s2 - - 1 - 5364817920 - 10478160 - 3220439040 - 6289920 - 165 - - - - 0x80bf000 - 0x80b9100 - r0w0e0 - ad0s1 - - 0 - 3220406784 - 6289857 - 32256 - 63 - 165 - - - - - - 0x80712a0 - BSD-method - - 0x80bf700 - 0x80712a0 - ad0s3 - 3 - - - - 0x80b92c0 - 0x80bf700 - 0x80bf100 - r0w0e0 - - - - - 0x80bf880 - 0x80bf700 - r0w0e0 - ad0s3d - - 3 - 6488104960 - 12672080 - 10682408960 - 20864080 - - - - 0x80bf800 - 0x80bf700 - r0w0e0 - ad0s3c - - 2 - 8585256960 - 16768080 - 8585256960 - 16768080 - - - - 0x80bf780 - 0x80bf700 - r0w0e0 - ad0s3a - - 0 - 2097152000 - 4096000 - 8585256960 - 16768080 - - - - - 0x80bf580 - 0x80712a0 - ad0s2 - 3 - - - - 0x80b9240 - 0x80bf580 - 0x80bf080 - r0w0e0 - - - - - 0x80bf600 - 0x80bf580 - r0w0e0 - ad0s2c - - 2 - 5364817920 - 10478160 - 3220439040 - 6289920 - - - - - 0x80bf200 - 0x80712a0 - ad0s1 - 3 - - - - 0x80b91c0 - 0x80bf200 - 0x80bf000 - r0w0e0 - - - - - 0x80bf480 - 0x80bf200 - r0w0e0 - ad0s1f - - 5 - 2066973184 - 4037057 - 1153465856 - 2252863 - - - - 0x80bf400 - 0x80bf200 - r0w0e0 - ad0s1e - - 4 - 524288000 - 1024000 - 629177856 - 1228863 - - - - 0x80bf380 - 0x80bf200 - r0w0e0 - ad0s1c - - 2 - 3220406784 - 6289857 - 32256 - 63 - - - - 0x80bf300 - 0x80bf200 - r0w0e0 - ad0s1b - - 1 - 524288000 - 1024000 - 104889856 - 204863 - - - - 0x80bf280 - 0x80bf200 - r0w0e0 - ad0s1a - - 0 - 104857600 - 204800 - 32256 - 63 - - - - - - 0x80711c0 - SIMDISK-method - - 0x80b9000 - 0x80711c0 - ad0 - 1 - - 0x80b9040 - 0x80b9000 - r0w0e0 - ad0 - - - - diff --git a/tools/regression/geom/ConfCmp/a2.conf b/tools/regression/geom/ConfCmp/a2.conf deleted file mode 100644 index 6688fd1..0000000 --- a/tools/regression/geom/ConfCmp/a2.conf +++ /dev/null @@ -1,207 +0,0 @@ - - $FreeBSD$ - - DEV-class - - - wd0s1f - 4 - - - - r0w0e0 - - - - - wd0s1e - 4 - - - - r0w0e0 - - - - - wd0s1c - 4 - - - - r0w0e0 - - - - - wd0s1b - 4 - - - - r0w0e0 - - - - - wd0s1a - 4 - - - - r0w0e0 - - - - - wd0s1 - 3 - - - - r0w0e0 - - - - - wd0 - 2 - - - - r0w0e0 - - - - - PC98-class - - - wd0 - 2 - - 8704 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1 - - 0 - 1626533888 - 3176824 - 69632 - 136 - - - - - - SUNLABEL-class - - - MBREXT-class - - - MBR-class - - - BSD-class - - - wd0s1 - 3 - - 512 - 8192 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1f - - 5 - 1390673920 - 2716160 - 235929600 - 460800 - - - - - r0w0e0 - wd0s1e - - 4 - 52428800 - 102400 - 183500800 - 358400 - - - - - r0w0e0 - wd0s1c - - 2 - 1626603520 - 3176960 - 0 - 0 - - - - - r0w0e0 - wd0s1b - - 1 - 104857600 - 204800 - 78643200 - 153600 - - - - - r0w0e0 - wd0s1a - - 0 - 78643200 - 153600 - 0 - 0 - - - - - - SIMDISK-class - - - wd0 - 1 - - - r0w0e0 - wd0 - - - - diff --git a/tools/regression/geom/ConfCmp/a2a.conf b/tools/regression/geom/ConfCmp/a2a.conf deleted file mode 100644 index 3d35fe9..0000000 --- a/tools/regression/geom/ConfCmp/a2a.conf +++ /dev/null @@ -1,207 +0,0 @@ - - $FreeBSD$ - - DEV-class - - - wd0s1f - 4 - - - - r0w0e0 - - - - - wd0s1e - 4 - - - - r0w0e0 - - - - - wd0s1c - 4 - - - - r0w0e0 - - - - - wd0s1b - 4 - - - - r0w0e0 - - - - - wd0s1a - 4 - - - - r0w0e0 - - - - - wd0s1 - 3 - - - - r0w0e0 - - - - - wd0 - 2 - - - - r0w0e0 - - - - - PC98-class - - - wd0 - 2 - - 8704 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1 - - 0 - 1626533888 - 3176824 - 69632 - 136 - - - - - - SUNLABEL-class - - - MBREXT-class - - - MBR-class - - - BSD-class - - - wd0s1 - 3 - - 512 - 8192 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1f - - 5 - 1390673920 - 2716160 - 235929600 - 460800 - - - - - r0w0e0 - wd0s1e - - 4 - 52428800 - 102400 - 183500800 - 358400 - - - - - r0w0e0 - wd0s1c - - 2 - 1626603520 - 3176960 - 0 - 0 - - - - - r0w0e0 - wd0s1b - - 1 - 104857600 - 204800 - 78643200 - 153600 - - - - - r0w0e0 - wd0s1a - - 0 - 78643200 - 153600 - 0 - 0 - - - - - - SIMDISK-class - - - wd0 - 1 - - - r0w0e0 - wd0 - - - - diff --git a/tools/regression/geom/ConfCmp/a2b.conf b/tools/regression/geom/ConfCmp/a2b.conf deleted file mode 100644 index 58c0e15..0000000 --- a/tools/regression/geom/ConfCmp/a2b.conf +++ /dev/null @@ -1,207 +0,0 @@ - - $FreeBSD$ - - DEV-class - - - wd0s1f - 4 - - - - r0w0e0 - - - - - wd0s1e - 4 - - - - r0w0e0 - - - - - wd0s1c - 4 - - - - r0w0e0 - - - - - wd0s1b - 4 - - - - r0w0e0 - - - - - wd0s1a - 4 - - - - r0w0e0 - - - - - wd0s1 - 3 - - - - r0w0e0 - - - - - wd0 - 2 - - - - r0w0e0 - - - - - PC98-class - - - wd0 - 2 - - 8704 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1 - - 0 - 1626533888 - 3176824 - 69632 - 136 - - - - - - SUNLABEL-class - - - MBREXT-class - - - MBR-class - - - BSD-class - - - wd0s1 - 3 - - 512 - 8192 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1f - - 5 - 1390673920 - 2716160 - 235929600 - 460800 - - - - - r0w0e0 - wd0s1e - - 4 - 52428800 - 102400 - 183500800 - 358400 - - - - - r0w0e0 - wd0s1c - - 2 - 1626603520 - 3176960 - 0 - 0 - - - - - r0w0e0 - wd0s1b - - 1 - 104857600 - 204800 - 78643200 - 153600 - - - - - r0w0e0 - wd0s1a - - 0 - 78643200 - 153600 - 0 - 0 - - - - - - SIMDISK-class - - - wd0 - 1 - - - r0w0e0 - wd0 - - - - diff --git a/tools/regression/geom/ConfCmp/a2c.conf b/tools/regression/geom/ConfCmp/a2c.conf deleted file mode 100644 index 381c410..0000000 --- a/tools/regression/geom/ConfCmp/a2c.conf +++ /dev/null @@ -1,206 +0,0 @@ - - $FreeBSD$ - - DEV-class - - - wd0s1f - 4 - - - - r0w0e0 - - - - - wd0s1e - 4 - - - - r0w0e0 - - - - - wd0s1c - 4 - - - - r0w0e0 - - - - - wd0s1b - 4 - - - - - - - - wd0s1a - 4 - - - - r0w0e0 - - - - - wd0s1 - 3 - - - - r0w0e0 - - - - - wd0 - 2 - - - - r0w0e0 - - - - - PC98-class - - - wd0 - 2 - - 8704 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1 - - 0 - 1626533888 - 3176824 - 69632 - 136 - - - - - - SUNLABEL-class - - - MBREXT-class - - - MBR-class - - - BSD-class - - - wd0s1 - 3 - - 512 - 8192 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1f - - 5 - 1390673920 - 2716160 - 235929600 - 460800 - - - - - r0w0e0 - wd0s1e - - 4 - 52428800 - 102400 - 183500800 - 358400 - - - - - r0w0e0 - wd0s1c - - 2 - 1626603520 - 3176960 - 0 - 0 - - - - - r0w0e0 - wd0s1b - - 1 - 104857600 - 204800 - 78643200 - 153600 - - - - - r0w0e0 - wd0s1a - - 0 - 78643200 - 153600 - 0 - 0 - - - - - - SIMDISK-class - - - wd0 - 1 - - - r0w0e0 - wd0 - - - - diff --git a/tools/regression/geom/ConfCmp/a2d.conf b/tools/regression/geom/ConfCmp/a2d.conf deleted file mode 100644 index bccaed5..0000000 --- a/tools/regression/geom/ConfCmp/a2d.conf +++ /dev/null @@ -1,211 +0,0 @@ - - $FreeBSD$ - - DEV-class - - - wd0s1f - 4 - - - - r0w0e0 - - - - - wd0s1e - 4 - - - - r0w0e0 - - - - - wd0s1c - 4 - - - - r0w0e0 - - - - - wd0s1b - 4 - - - - r0w0e0 - - - - - wd0s1a - 4 - - - - r0w0e0 - - - - r0w0e0 - - - - - wd0s1 - 3 - - - - r0w0e0 - - - - - wd0 - 2 - - - - r0w0e0 - - - - - PC98-class - - - wd0 - 2 - - 8704 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1 - - 0 - 1626533888 - 3176824 - 69632 - 136 - - - - - - SUNLABEL-class - - - MBREXT-class - - - MBR-class - - - BSD-class - - - wd0s1 - 3 - - 512 - 8192 - - - - - r0w0e0 - - - - - - r0w0e0 - wd0s1f - - 5 - 1390673920 - 2716160 - 235929600 - 460800 - - - - - r0w0e0 - wd0s1e - - 4 - 52428800 - 102400 - 183500800 - 358400 - - - - - r0w0e0 - wd0s1c - - 2 - 1626603520 - 3176960 - 0 - 0 - - - - - r0w0e0 - wd0s1b - - 1 - 104857600 - 204800 - 78643200 - 153600 - - - - - r0w0e0 - wd0s1a - - 0 - 78643200 - 153600 - 0 - 0 - - - - - - SIMDISK-class - - - wd0 - 1 - - - r0w0e0 - wd0 - - - - diff --git a/tools/regression/geom/Data/disk.alpha.da0.xml b/tools/regression/geom/Data/disk.alpha.da0.xml deleted file mode 100644 index 670fcc3..0000000 --- a/tools/regression/geom/Data/disk.alpha.da0.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - $FreeBSD$ - - Yet an alpha disklabel. - - 512 - 0 - 0 - 0 - 0 - - 0 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 574556820400000057444947544c202000000000000000000000000000000000 - 0000000000000000000200003f000000ff000000b2080000c13e00002eae2102 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000057455682a22908000020000000200000008007000000000000040000 - 07081600c05f20000080070000000000010000002eae21020000000000000000 - 000000000000000000000000000000000000000000a00000c0df270000040000 - 070818006e2ef901c07f28000004000007081600000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0e0000000000000001000000000000000000000000000000c51a45ca2ad1dba8 - - - diff --git a/tools/regression/geom/Data/disk.alpha2.da0.xml b/tools/regression/geom/Data/disk.alpha2.da0.xml deleted file mode 100644 index 5b341b1..0000000 --- a/tools/regression/geom/Data/disk.alpha2.da0.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - $FreeBSD$ - - alpha label which O'brien says blows up libdisk - - 512 - 0 - 0 - 0 - 0 - - 0 - - 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a - 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a - 5745568204000000000000000000000000000000000000000000000000000000 - 0000000000000000000200003f000000ff00000009020000c13e0000c9b67f00 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000005745568219cf0300002000000020000043bc0000c13e000000000000 - 08000000fc867c0004fb00000000000008000000c934020000827d0000000000 - 0100000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000005a5a5a5a5a5a5a5a5a5a5a5a - 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a - 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a - 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a - 5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a - 9800000000000000020000000000000000000000000000007a13ad55a1c382b0 - - - diff --git a/tools/regression/geom/Data/disk.apple.xml b/tools/regression/geom/Data/disk.apple.xml deleted file mode 100644 index ecdd523..0000000 --- a/tools/regression/geom/Data/disk.apple.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - $FreeBSD$ - 512 - 366530560 - 0 - 0 - 0 - - 0 - - 45520200000aec68000100010000000000010000004000120001000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 512 - - 504d00000000000300000060000aec084d61634f530000000000000000000000 - 000000000000000000000000000000004170706c655f48465300000000000000 - 0000000000000000000000000000000000000000000aec08000000b700000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 1024 - - 504d000000000003000000010000003f4170706c650000000000000000000000 - 000000000000000000000000000000004170706c655f706172746974696f6e5f - 6d617000000000000000000000000000000000000000003f0000003700000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 1536 - - 504d00000000000300000040000000204d6163696e746f736800000000000000 - 000000000000000000000000000000004170706c655f44726976657234330000 - 0000000000000000000000000000000000000000000000200000007f00000000 - 000023ee0000000000000000000000000000000000007c083638303030000000 - 0000000000000000000106000000000000000001000700000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - diff --git a/tools/regression/geom/Data/disk.beast.da0.xml b/tools/regression/geom/Data/disk.beast.da0.xml deleted file mode 100644 index 96ad5f7..0000000 --- a/tools/regression/geom/Data/disk.beast.da0.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - $FreeBSD$ - alpha BSD label from beast.freebsd.org - - 512 - 0 - 0 - 0 - 0 - - 0 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 5745568204000000646130000000000000000000000000000000000000000000 - 0000000000000000000200003f000000ff0000000f020000c13e000000338100 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000057455682594e08000020000000200000002079000000000000040000 - 0708100000130800002079000000000001000000003381000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0f0000000000000001000000000000000000000000000000fc8c1983a904da83 - - - diff --git a/tools/regression/geom/Data/disk.critter.ad0.xml b/tools/regression/geom/Data/disk.critter.ad0.xml deleted file mode 100644 index 9e93b24..0000000 --- a/tools/regression/geom/Data/disk.critter.ad0.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - $FreeBSD$ - This image contains the MBR and disklabel sectors from my Asus M1300 - laptop. - - 512 - 0 - - 0 - - fc31c08ec08ed88ed0bc007cbe1a7cbf1a06b9e601f3a4e9008a31f6bbbe07b1 - 04382f74087f7885f6757489de80c310e2ef85f67502cd1880fa80720b8a3675 - 0480c68038f272028a1489e78a74018b4c02bb007c80feff753283f9ff752d51 - 53bbaa55b441cd13722081fb55aa751af6c10174155b666a0066ff740806536a - 016a1089e6b80042eb055b59b80102cd1389fc720f81bffe0155aa750cffe3be - bc06eb11bed406eb0cbef306eb07bb0700b40ecd10ac84c075f4ebfe496e7661 - 6c696420706172746974696f6e207461626c65004572726f72206c6f6164696e - 67206f7065726174696e672073797374656d004d697373696e67206f70657261 - 74696e672073797374656d000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000008001 - 0100a50fffff3f00000041295402000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 512 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 32768 - - 5745568205000000616430733100000000000000000000000000000000000000 - 0000000000000000000200003f0000001000000067970000f003000041295402 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000574556824fa608000020000000200000000020003f00000000040000 - 07081600000020003f0020000000000001000000412954023f00000000000000 - 00000000418984003fa0cf01000400000708160000a00f003f00400000040000 - 07081600000080003fa04f000004000007081600000060003fa0cf0000040000 - 070816000000a0003fa02f010004000007081600000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 64512 - - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 1073806336 - - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - - - - 1598094336 - - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f - - - - 2147548160 - - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 2671836160 - - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffff00000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - diff --git a/tools/regression/geom/Data/disk.empty.flp.xml b/tools/regression/geom/Data/disk.empty.flp.xml deleted file mode 100644 index 88c603a..0000000 --- a/tools/regression/geom/Data/disk.empty.flp.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - $FreeBSD$ - An empty floppy disk - - 512 - 1474560 - 18 - 2 - 80 - diff --git a/tools/regression/geom/Data/disk.far.ad0.xml b/tools/regression/geom/Data/disk.far.ad0.xml deleted file mode 100644 index 0a8d3ca..0000000 --- a/tools/regression/geom/Data/disk.far.ad0.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - $FreeBSD$ - A Windows laptop. - - 512 - 0 - - 0 - - 33c08ed0bc007cfb5007501ffcbe1b7cbf1b065057b9e501f3a4cbbebe07b104 - 382c7c09751583c610e2f5cd188b148bee83c610497416382c74f6be10074eac - 3c0074fabb0700b40ecd10ebf2894625968a4604b4063c0e7411b40b3c0c7405 - 3ac4752b40c64625067524bbaa5550b441cd1358721681fb55aa7510f6c10174 - 0b8ae0885624c706a106eb1e886604bf0a00b801028bdc33c983ff057f038b4e - 25034e02cd137229be4607813efe7d55aa745a83ef057fda85f67583be2707eb - 8a9891529903460813560ae812005aebd54f74e433c0cd13ebb8000080093521 - 5633f656565250065351be1000568bf45052b800428a5624cd135a588d641072 - 0a4075014280c702e2f7f85ec3eb74496e76616c696420706172746974696f6e - 207461626c65004572726f72206c6f6164696e67206f7065726174696e672073 - 797374656d004d697373696e67206f7065726174696e672073797374656d0000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000008bfc1e578bf5cb00000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 0100a05304263f00000092d80800805401260befbf730cd90800340a88000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 512 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - diff --git a/tools/regression/geom/Data/disk.flat.da1.xml b/tools/regression/geom/Data/disk.flat.da1.xml deleted file mode 100644 index 2302a7c..0000000 --- a/tools/regression/geom/Data/disk.flat.da1.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - $FreeBSD$ - This image contains an interesting setup: there is an MBR+BSD - but also another BSD at sector one which is valid but bogus. - - 512 - 0 - 0 - 0 - 0 - - 0 - - fc31c08ec08ed88ed0bc007cbe1a7cbf1a06b9e601f3a4e9008a31f6bbbe07b1 - 04382f74087f7885f6757489de80c310e2ef85f67502cd1880fa80720b8a3675 - 0480c68038f272028a1489e78a74018b4c02bb007c80feff753283f9ff752d51 - 53bbaa55b441cd13722081fb55aa751af6c10174155b666a0066ff740806536a - 016a1089e6b80042eb055b59b80102cd1389fc720f81bffe0155aa750cffe3be - bc06eb11bed406eb0cbef306eb07bb0700b40ecd10ac84c075f4ebfe496e7661 - 6c696420706172746974696f6e207461626c65004572726f72206c6f6164696e - 67206f7065726174696e672073797374656d004d697373696e67206f70657261 - 74696e672073797374656d000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000008001 - 0100a5feffff3f0000003a612302000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 512 - - 5745568204000000534541474154452053543331383433360000000000000000 - 000000000000000000020000000800000100000072440000000800000004fb00 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000057455682e29908000020000000200000002001000000000000040000 - 07081000000008000020010000000000010000000004fb000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000e0f100002009000004000007081000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 32256 - - eb1b9090161f666a005150065331c088f0506a1089e5e8c7008d6610cbfc31c9 - 8ec18ed98ed1bc007c89e6bf0007fec5f3a5beee7d80fa80722cb601e86700b9 - 0100bebe8db601807c04a57507e319f60480751483c610fec680fe0572e949e3 - e1be8b7deb5231d289160009b610e83500bb00908b770a01debf00b0b900ac29 - f1f3a429f930c0f3aae80300e98113fae464a80275fab0d1e664e464a80275fa - b0dfe660fbc3bb008c8b44088b4c0a0ee853ff732abe867de81c00be907de816 - 0030e4cd16c70672043412ea0000ffffbb0700b40ecd10ac84c075f4b401f9c3 - 52b408cd1388f55a72f580e13f74edfa668b460852660fb6d96631d266f7f388 - eb88d54330d266f7f388d75a663dff030000fb774486c4c0c80208e8409188fe - 28e08a660238e0720288e0bf0500c45e0450b402cd135b730a4f741c30e4cd13 - 93ebeb0fb6c30146087303ff460ad0e3005e052846027788c32ef6069908800f - 8479ffbbaa5552b441cd135a0f826fff81fb55aa0f8564fff6c1010f845dff89 - eeb442cd13c35265616400426f6f7400206572726f720d0a0080909090909090 - 9090909090909090909090909090909090909090909090909090909090900000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000080000100a5ffffff0000000050c3000055aa - - - - 32768 - - 5745568204000000646131733100000000000000000000000000000000000000 - 0000000000000000000200003f000000ff000000b8080000c13e00003a612302 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000005745568233c408000020000000200000000000000000000000000000 - 0000000000800c003f800c0000000000010000003a6123023f00000000000000 - 000000000000000000000000000000000000000000800c003f00000000040000 - 07081600000020003f00190000040000070816003a61ea013f00390000040000 - 0708160000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - diff --git a/tools/regression/geom/Data/disk.kern.flp.xml b/tools/regression/geom/Data/disk.kern.flp.xml deleted file mode 100644 index 6640c48..0000000 --- a/tools/regression/geom/Data/disk.kern.flp.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - $FreeBSD$ - A FreeBSD kern.flp image. - - 512 - 0 - - 0 - - eb1b9090161f666a005150065331c088f0506a1089e5e8c7008d6610cbfc31c9 - 8ec18ed98ed1bc007c89e6bf0007fec5f3a5beee7d80fa80722cb601e86700b9 - 0100bebe8db601807c04a57507e319f60480751483c610fec680fe0572e949e3 - e1be8b7deb5231d289160009b610e83500bb00908b770a01debf00b0b900ac29 - f1f3a429f930c0f3aae80300e98113fae464a80275fab0d1e664e464a80275fa - b0dfe660fbc3bb008c8b44088b4c0a0ee853ff732abe867de81c00be907de816 - 0030e4cd16c70672043412ea0000ffffbb0700b40ecd10ac84c075f4b401f9c3 - 52b408cd1388f55a72f580e13f74edfa668b460852660fb6d96631d266f7f388 - eb88d54330d266f7f388d75a663dff030000fb774486c4c0c80208e8409188fe - 28e08a660238e0720288e0bf0500c45e0450b402cd135b730a4f741c30e4cd13 - 93ebeb0fb6c30146087303ff460ad0e3005e052846027788c32ef6069908800f - 8479ffbbaa5552b441cd135a0f826fff81fb55aa0f8564fff6c1010f845dff89 - eeb442cd13c35265616400426f6f7400206572726f720d0a0080909090909090 - 9090909090909090909090909090909090909090909090909090909090900000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000080000100a5ffffff0000000050c3000055aa - - - - 512 - - 5745568200000000666431343430000000000000000000000000000000000000 - 00000000000000000002000012000000020000005000000024000000400b0000 - 00000000000000002c0101000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000057455682286903000020000000200000400b00000000000000020000 - 00080000400b0000000000000002000000080000400b00000000000000020000 - 0708060000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - diff --git a/tools/regression/geom/Data/disk.msdos.ext.xml b/tools/regression/geom/Data/disk.msdos.ext.xml deleted file mode 100644 index 868a88f7..0000000 --- a/tools/regression/geom/Data/disk.msdos.ext.xml +++ /dev/null @@ -1,534 +0,0 @@ - - - - $FreeBSD$ - A MSDOS 6.22 disk with maximal number of extended partitions. - - 512 - 0 - - 0 - - fa33c08ed0bc007c8bf45007501ffbfcbf0006b90001f2a5ea1d060000bebe07 - b304803c80740e803c00751c83c610fecb75efcd188b148b4c028bee83c610fe - cb741a803c0074f4be8b06ac3c00740b56bb0700b40ecd105eebf0ebfebf0500 - bb007cb8010257cd135f730c33c0cd134f75edbea306ebd3bec206bffe7d813d - 55aa75c78bf5ea007c0000496e76616c696420706172746974696f6e20746162 - 6c65004572726f72206c6f6164696e67206f7065726174696e67207379737465 - 6d004d697373696e67206f7065726174696e672073797374656d000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000008001 - 010006fe7f043f00000086fa3f000000410505fe7f38c5fa3f0034bf0c000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 512 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 2146798080 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410501fe7f053f000000823e00000000410605fe7f06c13e0000c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2155023360 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410601fe7f063f000000823e00000000410705fe7f07827d0000c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2163248640 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410701fe7f073f000000823e00000000410805fe7f0843bc0000c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2171473920 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410801fe7f083f000000823e00000000410905fe7f0904fb0000c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2179699200 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410901fe7f093f000000823e00000000410a05fe7f0ac5390100c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2187924480 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410a01fe7f0a3f000000823e00000000410b05fe7f0b86780100c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2196149760 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410b01fe7f0b3f000000823e00000000410c05fe7f0c47b70100c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2204375040 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410c01fe7f0c3f000000823e00000000410d05fe7f0d08f60100c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2212600320 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410d01fe7f0d3f000000823e00000000410e05fe7f0ec9340200c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2220825600 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410e01fe7f0e3f000000823e00000000410f05fe7f0f8a730200c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2229050880 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 410f01fe7f0f3f000000823e00000000411005fe7f104bb20200c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2237276160 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411001fe7f103f000000823e00000000411105fe7f110cf10200c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2245501440 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411101fe7f113f000000823e00000000411205fe7f12cd2f0300c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2253726720 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411201fe7f123f000000823e00000000411305fe7f138e6e0300c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2261952000 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411301fe7f133f000000823e00000000411405fe7f144fad0300c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2270177280 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411401fe7f143f000000823e00000000411505fe7f1510ec0300c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2278402560 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411501fe7f153f000000823e00000000411605fe7f16d12a0400c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2286627840 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411601fe7f163f000000823e00000000411705fe7f1792690400c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2294853120 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411701fe7f173f000000823e00000000411805fe7f1853a80400c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2303078400 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411801fe7f183f000000823e00000000411905fe7f1914e70400c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2311303680 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411901fe7f193f000000823e00000000411a05fe7f1ad5250500c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2319528960 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411a01fe7f1a3f000000823e00000000411b05fe7f1b96640500c13e00000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - - 2327754240 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000001 - 411b01fe7f1b3f000000823e0000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000000055aa - - - diff --git a/tools/regression/geom/Data/disk.msdos.flp.xml b/tools/regression/geom/Data/disk.msdos.flp.xml deleted file mode 100644 index d057d1a..0000000 --- a/tools/regression/geom/Data/disk.msdos.flp.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - $FreeBSD$ - A MSDOS floppy image. - - 512 - 0 - - 0 - - eb3c904d53444f53352e30000201010002e000400bf009001200020000000000 - 0000000000002911053b114e4f204e414d45202020204641543132202020fa33 - c08ed0bc007c1607bb780036c5371e561653bf3e7cb90b00fcf3a4061fc645fe - 0f8b0e187c884df9894702c7073e7cfbcd13727933c03906137c74088b0e137c - 890e207ca0107cf726167c03061c7c13161e7c03060e7c83d200a3507c891652 - 7ca3497c89164b7cb82000f726117c8b1e0b7c03c348f7f30106497c83164b7c - 00bb00058b16527ca1507ce89200721db001e8ac0072168bfbb90b00bee67df3 - a6750a8d7f20b90b00f3a67418be9e7de85f0033c0cd165e1f8f048f4402cd19 - 585858ebe88b471a48488a1e0d7c32fff7e30306497c13164b7cbb0007b90300 - 505251e83a0072d8b001e85400595a5872bb05010083d200031e0b7ce2e28a2e - 157c8a16247c8b1e497ca14b7cea00007000ac0ac07429b40ebb0700cd10ebf2 - 3b16187c7319f736187cfec288164f7c33d2f7361a7c8816257ca34d7cf8c3f9 - c3b4028b164d7cb106d2e60a364f7c8bca86e98a16247c8a36257ccd13c30d0a - 4e6f6e2d53797374656d206469736b206f72206469736b206572726f720d0a52 - 65706c61636520616e6420707265737320616e79206b6579207768656e207265 - 6164790d0a00494f2020202020205359534d53444f53202020535953000055aa - - - - 512 - - f0ffff03400005600007800009a0000bc0000de0000f00011120011340011560 - 0117800119a0011bc0011de0011f000221200223400225600227800229a0022b - c0022de0022f000331200333400335600337800339a0033bc0033de0033f0004 - 41200443400445600447800449a0044bc0044de0044f000551f0ff5340055560 - 0557800559a0055bc0055de0055f000661200663400665600667800669a0066b - c0066de0066f000771200773400775600777800779a0077bc0077de0077f0008 - 81200883400885600887800889a0088bc0088de0088f00099120099340099560 - 0997800999a0099bc009ffef099f000aa1200aa3400aa5600aa7800aa9a00aab - c00aade00aaf000bb1200bb3400bb5600bb7800bb9a00bbbc00bbde00bbf000c - c1200cc3400cc5600cc7800cc9a00ccbc00ccde00ccf000dd1200dd3400dd560 - 0dd7800dd9a00ddbc00ddde00ddf000ee1200ee3400ee5600ee7800ee9a00eeb - c00eede00eef000ff1200ff3400ff5600ff7800ff9a00ffbc00ffde00fff0010 - 01211003411005611007f1ff09a1100bc1100de1100f01111121111341111561 - 1117811119a1111bc1111de1111f011221211223411225611227811229a1122b - c1122de1122f011331211333411335611337811339a1133bc1133de1133f0114 - 41211443411445611447811449a1144bc1144de1144f01155121155341155561 - - - diff --git a/tools/regression/geom/Data/disk.pc98.wdc0.xml b/tools/regression/geom/Data/disk.pc98.wdc0.xml deleted file mode 100644 index 6bae97f..0000000 --- a/tools/regression/geom/Data/disk.pc98.wdc0.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - $FreeBSD$ - - A PC98 disklabel from Warner - - 512 - 0 - 17 - 8 - 0 - - 0 - - e9fd009049504c310000001ea08405b48ecd1ba820742232dbb414cd1b721a80 - fb847515e896007303eb6b90b424bb0004b93012ba4001cd1bbb0001b484cd1b - b40633c933d2508cc82dc0038ec05833edcd1b7241b406ba010081c50008cd1b - 7234ba0400f7c300aa7403ba0200b406bb001c81c50008cd1b721b508bc5b104 - d3e88cc103c18bf058e815002e89360a002eff1e0800e80800b40ecd1bb90100 - cb56a0840532dbb414cd1b720e80fb8475092ec606d40000e802005ec3b4b0be - d000ba06001e0e1fcd1bb4b0cd1b1fc31e000000010000000000000000000000 - 000000000000000000000000000000000000000000000000000000000d0055aa - fa601e066800d81f33f6b51e813c8b46750e817c0204eb7507817c05b4007405 - 46e2e9eb6032ff8a5c040358f18d7c03be9a012e015c03b00cba6104eeb002ba - 3d05ee68009807b95b00f32ea4b9ff0f33f633d226ad02f402d0e2f8f6def6da - 268914b416b3c2e4f0a840750680cc2080cb048ac3ba3f04ee8ac4ba3d05eeb0 - 08ba6104ee071f612ec7060000eb0a2ec70602009090fbe966fec390e8ebffb9 - 21007402b1118bc1f6660702460612e5912ef66703f7660403c183d200c3fec2 - 26881605205926880e0a20c390909090905191b81100502ef6670291f7f126a3 - 0220599233d2f7f12680260420f02608060420ebc9000000000080010d0055aa - - - - 512 - - 94c4000000000100000001000000405b46726565425344000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 70144 - - 5745568205000000776430733100000000000000000000000000000000000000 - 0000000000000000000200001100000008000000415b000088000000887a3000 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000005745568295f208000020000000200000005802008800000000000000 - 0700000000200300885802000000000001000000007a30008800000000000000 - 0000000000000000000000000000000000000000009001008878050000000000 - 0700000000722900880807000000000007000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - diff --git a/tools/regression/geom/Data/disk.sun.da0.xml b/tools/regression/geom/Data/disk.sun.da0.xml deleted file mode 100644 index 826581f..0000000 --- a/tools/regression/geom/Data/disk.sun.da0.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - $FreeBSD$ - A Solaris 8 disklabel - - 512 - 0 - 0 - 0 - 0 - - 0 - - 49424d2d444459532d5433363935304d2d533936482063796c20313439373020 - 616c742032206864203132207365632033393900000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000100000000000000000008000200000003000100050000000000000000 - 0000000000000000000000080000003f000000000000000000000000600ddeee - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000027103a7c00000000000000013a7a0002000c018f00000000000000dc - 002d96c000000000001012b0000000000445b1c8000000000000000000000000 - 00000000000000000000000000000000000000000000034c04080858dabe5ec8 - - - diff --git a/tools/regression/geom/Data/disk.sun.da1.xml b/tools/regression/geom/Data/disk.sun.da1.xml deleted file mode 100644 index 0aac8e5..0000000 --- a/tools/regression/geom/Data/disk.sun.da1.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - $FreeBSD$ - A Solaris 8 disklabel - - 512 - 0 - 0 - 0 - 0 - - 0 - - 53554e3138472063796c203735303620616c7420322068642031392073656320 - 3234380000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000170686b00000000000008000200000003000100050000000800010000 - 00000007000000040000000800000000000000000000000000000000600ddeee - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000001c201d5400000000000000011d520002001300f80000000000000000 - 0007d6480000006d0020113000000000021bad5000000b4e014b873800000000 - 000000000000022b00400ff8000005a600400ff80000092100280c48dabe971e - - - diff --git a/tools/regression/geom/Data/disk.typo.ad0.xml b/tools/regression/geom/Data/disk.typo.ad0.xml deleted file mode 100644 index 56383ab..0000000 --- a/tools/regression/geom/Data/disk.typo.ad0.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - $FreeBSD$ - A multislice FreeBSD disk - - 512 - 0 - - 0 - - fc31c08ec08ed88ed0bc007cbd000a89efb108f3abfe45f252bb000689eeb802 - 02e82e015ae9008af686bbfd20750484d278048a96bafd885600e8fc0052bbc2 - 0731d2886ffc0fa396bbfd731c8a07bf0f08b103f2ae7411b10df2ae750481c7 - 0d008a0d01cfe8c1004280c31073d4582c7f3a067504720548740e30c004b088 - 86b8fdbfb207e8a100be0308e8ad008a96b9fd4ee8880030e4cd1a89d703bebc - fdb401cd16751330e4cd1a39fa72f28a86b9fdeb15b007e88e0030e4cd1688e0 - 3c1c74eb2c3b3c0477eb980fa3460c73e48886b9fdbe000a8a1489f33c049c74 - 0ac0e00405be0793c6078053f686bbfd407509bb0006b80103e856005e9d7507 - 8a96b8fd80ea30bb007cb80102e8420072a381bffe0155aa759be81c00ffe3b0 - 46e82400b03100d0eb170fab560cbe0008e8ebff89fee80300be0d08aca88075 - 05e80400ebf6247f53bb0700b40ecd105bc38a74018b4c025689e780feff7540 - 83f9ff753bf686bbfd8074345153bbaa5550b441cd1358720e81fb55aa7508f6 - c101740380cc405b59f6c4407412666a0066ff740806536a006a1089e6864402 - cd1389fc5ec39090909090909090909001014472697665200000808fb6008001 - 0100a5ef7f9f3f000000c1f95f00000041a0a5efffff00fa5f0050e29f0000ff - ffffa5efffff50dcff0050dcff000000000000000000000000000000000055aa - - - - 512 - - 2020a00a44656661756c743aa00d8a00050f010406070b0c0e6383a5a6a9b70e - 141312141d1c1b2124282e3439556e6b6e6f77ee444fd357696e646f7773204e - d457696e646f77f3554e49d84c696e75f8467265654253c44f70656e4253c44e - 65744253c44253442f4fd3000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 32768 - - 5745568205000000616430733100000000000000000000000000000000000000 - 0000000000000000000200003f000000f0000000180a0000103b000080295402 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000005745568204c108000020000000200000002003003f00000000000000 - 0700000000a00f003f2003000000000001000000c1f95f003f00000000000000 - 000000000000000000000000000000000000000000a00f003fc0120000000000 - 07000000c1993d003f6022000000000007000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 64512 - - 0000007c0000010002000400f8ff0000000400f8000000000000000000000004 - 0000004000000008000000000010007e00800000070000fe1f00000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 104922112 - - 3310f30d0350fbf66f44ebd906c9963d46b2bf609bb753131e7c24cf9ed194ce - a59117b612772b207ddcb753df72456f98d0cac567f60526c7b9308afd87e657 - dd45b3d1eb075b6820aa6ea5a0f10511f65a257f0d7d89d88e189bef43786ff5 - a0316511a7a07168f2ef001e71fbc56dd8ddc7866c4856dc979742be22f4badd - e1fcba7aebe4b5f4bb8b0c89e84de59f0ba48d7a8b00bb1797fc057e3d3d8058 - 4b1987ac49b74bed74cb4985850d5be64e8188d40ad0323165b355c512a91523 - 5d5211eeb021c754f552b160f9a73c4c5e59370163cf531ca0382cc462f9ac9d - 35612380f7a5d9d5e3bde129ef6fab02347088025d0937fb6c56dc68c283ce9d - 1cfc5b3c7ad1f52faeae05188386cb57cb88c5dccaa2db17a09420ae7d9f9d6e - 058370711f445cff4d4543ee9f0c3054400116304018f68d9c08d05b04680162 - 23172b8b1775157790fe5e5100c530e3377d383a0080468b0125e87e8d7dee5f - 46030a238dc8a0000cb4eafc6ad4735f2c16d1642e3834aefbb5bfc25fcc0062 - 3a89410ab88839e3ed151cd6bc2b5704c5db4c9fc39662bd3a41347212c664be - 04684e551c0a0362bb3139a460a7c8d178c349a47d724b7d456606b2f47a8d99 - d4af7998148ed93443a828ece96cdb7eb158a21189ed1527bdad7b18b74f168b - d01fcfde994977174e41ad8f6ea19fac8bb95e5d68643d0457d746cf32531639 - - - - 629210112 - - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 1153498112 - - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 3220439552 - - 5745568205000000616430733200000000000000000000000000000000000000 - 0000000000000000000200003f000000f0000000180a0000103b000080295402 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000057455682fc1908000020000000200000000000000000000000000000 - 000000000000000000000000000000000000000050e29f0000fa5f0000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - - 6440878080 - - 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a - 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a - 0a0a0a0a0a0a0a0a0a0a0a0a3c4120200a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a - 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a - 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a - 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a - 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a687265663d22687474703a2f2f777777 - 2e706c6179626f7973746f72652e636f6d2f70626c696e6b2e6367693f616666 - 696c696174653d4d4f3130303030303034353426736b753d4249303130362220 - 7461726765743d225f626c616e6b22206f6e6d6f7573656f7665723d22706172 - 656e742e77696e646f772e7374617475733d27506c6179626f792053746f7265 - 273b2072657475726e2074727565223e3c494d47207372633d22687474703a2f - 2f61313833322e672e616b2e706c6179626f792e636f6d2f372f313833322f32 - 332f3939303232313437302f7777772e706c6179626f792e636f6d2f6d616761 - 7a696e652f63757272656e742f696d782f636f7665725f696e6465782e6a7067 - 2220616c69676e3d72696768742077696474683d223135302220686569676874 - - - - 8585257472 - - 5745568205000000616430733300000000000000000000000000000000000000 - 0000000000000000000200003f000000f000000055040000103b000050dcff00 - 0000000000000000100e01000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000057455682bcbd0800002000000020000000803e0050dcff0000040000 - 070816000000000000000000000000000000000050dcff0050dcff0000000000 - 00000000505cc100505c3e010010000007049f00000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - - - diff --git a/tools/regression/geom/MdLoad/Makefile b/tools/regression/geom/MdLoad/Makefile deleted file mode 100644 index eab3f89..0000000 --- a/tools/regression/geom/MdLoad/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $FreeBSD$ - -PROG= MdLoad -DPADD= ${LIBSBUF} ${LIBBSDXML} -LDADD= -lsbuf -lbsdxml - -MAN= - - -WARNS?= 4 -.include "bsd.prog.mk" - -test: ${PROG} - ./${PROG} md34 ../Data/disk.critter.ad0.xml diff --git a/tools/regression/geom/MdLoad/MdLoad.c b/tools/regression/geom/MdLoad/MdLoad.c deleted file mode 100644 index 33ee4de..0000000 --- a/tools/regression/geom/MdLoad/MdLoad.c +++ /dev/null @@ -1,271 +0,0 @@ -/*- - * Copyright (c) 2003 Poul-Henning Kamp - * Copyright (c) 2002 Networks Associates Technology, Inc. - * All rights reserved. - * - * This software was developed for the FreeBSD Project by Poul-Henning Kamp - * and NAI Labs, the Security Research Division of Network Associates, Inc. - * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the - * DARPA CHATS research program. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The names of the authors may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct sector { - LIST_ENTRY(sector) sectors; - off_t offset; - unsigned char *data; -}; - -struct simdisk_softc { - int sectorsize; - off_t mediasize; - off_t lastsector; - LIST_HEAD(,sector) sectors; - struct sbuf *sbuf; - struct sector *sp; - u_int fwsectors; - u_int fwheads; - u_int fwcylinders; -}; - -static void -g_simdisk_insertsector(struct simdisk_softc *sc, struct sector *dsp) -{ - struct sector *dsp2, *dsp3; - - if (sc->lastsector < dsp->offset) - sc->lastsector = dsp->offset; - if (LIST_EMPTY(&sc->sectors)) { - LIST_INSERT_HEAD(&sc->sectors, dsp, sectors); - return; - } - dsp3 = NULL; - LIST_FOREACH(dsp2, &sc->sectors, sectors) { - dsp3 = dsp2; - if (dsp2->offset > dsp->offset) { - LIST_INSERT_BEFORE(dsp2, dsp, sectors); - return; - } - } - LIST_INSERT_AFTER(dsp3, dsp, sectors); -} - -static void -startElement(void *userData, const char *name, const char **atts __unused) -{ - struct simdisk_softc *sc; - - sc = userData; - if (!strcasecmp(name, "sector")) { - sc->sp = calloc(1, sizeof(*sc->sp) + sc->sectorsize); - sc->sp->data = (u_char *)(sc->sp + 1); - } - sbuf_clear(sc->sbuf); -} - -static void -endElement(void *userData, const char *name) -{ - struct simdisk_softc *sc; - char *p; - u_char *q; - int i, j; - off_t o; - - sc = userData; - - if (!strcasecmp(name, "comment")) { - sbuf_clear(sc->sbuf); - return; - } - sbuf_finish(sc->sbuf); - if (!strcasecmp(name, "sectorsize")) { - sc->sectorsize = strtoul(sbuf_data(sc->sbuf), &p, 0); - if (*p != '\0') - errx(1, "strtoul croaked on sectorsize"); - } else if (!strcasecmp(name, "mediasize")) { - o = strtoull(sbuf_data(sc->sbuf), &p, 0); - if (*p != '\0') - errx(1, "strtoul croaked on mediasize"); - if (o > 0) - sc->mediasize = o; - } else if (!strcasecmp(name, "fwsectors")) { - sc->fwsectors = strtoul(sbuf_data(sc->sbuf), &p, 0); - if (*p != '\0') - errx(1, "strtoul croaked on fwsectors"); - } else if (!strcasecmp(name, "fwheads")) { - sc->fwheads = strtoul(sbuf_data(sc->sbuf), &p, 0); - if (*p != '\0') - errx(1, "strtoul croaked on fwheads"); - } else if (!strcasecmp(name, "fwcylinders")) { - sc->fwcylinders = strtoul(sbuf_data(sc->sbuf), &p, 0); - if (*p != '\0') - errx(1, "strtoul croaked on fwcylinders"); - } else if (!strcasecmp(name, "offset")) { - sc->sp->offset= strtoull(sbuf_data(sc->sbuf), &p, 0); - if (*p != '\0') - errx(1, "strtoul croaked on offset"); - } else if (!strcasecmp(name, "fill")) { - j = strtoul(sbuf_data(sc->sbuf), NULL, 16); - memset(sc->sp->data, j, sc->sectorsize); - } else if (!strcasecmp(name, "hexdata")) { - q = sc->sp->data; - p = sbuf_data(sc->sbuf); - for (i = 0; i < sc->sectorsize; i++) { - if (!isxdigit(*p)) - errx(1, "I croaked on hexdata %d:(%02x)", i, *p); - if (isdigit(*p)) - j = (*p - '0') << 4; - else - j = (tolower(*p) - 'a' + 10) << 4; - p++; - if (!isxdigit(*p)) - errx(1, "I croaked on hexdata %d:(%02x)", i, *p); - if (isdigit(*p)) - j |= *p - '0'; - else - j |= tolower(*p) - 'a' + 10; - p++; - *q++ = j; - } - } else if (!strcasecmp(name, "sector")) { - g_simdisk_insertsector(sc, sc->sp); - sc->sp = NULL; - } else if (!strcasecmp(name, "diskimage")) { - } else if (!strcasecmp(name, "FreeBSD")) { - } else { - printf("<%s>[[%s]]\n", name, sbuf_data(sc->sbuf)); - } - sbuf_clear(sc->sbuf); -} - -static void -characterData(void *userData, const XML_Char *s, int len) -{ - const char *b, *e; - struct simdisk_softc *sc; - - sc = userData; - b = s; - e = s + len - 1; - while (isspace(*b) && b < e) - b++; - while (isspace(*e) && e > b) - e--; - if (e != b || !isspace(*b)) - sbuf_bcat(sc->sbuf, b, e - b + 1); -} - -static struct simdisk_softc * -g_simdisk_xml_load(const char *file) -{ - XML_Parser parser = XML_ParserCreate(NULL); - struct stat st; - char *p; - struct simdisk_softc *sc; - int fd, i; - - sc = calloc(1, sizeof *sc); - sc->sbuf = sbuf_new_auto(); - LIST_INIT(&sc->sectors); - XML_SetUserData(parser, sc); - XML_SetElementHandler(parser, startElement, endElement); - XML_SetCharacterDataHandler(parser, characterData); - - fd = open(file, O_RDONLY); - if (fd < 0) - err(1, file); - fstat(fd, &st); - p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0); - i = XML_Parse(parser, p, st.st_size, 1); - if (i != 1) - errx(1, "XML_Parse complains: return %d", i); - munmap(p, st.st_size); - close(fd); - XML_ParserFree(parser); - return (sc); -} - -int -main(int argc, char **argv) -{ - struct simdisk_softc *sc; - char buf[BUFSIZ]; - int error, fd; - struct sector *dsp; - - if (argc != 3) - errx(1, "Usage: %s mddevice xmlfile", argv[0]); - - sc = g_simdisk_xml_load(argv[2]); - if (sc->mediasize == 0) - sc->mediasize = sc->lastsector + sc->sectorsize * 10; - if (sc->sectorsize == 0) - sc->sectorsize = 512; - sprintf(buf, "mdconfig -a -t malloc -s %jd -S %d", - (intmax_t)sc->mediasize / sc->sectorsize, sc->sectorsize); - if (sc->fwsectors && sc->fwheads) - sprintf(buf + strlen(buf), " -x %d -y %d", - sc->fwsectors, sc->fwheads); - sprintf(buf + strlen(buf), " -u %s", argv[1]); - error = system(buf); - if (error) - return (error); - fd = open(argv[1], O_RDWR); - if (fd < 0 && errno == ENOENT) { - sprintf(buf, "%s%s", _PATH_DEV, argv[1]); - fd = open(buf, O_RDWR); - } - if (fd < 0) - err(1, "Could not open %s", argv[1]); - LIST_FOREACH(dsp, &sc->sectors, sectors) { - lseek(fd, dsp->offset, SEEK_SET); - error = write(fd, dsp->data, sc->sectorsize); - if (error != sc->sectorsize) - err(1, "write sectordata failed"); - } - close(fd); - exit (0); -} diff --git a/tools/regression/geom/Ref/disk.alpha.da0.xml b/tools/regression/geom/Ref/disk.alpha.da0.xml deleted file mode 100644 index a300f0d..0000000 --- a/tools/regression/geom/Ref/disk.alpha.da0.xml +++ /dev/null @@ -1,7 +0,0 @@ -$FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 251658240 491520 -/dev/md34b 512 1086291968 2121664 -/dev/md34c 512 18309995520 35761710 -/dev/md34e 512 20971520 40960 -/dev/md34f 512 16951073792 33107566 diff --git a/tools/regression/geom/Ref/disk.alpha2.da0.xml b/tools/regression/geom/Ref/disk.alpha2.da0.xml deleted file mode 100644 index 7ef7573..0000000 --- a/tools/regression/geom/Ref/disk.alpha2.da0.xml +++ /dev/null @@ -1,5 +0,0 @@ -$FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 24675840 48195 -/dev/md34b 512 4178442240 8161020 -/dev/md34c 512 74027520 144585 diff --git a/tools/regression/geom/Ref/disk.apple.xml b/tools/regression/geom/Ref/disk.apple.xml deleted file mode 100644 index a2a0f98..0000000 --- a/tools/regression/geom/Ref/disk.apple.xml +++ /dev/null @@ -1,5 +0,0 @@ -$FreeBSD$ -/dev/md34 512 366530560 715880 -/dev/md34s1 512 366481408 715784 -/dev/md34s2 512 32256 63 -/dev/md34s3 512 16384 32 diff --git a/tools/regression/geom/Ref/disk.beast.da0.xml b/tools/regression/geom/Ref/disk.beast.da0.xml deleted file mode 100644 index b6aa32e..0000000 --- a/tools/regression/geom/Ref/disk.beast.da0.xml +++ /dev/null @@ -1,5 +0,0 @@ -$FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 4064280576 7938048 -/dev/md34b 512 270925824 529152 -/dev/md34c 512 4335206400 8467200 diff --git a/tools/regression/geom/Ref/disk.critter.ad0.xml b/tools/regression/geom/Ref/disk.critter.ad0.xml deleted file mode 100644 index 0620bfe..0000000 --- a/tools/regression/geom/Ref/disk.critter.ad0.xml +++ /dev/null @@ -1,11 +0,0 @@ -$FreeBSD$ -/dev/md34 512 2671841280 5218440 -/dev/md34s1 512 20003848704 39070017 -/dev/md34s1a 512 1073741824 2097152 -/dev/md34s1b 512 1073741824 2097152 -/dev/md34s1c 512 20003848704 39070017 -/dev/md34s1d 512 4447175168 8685889 -/dev/md34s1e 512 524288000 1024000 -/dev/md34s1f 512 4294967296 8388608 -/dev/md34s1g 512 3221225472 6291456 -/dev/md34s1h 512 5368709120 10485760 diff --git a/tools/regression/geom/Ref/disk.empty.flp.xml b/tools/regression/geom/Ref/disk.empty.flp.xml deleted file mode 100644 index 659b416..0000000 --- a/tools/regression/geom/Ref/disk.empty.flp.xml +++ /dev/null @@ -1,2 +0,0 @@ -$FreeBSD$ -/dev/md34 512 1474560 2880 80 2 18 diff --git a/tools/regression/geom/Ref/disk.far.ad0.xml b/tools/regression/geom/Ref/disk.far.ad0.xml deleted file mode 100644 index 629816a..0000000 --- a/tools/regression/geom/Ref/disk.far.ad0.xml +++ /dev/null @@ -1,4 +0,0 @@ -$FreeBSD$ -/dev/md34 512 5632 11 -/dev/md34s1 512 296821760 579730 -/dev/md34s2 512 4564740096 8915508 diff --git a/tools/regression/geom/Ref/disk.flat.da1.xml b/tools/regression/geom/Ref/disk.flat.da1.xml deleted file mode 100644 index 89e2df4..0000000 --- a/tools/regression/geom/Ref/disk.flat.da1.xml +++ /dev/null @@ -1,12 +0,0 @@ -$FreeBSD$ -/dev/md34 512 37888 74 -/dev/md34a 512 37748736 73728 -/dev/md34b 512 268435456 524288 -/dev/md34c 512 8422686720 16450560 -/dev/md34h 512 8115978240 15851520 -/dev/md34s1 512 18367017984 35873082 -/dev/md34s1b 512 419430400 819200 -/dev/md34s1c 512 18367017984 35873082 -/dev/md34s1e 512 419430400 819200 -/dev/md34s1f 512 1073741824 2097152 -/dev/md34s1g 512 16454415360 32137530 diff --git a/tools/regression/geom/Ref/disk.kern.flp.xml b/tools/regression/geom/Ref/disk.kern.flp.xml deleted file mode 100644 index 6ff67a0..0000000 --- a/tools/regression/geom/Ref/disk.kern.flp.xml +++ /dev/null @@ -1,5 +0,0 @@ -$FreeBSD$ -/dev/md34 512 5632 11 -/dev/md34a 512 1474560 2880 -/dev/md34b 512 1474560 2880 -/dev/md34c 512 1474560 2880 diff --git a/tools/regression/geom/Ref/disk.msdos.ext.xml b/tools/regression/geom/Ref/disk.msdos.ext.xml deleted file mode 100644 index dc2aced..0000000 --- a/tools/regression/geom/Ref/disk.msdos.ext.xml +++ /dev/null @@ -1,27 +0,0 @@ -$FreeBSD$ -/dev/md34 512 2327759360 4546405 -/dev/md34s1 512 2146765824 4192902 -/dev/md34s10 512 8193024 16002 -/dev/md34s11 512 8193024 16002 -/dev/md34s12 512 8193024 16002 -/dev/md34s13 512 8193024 16002 -/dev/md34s14 512 8193024 16002 -/dev/md34s15 512 8193024 16002 -/dev/md34s16 512 8193024 16002 -/dev/md34s17 512 8193024 16002 -/dev/md34s18 512 8193024 16002 -/dev/md34s19 512 8193024 16002 -/dev/md34s2 512 427714560 835380 -/dev/md34s20 512 8193024 16002 -/dev/md34s21 512 8193024 16002 -/dev/md34s22 512 8193024 16002 -/dev/md34s23 512 8193024 16002 -/dev/md34s24 512 8193024 16002 -/dev/md34s25 512 8193024 16002 -/dev/md34s26 512 8193024 16002 -/dev/md34s27 512 8193024 16002 -/dev/md34s5 512 8193024 16002 -/dev/md34s6 512 8193024 16002 -/dev/md34s7 512 8193024 16002 -/dev/md34s8 512 8193024 16002 -/dev/md34s9 512 8193024 16002 diff --git a/tools/regression/geom/Ref/disk.msdos.flp.xml b/tools/regression/geom/Ref/disk.msdos.flp.xml deleted file mode 100644 index c176c58..0000000 --- a/tools/regression/geom/Ref/disk.msdos.flp.xml +++ /dev/null @@ -1,2 +0,0 @@ -$FreeBSD$ -/dev/md34 512 5632 11 diff --git a/tools/regression/geom/Ref/disk.pc98.wdc0.xml b/tools/regression/geom/Ref/disk.pc98.wdc0.xml deleted file mode 100644 index 5ffb0c9..0000000 --- a/tools/regression/geom/Ref/disk.pc98.wdc0.xml +++ /dev/null @@ -1,8 +0,0 @@ -$FreeBSD$ -/dev/md34 512 75264 147 1 8 17 -/dev/md34s1 512 1626603520 3176960 23360 8 17 -/dev/md34s1a 512 78643200 153600 1129 8 17 -/dev/md34s1b 512 104857600 204800 1505 8 17 -/dev/md34s1c 512 1626603520 3176960 23360 8 17 -/dev/md34s1e 512 52428800 102400 752 8 17 -/dev/md34s1f 512 1390673920 2716160 19971 8 17 diff --git a/tools/regression/geom/Ref/disk.sun.da0.xml b/tools/regression/geom/Ref/disk.sun.da0.xml deleted file mode 100644 index 15b97c8..0000000 --- a/tools/regression/geom/Ref/disk.sun.da0.xml +++ /dev/null @@ -1,6 +0,0 @@ -$FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 1529708544 2987712 -/dev/md34b 512 539320320 1053360 -/dev/md34c 512 36698296320 71676360 -/dev/md34h 512 34629267456 67635288 diff --git a/tools/regression/geom/Ref/disk.sun.da1.xml b/tools/regression/geom/Ref/disk.sun.da1.xml deleted file mode 100644 index 004771b..0000000 --- a/tools/regression/geom/Ref/disk.sun.da1.xml +++ /dev/null @@ -1,9 +0,0 @@ -$FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 262967296 513608 -/dev/md34b 512 1075994624 2101552 -/dev/md34c 512 18108555264 35368272 -/dev/md34d 512 11124240384 21727032 -/dev/md34f 512 2149576704 4198392 -/dev/md34g 512 2149576704 4198392 -/dev/md34h 512 1343787008 2624584 diff --git a/tools/regression/geom/Ref/disk.typo.ad0.xml b/tools/regression/geom/Ref/disk.typo.ad0.xml deleted file mode 100644 index 6d537dd..0000000 --- a/tools/regression/geom/Ref/disk.typo.ad0.xml +++ /dev/null @@ -1,14 +0,0 @@ -$FreeBSD$ -/dev/md34 512 8585262592 16768091 -/dev/md34s1 512 3220406784 6289857 -/dev/md34s1a 512 104857600 204800 -/dev/md34s1b 512 524288000 1024000 -/dev/md34s1c 512 3220406784 6289857 -/dev/md34s1e 512 524288000 1024000 -/dev/md34s1f 512 2066973184 4037057 -/dev/md34s2 512 5364817920 10478160 -/dev/md34s2c 512 5364817920 10478160 -/dev/md34s3 512 8585256960 16768080 -/dev/md34s3a 512 2097152000 4096000 -/dev/md34s3c 512 8585256960 16768080 -/dev/md34s3d 512 6488104960 12672080 diff --git a/tools/regression/geom/RunTest.sh b/tools/regression/geom/RunTest.sh deleted file mode 100644 index 46a14b4..0000000 --- a/tools/regression/geom/RunTest.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -MD=34 -TMP=/tmp/$$ - -set -e - -r=0 - -(cd MdLoad && make) > /dev/null 2>&1 - -for f in Data/disk.*.xml -do - b=`basename $f` - mdconfig -d -u $MD > /dev/null 2>&1 || true - if [ -c /dev/md$MD ] ; then - sleep 1 - fi - if [ -c /dev/md$MD ] ; then - sleep 1 - fi - if [ -c /dev/md$MD ] ; then - echo "/dev/md$MD is busy" 1>&2 - exit 1 - fi - MdLoad/MdLoad md${MD} $f - if [ -f Ref/$b ] ; then - if diskinfo /dev/md${MD}* | - diff -I '$FreeBSD' -u Ref/$b - > $TMP; then - echo "PASSED: $b" - else - echo "FAILED: $b" - sed 's/^/ /' $TMP - r=2; - fi - else - diskinfo /dev/md${MD}* > Ref/`basename $f` - fi -done - -mdconfig -d -u $MD > /dev/null 2>&1 || true -rm -f $TMP -exit $r diff --git a/tools/regression/geom/RunTest.t b/tools/regression/geom/RunTest.t deleted file mode 100644 index 96a3530..0000000 --- a/tools/regression/geom/RunTest.t +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -MD=34 -TMP=/tmp/$$ - -set -e - -# Start from the right directory so we can find all our data files. -cd `dirname $0` - -(cd MdLoad && make) > /dev/null 2>&1 - -# Print the test header -echo -n '1..' -echo `ls -1 Data/disk.*.xml | wc -l` - -for f in Data/disk.*.xml -do - b=`basename $f` - mdconfig -d -u $MD > /dev/null 2>&1 || true - if [ -c /dev/md$MD ] ; then - sleep 1 - fi - if [ -c /dev/md$MD ] ; then - sleep 1 - fi - if [ -c /dev/md$MD ] ; then - echo "Bail out!" - echo "/dev/md$MD is busy" - exit 1 - fi - MdLoad/MdLoad md${MD} $f - if [ -f Ref/$b ] ; then - if diskinfo /dev/md${MD}* | - diff -I '$FreeBSD' -u Ref/$b - > $TMP; then - echo "ok - $b" - else - echo "not ok - $b" - sed 's/^/# /' $TMP - fi - else - diskinfo /dev/md${MD}* > Ref/`basename $f` - fi -done - -mdconfig -d -u $MD > /dev/null 2>&1 || true -rm -f $TMP - -exit 0 diff --git a/tools/regression/geom_concat/conf.sh b/tools/regression/geom_concat/conf.sh deleted file mode 100644 index 0eaf1ba..0000000 --- a/tools/regression/geom_concat/conf.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="test" -class="concat" -base=`basename $0` - -. `dirname $0`/../geom_subr.sh diff --git a/tools/regression/geom_concat/test-1.t b/tools/regression/geom_concat/test-1.t deleted file mode 100644 index 8984f79..0000000 --- a/tools/regression/geom_concat/test-1.t +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo '1..1' - -us=45 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 -devwait - -# Size of created device should be 1MB + 2MB + 3MB. - -size=`diskinfo /dev/concat/${name} | awk '{print $3}'` - -if [ $size -eq 6291456 ]; then - echo "ok - Size is 6291456" -else - echo "not ok - Size is 6291456" -fi - -gconcat destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` diff --git a/tools/regression/geom_concat/test-2.t b/tools/regression/geom_concat/test-2.t deleted file mode 100644 index 445d9bc..0000000 --- a/tools/regression/geom_concat/test-2.t +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo '1..1' - -us=45 -tsize=6 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 -devwait - -dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1 -dd if=/dev/concat/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 - -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok - md5 checksum comparison" -else - echo "ok - md5 checksum comparison" -fi - -gconcat destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` -rm -f ${src} ${dst} diff --git a/tools/regression/geom_eli/attach-d.t b/tools/regression/geom_eli/attach-d.t deleted file mode 100644 index 4c4789e..0000000 --- a/tools/regression/geom_eli/attach-d.t +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..3" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile md${no} -geli attach -d -p -k $keyfile md${no} -if [ -c /dev/md${no}.eli ]; then - echo "ok 1" -else - echo "not ok 1" -fi -# Be sure it doesn't detach on read. -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null -sleep 1 -if [ -c /dev/md${no}.eli ]; then - echo "ok 2" -else - echo "not ok 2" -fi -true > /dev/md${no}.eli -sleep 1 -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -mdconfig -d -u $no -rm -f $keyfile diff --git a/tools/regression/geom_eli/configure-b-B.t b/tools/regression/geom_eli/configure-b-B.t deleted file mode 100644 index 23aa412..0000000 --- a/tools/regression/geom_eli/configure-b-B.t +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..17" - -geli init -B none -P -K /dev/null md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -geli init -B none -b -P -K /dev/null md${no} -if [ $? -eq 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -geli configure -B md${no} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi - -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi - -geli configure -b md${no} -if [ $? -eq 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -geli attach -p -k /dev/null md${no} -if [ $? -eq 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi - -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi - -geli configure -B md${no} -if [ $? -eq 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi - -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null -if [ $? -ne 0 ]; then - echo "ok 12" -else - echo "not ok 12" -fi - -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 13" -else - echo "not ok 13" -fi - -geli configure -b md${no} -if [ $? -eq 0 ]; then - echo "ok 14" -else - echo "not ok 14" -fi - -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 15" -else - echo "not ok 15" -fi - -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 16" -else - echo "not ok 16" -fi - -geli detach md${no} -if [ $? -eq 0 ]; then - echo "ok 17" -else - echo "not ok 17" -fi - -mdconfig -d -u $no diff --git a/tools/regression/geom_eli/delkey.t b/tools/regression/geom_eli/delkey.t deleted file mode 100644 index a828622..0000000 --- a/tools/regression/geom_eli/delkey.t +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile3=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile4=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..14" - -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile1 md${no} -geli attach -p -k $keyfile1 md${no} -geli setkey -n 1 -P -K $keyfile2 md${no} - -# Remove key 0 for attached provider. -geli delkey -n 0 md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -geli detach md${no} - -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -# Attach with key 1. -geli attach -p -k $keyfile2 md${no} -if [ $? -eq 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -# We cannot remove last key without -f option (for attached provider). -geli delkey -n 1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -# Remove last key for attached provider. -geli delkey -f -n 1 md${no} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi - -# If there are no valid keys, but provider is attached, we can save situation. -geli setkey -n 0 -P -K $keyfile3 md${no} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi -geli detach md${no} - -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -# Attach with key 0. -geli attach -p -k $keyfile3 md${no} -if [ $? -eq 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -# Setup key 1. -geli setkey -n 1 -P -K $keyfile4 md${no} -if [ $? -eq 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi -geli detach md${no} - -# Remove key 1 for detached provider. -geli delkey -n 1 md${no} -if [ $? -eq 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi - -# We cannot use keyfile4 anymore. -geli attach -p -k $keyfile4 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi - -# We cannot remove last key without -f option (for detached provider). -geli delkey -n 0 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 12" -else - echo "not ok 12" -fi - -# Remove last key for detached provider. -geli delkey -f -n 0 md${no} -if [ $? -eq 0 ]; then - echo "ok 13" -else - echo "not ok 13" -fi - -# We cannot use keyfile3 anymore. -geli attach -p -k $keyfile3 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 14" -else - echo "not ok 14" -fi - -mdconfig -d -u $no -rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 diff --git a/tools/regression/geom_eli/detach-l.t b/tools/regression/geom_eli/detach-l.t deleted file mode 100644 index dfa3269..0000000 --- a/tools/regression/geom_eli/detach-l.t +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..4" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile md${no} -geli attach -p -k $keyfile md${no} -if [ -c /dev/md${no}.eli ]; then - echo "ok 1" -else - echo "not ok 1" -fi -# Be sure it doesn't detach before 'detach -l'. -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null -sleep 1 -if [ -c /dev/md${no}.eli ]; then - echo "ok 2" -else - echo "not ok 2" -fi -geli detach -l md${no} -if [ -c /dev/md${no}.eli ]; then - echo "ok 3" -else - echo "not ok 3" -fi -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null -sleep 1 -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -mdconfig -d -u $no -rm -f $keyfile diff --git a/tools/regression/geom_eli/init-B.t b/tools/regression/geom_eli/init-B.t deleted file mode 100644 index 36ab873..0000000 --- a/tools/regression/geom_eli/init-B.t +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -backupfile=`mktemp /tmp/$base.XXXXXX` || exit 1 - -echo "1..13" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -mdconfig -a -t malloc -s $sectors -u $no || exit 1 - -# -B none -rm -f /var/backups/md${no}.eli -geli init -B none -P -K $keyfile md${no} 2>/dev/null -if [ ! -f /var/backups/md${no}.eli ]; then - echo "ok 1 - -B none" -else - echo "not ok 1 - -B none" -fi - -# no -B -rm -f /var/backups/md${no}.eli -geli init -P -K $keyfile md${no} >/dev/null 2>&1 -if [ -f /var/backups/md${no}.eli ]; then - echo "ok 2 - no -B" -else - echo "not ok 2 - no -B" -fi -geli clear md${no} -geli attach -p -k $keyfile md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 3 - no -B" -else - echo "not ok 3 - no -B" -fi -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 4 - no -B" -else - echo "not ok 4 - no -B" -fi -geli restore /var/backups/md${no}.eli md${no} -if [ $? -eq 0 ]; then - echo "ok 5 - no -B" -else - echo "not ok 5 - no -B" -fi -geli attach -p -k $keyfile md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 6 - no -B" -else - echo "not ok 6 - no -B" -fi -if [ -c /dev/md${no}.eli ]; then - echo "ok 7 - no -B" -else - echo "not ok 7 - no -B" -fi -geli detach md${no} -rm -f /var/backups/md${no}.eli - -# -B file -rm -f $backupfile -geli init -B $backupfile -P -K $keyfile md${no} >/dev/null 2>&1 -if [ -f $backupfile ]; then - echo "ok 8 - -B file" -else - echo "not ok 8 - -B file" -fi -geli clear md${no} -geli attach -p -k $keyfile md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 9 - -B file" -else - echo "not ok 9 - -B file" -fi -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 10 - -B file" -else - echo "not ok 10 - -B file" -fi -geli restore $backupfile md${no} -if [ $? -eq 0 ]; then - echo "ok 11 - -B file" -else - echo "not ok 11 - -B file" -fi -geli attach -p -k $keyfile md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 12 - -B file" -else - echo "not ok 12 - -B file" -fi -if [ -c /dev/md${no}.eli ]; then - echo "ok 13 - -B file" -else - echo "not ok 13 - -B file" -fi -geli detach md${no} -rm -f $backupfile - -mdconfig -d -u $no -rm -f $keyfile diff --git a/tools/regression/geom_eli/init-J.t b/tools/regression/geom_eli/init-J.t deleted file mode 100644 index 6f2862f..0000000 --- a/tools/regression/geom_eli/init-J.t +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile0=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -passfile0=`mktemp /tmp/$base.XXXXXX` || exit 1 -passfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..150" - -dd if=/dev/random of=${keyfile0} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile0} -dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile1} - -i=1 -for iter in -1 0 64; do - geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) -done - -mdconfig -d -u $no -rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} diff --git a/tools/regression/geom_eli/init-a.t b/tools/regression/geom_eli/init-a.t deleted file mode 100644 index 87612a2..0000000 --- a/tools/regression/geom_eli/init-a.t +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 - -echo "1..1380" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done - done -done - -rm -f $keyfile diff --git a/tools/regression/geom_eli/init-i-P.t b/tools/regression/geom_eli/init-i-P.t deleted file mode 100644 index a06f9f8..0000000 --- a/tools/regression/geom_eli/init-i-P.t +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..1" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -i 64 -P -K ${keyfile} md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -mdconfig -d -u $no -rm -f $keyfile diff --git a/tools/regression/geom_eli/init.t b/tools/regression/geom_eli/init.t deleted file mode 100644 index 6934443..0000000 --- a/tools/regression/geom_eli/init.t +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 - -echo "1..460" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - if [ ${md_rnd} != ${md_edev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done -done - -rm -f $keyfile diff --git a/tools/regression/geom_eli/integrity-copy.t b/tools/regression/geom_eli/integrity-copy.t deleted file mode 100644 index b52730a..0000000 --- a/tools/regression/geom_eli/integrity-copy.t +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 - -echo "1..5520" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - #mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - mdconfig -a -t malloc -s $sectors -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Copy first small sector to the second small sector. - # This should be detected as corruption. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'` - ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Copy first big sector to the second big sector. - # This should be detected as corruption. - dd if=/dev/md${no} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done - -rm -f $keyfile $sector diff --git a/tools/regression/geom_eli/integrity-data.t b/tools/regression/geom_eli/integrity-data.t deleted file mode 100644 index 6975466..0000000 --- a/tools/regression/geom_eli/integrity-data.t +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 - -echo "1..2760" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Corrupt 8 bytes of data. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=/dev/random of=${sector} bs=1 count=8 seek=64 conv=notrunc >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done - -rm -f $keyfile $sector diff --git a/tools/regression/geom_eli/integrity-hmac.t b/tools/regression/geom_eli/integrity-hmac.t deleted file mode 100644 index 33f6029..0000000 --- a/tools/regression/geom_eli/integrity-hmac.t +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 - -echo "1..2760" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Corrupt 8 bytes of HMAC. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=/dev/random of=${sector} bs=1 count=16 conv=notrunc >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done - -rm -f $keyfile $sector diff --git a/tools/regression/geom_eli/kill.t b/tools/regression/geom_eli/kill.t deleted file mode 100644 index 5c315f3..0000000 --- a/tools/regression/geom_eli/kill.t +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..9" - -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile1 md${no} -geli attach -p -k $keyfile1 md${no} -geli setkey -n 1 -P -K $keyfile2 md${no} - -# Kill attached provider. -geli kill md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -sleep 1 -# Provider should be automatically detached. -if [ ! -c /dev/md{$no}.eli ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -geli init -B none -P -K $keyfile1 md${no} -geli setkey -n 1 -p -k $keyfile1 -P -K $keyfile2 md${no} - -# Should be possible to attach with keyfile1. -geli attach -p -k $keyfile1 md${no} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi -geli detach md${no} - -# Should be possible to attach with keyfile2. -geli attach -p -k $keyfile2 md${no} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi -geli detach md${no} - -# Kill detached provider. -geli kill md${no} -if [ $? -eq 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi - -mdconfig -d -u $no -rm -f $keyfile1 $keyfile2 diff --git a/tools/regression/geom_eli/nokey.t b/tools/regression/geom_eli/nokey.t deleted file mode 100644 index 19ef680..0000000 --- a/tools/regression/geom_eli/nokey.t +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..8" - -geli init -B none -P md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K ${keyfile} md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi -geli attach -p md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi -geli attach -p -k ${keyfile} md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi -geli setkey -n 0 -P md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi -geli detach md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi -geli setkey -n 0 -p -P -K ${keyfile} md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi -geli setkey -n 0 -p -k ${keyfile} -P md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -mdconfig -d -u $no -rm -f $keyfile diff --git a/tools/regression/geom_eli/onetime-a.t b/tools/regression/geom_eli/onetime-a.t deleted file mode 100644 index ab19301..0000000 --- a/tools/regression/geom_eli/onetime-a.t +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 - -echo "1..1380" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done - done -done diff --git a/tools/regression/geom_eli/onetime-d.t b/tools/regression/geom_eli/onetime-d.t deleted file mode 100644 index d49cb64..0000000 --- a/tools/regression/geom_eli/onetime-d.t +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -mdconfig -a -t malloc -s $sectors -u $no || exit 1 - -echo "1..3" - -geli onetime -d md${no} -if [ -c /dev/md${no}.eli ]; then - echo "ok 1" -else - echo "not ok 1" -fi -# Be sure it doesn't detach on read. -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null -sleep 1 -if [ -c /dev/md${no}.eli ]; then - echo "ok 2" -else - echo "not ok 2" -fi -true > /dev/md${no}.eli -sleep 1 -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -mdconfig -d -u $no diff --git a/tools/regression/geom_eli/onetime.t b/tools/regression/geom_eli/onetime.t deleted file mode 100644 index 3a7d67e..0000000 --- a/tools/regression/geom_eli/onetime.t +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 - -echo "1..460" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors`b -u $no || exit 1 - - geli onetime -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - if [ ${md_rnd} != ${md_edev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done -done diff --git a/tools/regression/geom_eli/readonly.t b/tools/regression/geom_eli/readonly.t deleted file mode 100644 index 210a364..0000000 --- a/tools/regression/geom_eli/readonly.t +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..11" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -geli attach -r -p -k $keyfile md${no} -if [ $? -eq 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -sh -c "true >/dev/md${no}.eli" 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -geli kill md${no} -if [ $? -eq 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -# kill should detach provider... -if [ ! -c /dev/md{$no}.eli ]; then - echo "ok 5" -else - echo "not ok 5" -fi - -# ...but not destroy the metadata. -geli attach -r -p -k $keyfile md${no} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi - -geli setkey -n 1 -P -K /dev/null md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -geli delkey -n 0 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -geli delkey -f -n 0 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi - -geli list md${no}.eli | egrep '^Flags: .*READ-ONLY' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi - -geli detach md${no} -if [ $? -eq 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi - -mdconfig -d -u $no -rm -f $keyfile diff --git a/tools/regression/geom_eli/resize.t b/tools/regression/geom_eli/resize.t deleted file mode 100644 index 86ee364..0000000 --- a/tools/regression/geom_eli/resize.t +++ /dev/null @@ -1,150 +0,0 @@ -#! /bin/sh -# -# $FreeBSD$ - -echo 1..27 - -BLK=512 -BLKS_PER_MB=2048 - -md=$(mdconfig -s40m) || exit 1 -unit=${md#md} -i=1 - -setsize() { - partszMB=$1 unitszMB=$2 - - { - echo a: $(($partszMB * $BLKS_PER_MB)) 0 4.2BSD 1024 8192 - echo c: $(($unitszMB * $BLKS_PER_MB)) 0 unused 0 0 - } | disklabel -R $md /dev/stdin -} - -# Initialise - -kldload geom_eli >/dev/null 2>&1 - -setsize 10 40 || echo -n "not " -echo ok $i - "Sized ${md}a to 10m" -i=$((i + 1)) - -echo secret >tmp.key -geli init -Bnone -PKtmp.key ${md}a || echo -n "not " -echo ok $i - "Initialised geli on ${md}a" -i=$((i + 1)) -geli attach -pk tmp.key ${md}a || echo -n "not " -echo ok $i - "Attached ${md}a as ${md}a.eli" -i=$((i + 1)) - -newfs -U ${md}a.eli >/dev/null || echo -n "not " -echo ok $i - "Initialised the filesystem on ${md}a.eli" -i=$((i + 1)) -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) - - -# Doing a backup, resize & restore must be forced (with -f) as geli -# verifies that the provider size in the metadata matches the consumer. - -geli backup ${md}a tmp.meta || echo -n "not " -echo ok $i - "Backed up ${md}a metadata" -i=$((i + 1)) - -geli detach ${md}a.eli || echo -n "not " -echo ok $i - "Detached ${md}a.eli" -i=$((i + 1)) - -setsize 20 40 || echo -n "not " -echo ok $i - "Sized ${md}a to 20m" -i=$((i + 1)) -geli attach -pktmp.key ${md}a && echo -n "not " -echo ok $i - "Attaching ${md}a fails after resizing the consumer" -i=$((i + 1)) - -geli restore tmp.meta ${md}a && echo -n "not " -echo ok $i - "Restoring metadata on ${md}a.eli fails without -f" -i=$((i + 1)) -geli restore -f tmp.meta ${md}a || echo -n "not " -echo ok $i - "Restoring metadata on ${md}a.eli can be forced" -i=$((i + 1)) - -geli attach -pktmp.key ${md}a || echo -n "not " -echo ok $i - "Attaching ${md}a is now possible" -i=$((i + 1)) - -growfs -y ${md}a.eli >/dev/null || echo -n "not " -echo ok $i - "Extended the filesystem on ${md}a.eli" -i=$((i + 1)) - -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) - - -# Now do the resize properly - -geli detach ${md}a.eli || echo -n "not " -echo ok $i - "Detached ${md}a.eli" -i=$((i + 1)) - -setsize 30 40 || echo -n "not " -echo ok $i - "Sized ${md}a to 30m" -i=$((i + 1)) - -geli resize -s20m ${md}a || echo -n "not " -echo ok $i - "Resizing works ok" -i=$((i + 1)) -geli resize -s20m ${md}a && echo -n "not " -echo ok $i - "Resizing doesn't work a 2nd time (no old metadata)" -i=$((i + 1)) - -geli attach -pktmp.key ${md}a || echo -n "not " -echo ok $i - "Attaching ${md}a works ok" -i=$((i + 1)) - -growfs -y ${md}a.eli >/dev/null || echo -n "not " -echo ok $i - "Extended the filesystem on ${md}a.eli" -i=$((i + 1)) - -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) - -geli detach ${md}a.eli -gpart destroy -F $md >/dev/null - - -# Verify that the man page example works, changing ada0 to $md, -# 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none -# to geli init. - -gpart create -s GPT $md || echo -n "not " -echo ok $i - "Installed a GPT on ${md}" -i=$((i + 1)) -gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " -echo ok $i - "Added a 20m partition in slot 1" -i=$((i + 1)) -geli init -B none -K tmp.key -P ${md}p1 || echo -n "not " -echo ok $i - "Initialised geli on ${md}p1" -i=$((i + 1)) -gpart resize -s 30m -i 1 $md || echo -n "not " -echo ok $i - "Resized partition ${md}p1 to 30m" -i=$((i + 1)) -geli resize -s 20m ${md}p1 || echo -n "not " -echo ok $i - "Resized geli on ${md}p1 to 30m" -i=$((i + 1)) -geli attach -k tmp.key -p ${md}p1 || echo -n "not " -echo ok $i - "Attached ${md}p1.eli" -i=$((i + 1)) - -geli detach ${md}p1.eli -mdconfig -du$unit - -rm tmp.* diff --git a/tools/regression/geom_eli/setkey.t b/tools/regression/geom_eli/setkey.t deleted file mode 100644 index 611471a..0000000 --- a/tools/regression/geom_eli/setkey.t +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -no=45 -sectors=100 -rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile3=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile4=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile5=`mktemp /tmp/$base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..16" - -dd if=/dev/random of=${rnd} bs=512 count=${sectors} >/dev/null 2>&1 -hash1=`dd if=${rnd} bs=512 count=${sectors} 2>/dev/null | md5` -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile5} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile1 md${no} -geli attach -p -k $keyfile1 md${no} - -dd if=${rnd} of=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null -rm -f $rnd -hash2=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` - -# Change current key (0) for attached provider. -geli setkey -P -K $keyfile2 md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -geli detach md${no} - -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -# Attach with new key. -geli attach -p -k $keyfile2 md${no} -if [ $? -eq 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi -hash3=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` - -# Change key 1 for attached provider. -geli setkey -n 1 -P -K $keyfile3 md${no} -if [ $? -eq 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi -geli detach md${no} - -# Attach with key 1. -geli attach -p -k $keyfile3 md${no} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi -hash4=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` -geli detach md${no} - -# Change current (1) key for detached provider. -geli setkey -p -k $keyfile3 -P -K $keyfile4 md${no} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi - -# We cannot use keyfile3 anymore. -geli attach -p -k $keyfile3 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -# Attach with key 1. -geli attach -p -k $keyfile4 md${no} -if [ $? -eq 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi -hash5=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` -geli detach md${no} - -# Change key 0 for detached provider. -geli setkey -n 0 -p -k $keyfile4 -P -K $keyfile5 md${no} -if [ $? -eq 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi - -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi - -# Attach with key 0. -geli attach -p -k $keyfile5 md${no} -if [ $? -eq 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi -hash6=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` -geli detach md${no} - -if [ ${hash1} = ${hash2} ]; then - echo "ok 12" -else - echo "not ok 12" -fi -if [ ${hash1} = ${hash3} ]; then - echo "ok 13" -else - echo "not ok 13" -fi -if [ ${hash1} = ${hash4} ]; then - echo "ok 14" -else - echo "not ok 14" -fi -if [ ${hash1} = ${hash5} ]; then - echo "ok 15" -else - echo "not ok 15" -fi -if [ ${hash1} = ${hash6} ]; then - echo "ok 16" -else - echo "not ok 16" -fi - -mdconfig -d -u $no -rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 $keyfile5 diff --git a/tools/regression/geom_gate/Makefile b/tools/regression/geom_gate/Makefile deleted file mode 100644 index c5c24ad..0000000 --- a/tools/regression/geom_gate/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# -# $FreeBSD$ -# -# Regression tests for geom_gate. -# - -test: - @sh runtests.sh diff --git a/tools/regression/geom_gate/runtests.sh b/tools/regression/geom_gate/runtests.sh deleted file mode 100644 index 38089c5..0000000 --- a/tools/regression/geom_gate/runtests.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -dir=`dirname $0` - -for ts in `dirname $0`/test-*.sh; do - sh $ts -done diff --git a/tools/regression/geom_gate/test-1.sh b/tools/regression/geom_gate/test-1.sh deleted file mode 100644 index 44a4960..0000000 --- a/tools/regression/geom_gate/test-1.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" -conf=`mktemp /tmp/$base.XXXXXX` || exit 1 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` - -echo "127.0.0.1 RW $work" > $conf -ggated $conf -ggatec create -u $us 127.0.0.1 $work - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 - -if [ `cat $work | md5 -q` != $sum ]; then - echo "FAIL" -else - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo "FAIL" - else - echo "PASS" - fi -fi - -ggatec destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -pkill ggated $conf -rm -f $conf diff --git a/tools/regression/geom_gate/test-1.t b/tools/regression/geom_gate/test-1.t deleted file mode 100644 index 279e316..0000000 --- a/tools/regression/geom_gate/test-1.t +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" -conf=`mktemp /tmp/$base.XXXXXX` || exit 1 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` - -echo "127.0.0.1 RW $work" > $conf -ggated $conf -ggatec create -u $us 127.0.0.1 $work - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 - -echo '1..2' - -if [ `cat $work | md5 -q` != $sum ]; then - echo 'not ok 1 - md5 checksum' -else - echo 'ok 1 - md5 checksum' - - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' - else - echo 'ok 2 - md5 checksum' - fi -fi - -ggatec destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -pkill ggated $conf -rm -f $conf diff --git a/tools/regression/geom_gate/test-2.sh b/tools/regression/geom_gate/test-2.sh deleted file mode 100644 index 498ac45..0000000 --- a/tools/regression/geom_gate/test-2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -us=45 -work=`mktemp /tmp/$base.XXXXXX` || exit 1 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`md5 -q $src` - -ggatel create -u $us $work - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 - -if [ `md5 -q $work` != $sum ]; then - echo "FAIL" -else - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo "FAIL" - else - echo "PASS" - fi -fi - -ggatel destroy -u $us -rm -f $work $src diff --git a/tools/regression/geom_gate/test-2.t b/tools/regression/geom_gate/test-2.t deleted file mode 100644 index 2e5e254..0000000 --- a/tools/regression/geom_gate/test-2.t +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -us=45 -work=`mktemp /tmp/$base.XXXXXX` || exit 1 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`md5 -q $src` - -ggatel create -u $us $work - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 - -echo '1..2' - -if [ `md5 -q $work` != $sum ]; then - echo 'not ok 1 - md5 checksum' -else - echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' - else - echo 'ok 2 - md5 checksum' - fi -fi - -ggatel destroy -u $us -rm -f $work $src diff --git a/tools/regression/geom_gate/test-3.sh b/tools/regression/geom_gate/test-3.sh deleted file mode 100644 index ca73a5a..0000000 --- a/tools/regression/geom_gate/test-3.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` - -ggatel create -u $us $work - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 - -if [ `cat $work | md5 -q` != $sum ]; then - echo "FAIL" -else - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo "FAIL" - else - echo "PASS" - fi -fi - -ggatel destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` diff --git a/tools/regression/geom_gate/test-3.t b/tools/regression/geom_gate/test-3.t deleted file mode 100644 index ba2b3c7..0000000 --- a/tools/regression/geom_gate/test-3.t +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` - -ggatel create -u $us $work - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 - -echo '1..2' - -if [ `cat $work | md5 -q` != $sum ]; then - echo 'not ok 1 - md5 checksum' -else - echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' - else - echo 'ok 2 - md5 checksum' - fi -fi - -ggatel destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` diff --git a/tools/regression/geom_gpt/gctl.t b/tools/regression/geom_gpt/gctl.t deleted file mode 100644 index f99e6d8..0000000 --- a/tools/regression/geom_gpt/gctl.t +++ /dev/null @@ -1,207 +0,0 @@ -#!/usr/bin/env perl -w -# -# Copyright (c) 2005, 2006 Marcel Moolenaar -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ - -my $srcdir = `dirname $0`; -chomp $srcdir; - -my $cmd = "/tmp/gctl-$$"; -my $out = "$cmd.out"; -my $disk = "/tmp/disk-$$"; -my $mntpt = "/tmp/mount-$$"; - -my %steps = ( - "000" => "gctl", - "001" => "gctl verb=bogus", - "010" => "gctl verb=create", - "011" => "gctl verb=create provider=bogus", - "020" => "mdcfg create pristine", - "021" => "gctl verb=create provider=%dev% entries=-1", - "022" => "gctl verb=create provider=%dev% entries=128", - "023" => "gctl verb=create provider=%dev%", - "024" => "gctl verb=modify geom=%dev%", - "025" => "conf", - "030" => "gctl verb=add", - "031" => "gctl verb=add geom=bogus", - "032" => "gctl verb=add geom=%dev%", - "033" => "gctl verb=add geom=%dev% type=bogus", - "034" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", - "035" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", - "036" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", - "037" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", - "038" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", - "039" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", - "040" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", - "041" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", - "042" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", - "043" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", - "044" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", - "045" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", - "046" => "gctl verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", - "047" => "conf", - "050" => "gctl verb=remove geom=%dev% entry=5", - "051" => "gctl verb=remove geom=%dev% entry=2", - "052" => "gctl verb=remove geom=%dev% entry=1", - "053" => "gctl verb=remove geom=%dev% entry=1", - "054" => "conf", - "060" => "gctl verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", - "061" => "mount %dev%p1", - "062" => "gctl verb=remove geom=%dev% entry=1", - "063" => "umount %dev%p1", - "064" => "gctl verb=remove geom=%dev% entry=1", - "065" => "conf", - "100" => "mdcfg destroy", - "110" => "mdcfg create corrupted", - "111" => "gctl verb=add geom=%dev%", - "120" => "mdcfg destroy", -); - -my %result = ( - "000" => "FAIL Verb missing", - "001" => "FAIL 22 verb 'bogus'", - "010" => "FAIL 87 provider", - "011" => "FAIL 22 provider 'bogus'", - "020" => "", - "021" => "FAIL 22 entries -1", - "022" => "PASS", - "023" => "FAIL 17 geom '%dev%'", - "024" => "FAIL 87 entry", - "025" => "b1856477950e5786898c8f01361196cf", - "030" => "FAIL 87 geom", - "031" => "FAIL 22 geom 'bogus'", - "032" => "FAIL 87 type", - "033" => "FAIL 22 type 'bogus'", - "034" => "FAIL 87 start", - "035" => "FAIL 22 start 1", - "036" => "FAIL 87 end", - "037" => "FAIL 22 end 12345678", - "038" => "FAIL 22 entry 129", - "039" => "PASS entry=5", - "040" => "FAIL 17 entry 5", - "041" => "FAIL 28 start/end 34/546", - "042" => "FAIL 28 start/end 162/417", - "043" => "FAIL 28 start/end 100/300", - "044" => "FAIL 28 start/end 300/500", - "045" => "PASS entry=1", - "046" => "PASS entry=2", - "047" => "50783a39eecfc62a29db24381e12b9d8", - "050" => "PASS", - "051" => "PASS", - "052" => "PASS", - "053" => "FAIL 2 entry 1", - "054" => "b1856477950e5786898c8f01361196cf", - "060" => "PASS", - "061" => "PASS", - "062" => "FAIL 16", - "063" => "PASS", - "064" => "PASS", - "065" => "b1856477950e5786898c8f01361196cf", - "100" => "", - "110" => "", - "111" => "FAIL 6 geom '%dev%'", - "120" => "", -); - -my $verbose = ""; -if (exists $ENV{'TEST_VERBOSE'}) { - $verbose = "-v"; -} - -# Compile the driver... -my $st = system("cc -o $cmd -g $srcdir/test.c -lgeom"); -if ($st != 0) { - print "1..0 # SKIP error compiling test.c\n"; - exit 0; -} - -# Make sure we have permission to use gctl... -if (`$cmd` =~ "^FAIL Permission denied") { - print "1..0 # SKIP not enough permission\n"; - unlink $cmd; - exit 0; -} - -$count = keys (%steps); -print "1..$count\n"; - -my $nr = 1; -my $dev = "n/a"; -foreach my $key (sort keys %steps) { - my ($action, $args) = split(/ /, $steps{$key}, 2); - my $res = $result{$key}; - $args = "" if (not defined $args); - $args =~ s/%dev%/$dev/g; - $res =~ s/%dev%/$dev/g; - - if ($action =~ "^gctl") { - system("$cmd $verbose $args | tee $out 2>&1"); - $st = `tail -1 $out`; - if ($st =~ "^$res") { - print "ok $nr \# gctl($key)\n"; - } else { - print "not ok $nr \# gctl($key) - $st\n"; - } - unlink $out; - } elsif ($action =~ "^mdcfg") { - if ($args =~ "^create") { - system("dd if=/dev/zero of=$disk count=1024 2>&1"); - if ($args =~ "corrupted") { - system("gpt create -p $disk"); - } - $dev = `mdconfig -a -t vnode -f $disk`; - chomp $dev; - } elsif ($args =~ "^destroy") { - $dev =~ s/md/-u /g; - system("mdconfig -d $dev"); - unlink $disk; - $dev = "n/a"; - } - print "ok $nr \# mdcfg($key)\n"; - } elsif ($action =~ "^conf") { - system("sysctl -b kern.geom.conftxt | grep -a $dev | sed -e s:$disk:DISK:g -e s:$dev:DEV:g | sort | md5 -p | tee $out 2>&1"); - $st = `tail -1 $out`; - if ($st =~ "^$res") { - print "ok $nr \# conf($key)\n"; - } else { - print "not ok $nr \# conf($key) - $st\n"; - } - unlink $out; - } elsif ($action =~ "^mount") { - system("mkdir $mntpt-$args"); - system("newfs $args"); - system("mount -t ufs /dev/$args $mntpt-$args"); - print "ok $nr \# mount($key)\n"; - } elsif ($action =~ "^umount") { - system("umount $mntpt-$args"); - system("rmdir $mntpt-$args"); - print "ok $nr \# umount($key)\n"; - } - $nr += 1; -} - -unlink $cmd; -exit 0; diff --git a/tools/regression/geom_gpt/test.c b/tools/regression/geom_gpt/test.c deleted file mode 100644 index d750d30..0000000 --- a/tools/regression/geom_gpt/test.c +++ /dev/null @@ -1,165 +0,0 @@ -/*- - * Copyright (c) 2005, 2006 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -struct retval { - struct retval *retval; - const char *param; - char *value; -}; - -struct retval *retval; -int verbose; - -static void -usage() -{ - fprintf(stdout, "usage: %s [-v] param[:len][=value] ...\n", - getprogname()); - exit(1); -} - -static int -parse(char *arg, char **param, char **value, int *len) -{ - char *e, *colon, *equal; - - if (*arg == '\0') - return (EINVAL); - - colon = strchr(arg, ':'); - equal = strchr(arg, '='); - if (colon == NULL && equal == NULL) - return (EINVAL); - if (colon == arg || equal == arg) - return (EINVAL); - if (colon != NULL && equal != NULL && equal < colon) - return (EINVAL); - - if (colon != NULL) - *colon++ = '\0'; - if (equal != NULL) - *equal++ = '\0'; - - *param = arg; - if (colon != NULL) { - /* Length specification. This parameter is RW. */ - if (*colon == '\0') - return (EINVAL); - *len = strtol(colon, &e, 0); - if (*e != '\0') - return (EINVAL); - if (*len <= 0 || *len > PATH_MAX) - return (EINVAL); - *value = malloc(*len); - if (*value == NULL) - return (ENOMEM); - memset(*value, 0, *len); - if (equal != NULL) { - if (strlen(equal) >= PATH_MAX) - return (ENOMEM); - strcpy(*value, equal); - } - } else { - /* This parameter is RO. */ - *len = -1; - if (*equal == '\0') - return (EINVAL); - *value = equal; - } - - return (0); -} - -int main(int argc, char *argv[]) -{ - struct retval *rv; - struct gctl_req *req; - char *param, *value; - const char *s; - int c, len; - - req = gctl_get_handle(); - gctl_ro_param(req, "class", -1, "GPT"); - - while ((c = getopt(argc, argv, "v")) != -1) { - switch (c) { - case 'v': - verbose = 1; - break; - case '?': - default: - usage(); - /* NOTREACHED */ - break; - } - } - - while (optind < argc) { - if (!parse(argv[optind++], ¶m, &value, &len)) { - if (len > 0) { - rv = malloc(sizeof(struct retval)); - rv->param = param; - rv->value = value; - rv->retval = retval; - retval = rv; - gctl_rw_param(req, param, len, value); - } else - gctl_ro_param(req, param, -1, value); - } - } - - if (verbose) - gctl_dump(req, stdout); - - s = gctl_issue(req); - if (s == NULL) { - printf("PASS"); - while (retval != NULL) { - rv = retval->retval; - printf(" %s=%s", retval->param, retval->value); - free(retval->value); - free(retval); - retval = rv; - } - printf("\n"); - } else - printf("FAIL %s\n", s); - - gctl_free(req); - return (0); -} diff --git a/tools/regression/geom_mirror/conf.sh b/tools/regression/geom_mirror/conf.sh deleted file mode 100644 index 8a60a16..0000000 --- a/tools/regression/geom_mirror/conf.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="test" -class="mirror" -base=`basename $0` - -. `dirname $0`/../geom_subr.sh diff --git a/tools/regression/geom_mirror/test-1.t b/tools/regression/geom_mirror/test-1.t deleted file mode 100644 index b07a8d1..0000000 --- a/tools/regression/geom_mirror/test-1.t +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` - -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -gmirror label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -# Size of created device should be 1MB - 512b. - -size=`diskinfo /dev/mirror/${name} | awk '{print $3}'` - -if [ $size -eq 1048064 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -gmirror remove $name md${us0} -gmirror remove $name md${us1} -gmirror remove $name md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 diff --git a/tools/regression/geom_mirror/test-2.t b/tools/regression/geom_mirror/test-2.t deleted file mode 100644 index 3fb0822..0000000 --- a/tools/regression/geom_mirror/test-2.t +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..4" - -balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi -dd if=/dev/md${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi -dd if=/dev/md${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_mirror/test-3.t b/tools/regression/geom_mirror/test-3.t deleted file mode 100644 index 5bdd2ab..0000000 --- a/tools/regression/geom_mirror/test-3.t +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..5" - -balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gmirror remove $name md${us0} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name md${us1} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -gmirror remove $name md${us2} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -# mirror/${name} should be removed. -if [ -c /dev/${name} ]; then - echo "not ok 5" -else - echo "ok 5" -fi - -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_mirror/test-4.t b/tools/regression/geom_mirror/test-4.t deleted file mode 100644 index 0786bdb..0000000 --- a/tools/regression/geom_mirror/test-4.t +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..5" - -balance="load" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gmirror remove $name md${us0} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name md${us1} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -gmirror remove $name md${us2} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -# mirror/${name} should be removed. -if [ -c /dev/${name} ]; then - echo "not ok 5" -else - echo "ok 5" -fi - -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_mirror/test-5.t b/tools/regression/geom_mirror/test-5.t deleted file mode 100644 index 5b0a5ed..0000000 --- a/tools/regression/geom_mirror/test-5.t +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..5" - -balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=8192 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gmirror remove $name md${us0} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name md${us1} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -gmirror remove $name md${us2} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -# mirror/${name} should be removed. -if [ -c /dev/${name} ]; then - echo "not ok 5" -else - echo "ok 5" -fi - -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_mirror/test-6.t b/tools/regression/geom_mirror/test-6.t deleted file mode 100644 index ec86d06..0000000 --- a/tools/regression/geom_mirror/test-6.t +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..2" - -balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=8192 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -dd if=/dev/zero of=/dev/md${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -# Connect disk to the mirror. -gmirror insert ${name} md${us2} -# Wait for synchronization. -sleep 1 -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_mirror/test-7.t b/tools/regression/geom_mirror/test-7.t deleted file mode 100644 index c911c03..0000000 --- a/tools/regression/geom_mirror/test-7.t +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..5" - -balance="prefer" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gmirror remove $name md${us0} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name md${us1} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -gmirror remove $name md${us2} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -# mirror/${name} should be removed. -if [ -c /dev/${name} ]; then - echo "not ok 5" -else - echo "ok 5" -fi - -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_nop/conf.sh b/tools/regression/geom_nop/conf.sh deleted file mode 100644 index 0dc9797..0000000 --- a/tools/regression/geom_nop/conf.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -class="nop" -base=`basename $0` - -. `dirname $0`/../geom_subr.sh diff --git a/tools/regression/geom_nop/test-1.t b/tools/regression/geom_nop/test-1.t deleted file mode 100644 index f08f71d..0000000 --- a/tools/regression/geom_nop/test-1.t +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us=45 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 - -gnop create /dev/md${us} || exit 1 - -# Size of created device should be 1MB. - -size=`diskinfo /dev/md${us}.nop | awk '{print $3}'` - -if [ $size -eq 1048576 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -gnop destroy md${us}.nop -mdconfig -d -u $us diff --git a/tools/regression/geom_nop/test-2.t b/tools/regression/geom_nop/test-2.t deleted file mode 100644 index e0ddb17..0000000 --- a/tools/regression/geom_nop/test-2.t +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -us=45 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -echo "1..1" - -dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 - -gnop create /dev/md${us} || exit 1 - -dd if=${src} of=/dev/md${us}.nop bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/md${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 - -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gnop destroy md${us}.nop -mdconfig -d -u $us -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/conf.sh b/tools/regression/geom_raid3/conf.sh deleted file mode 100644 index 93e7dea..0000000 --- a/tools/regression/geom_raid3/conf.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="test" -class="raid3" -base=`basename $0` - -. `dirname $0`/../geom_subr.sh diff --git a/tools/regression/geom_raid3/test-1.t b/tools/regression/geom_raid3/test-1.t deleted file mode 100644 index 9202967..0000000 --- a/tools/regression/geom_raid3/test-1.t +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..2" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` - -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 -devwait - -# Size of created device should be 2MB - 1024B. - -mediasize=`diskinfo /dev/raid3/${name} | awk '{print $3}'` -if [ $mediasize -eq 2096128 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -sectorsize=`diskinfo /dev/raid3/${name} | awk '{print $2}'` -if [ $sectorsize -eq 1024 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 diff --git a/tools/regression/geom_raid3/test-10.t b/tools/regression/geom_raid3/test-10.t deleted file mode 100644 index 1320120..0000000 --- a/tools/regression/geom_raid3/test-10.t +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label -r $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-11.t b/tools/regression/geom_raid3/test-11.t deleted file mode 100644 index 3382214..0000000 --- a/tools/regression/geom_raid3/test-11.t +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-12.t b/tools/regression/geom_raid3/test-12.t deleted file mode 100644 index 3dec406..0000000 --- a/tools/regression/geom_raid3/test-12.t +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -nblocks1=9 -nblocks2=`expr $nblocks1 - 1` -nblocks3=`expr $nblocks2 / 2` - -mdconfig -a -t malloc -s $nblocks1 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us2 || exit 1 - -dd if=/dev/random of=/dev/md${us0} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us1} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us2} count=$nblocks1 >/dev/null 2>&1 - -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait -# Wait for synchronization. -sleep 2 -graid3 stop $name -# Break one component. -dd if=/dev/random of=/dev/md${us1} count=$nblocks2 >/dev/null 2>&1 -# Provoke retaste of the rest components. -true > /dev/md${us0} -true > /dev/md${us2} -sleep 1 - -dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 -ec=$? -if [ $ec -eq 0 ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 diff --git a/tools/regression/geom_raid3/test-2.t b/tools/regression/geom_raid3/test-2.t deleted file mode 100644 index 88daf78..0000000 --- a/tools/regression/geom_raid3/test-2.t +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-3.t b/tools/regression/geom_raid3/test-3.t deleted file mode 100644 index d2c1a5f..0000000 --- a/tools/regression/geom_raid3/test-3.t +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -# -# Reading without one DATA component (so with parity). -# -graid3 remove -n 1 $name -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-4.t b/tools/regression/geom_raid3/test-4.t deleted file mode 100644 index d437ec0..0000000 --- a/tools/regression/geom_raid3/test-4.t +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -# -# Writing without one DATA component. -# -graid3 remove -n 1 $name -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-5.t b/tools/regression/geom_raid3/test-5.t deleted file mode 100644 index ffd85f6..0000000 --- a/tools/regression/geom_raid3/test-5.t +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -# -# Writing without PARITY component. -# -graid3 remove -n 2 $name -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-6.t b/tools/regression/geom_raid3/test-6.t deleted file mode 100644 index 97b5503..0000000 --- a/tools/regression/geom_raid3/test-6.t +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -# -# Rebuild of DATA component. -# -graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 -graid3 insert -n 1 $name md${us1} -sleep 1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-7.t b/tools/regression/geom_raid3/test-7.t deleted file mode 100644 index 3d89873..0000000 --- a/tools/regression/geom_raid3/test-7.t +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -# -# Rebuild of PARITY component. -# -graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 -graid3 insert -n 2 $name md${us2} -sleep 1 -# Remove DATA component, so PARITY component can be used while reading. -graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-8.t b/tools/regression/geom_raid3/test-8.t deleted file mode 100644 index b9621f4..0000000 --- a/tools/regression/geom_raid3/test-8.t +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -# -# Writing without DATA component and rebuild of DATA component. -# -graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 insert -n 1 $name md${us1} -sleep 1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_raid3/test-9.t b/tools/regression/geom_raid3/test-9.t deleted file mode 100644 index 0695011..0000000 --- a/tools/regression/geom_raid3/test-9.t +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -# -# Writing without PARITY component and rebuild of PARITY component. -# -graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 insert -n 2 $name md${us2} -sleep 1 -# Remove DATA component, so PARITY component can be used while reading. -graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_shsec/conf.sh b/tools/regression/geom_shsec/conf.sh deleted file mode 100644 index 7648862..0000000 --- a/tools/regression/geom_shsec/conf.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="test" -class="shsec" -base=`basename $0` - -. `dirname $0`/../geom_subr.sh diff --git a/tools/regression/geom_shsec/test-1.t b/tools/regression/geom_shsec/test-1.t deleted file mode 100644 index 5cb5b4f..0000000 --- a/tools/regression/geom_shsec/test-1.t +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..2" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` - -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 -devwait - -# Size of created device should be 1MB - 512B. - -mediasize=`diskinfo /dev/shsec/${name} | awk '{print $3}'` -if [ $mediasize -eq 1048064 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -sectorsize=`diskinfo /dev/shsec/${name} | awk '{print $2}'` -if [ $sectorsize -eq 512 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -gshsec stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 diff --git a/tools/regression/geom_shsec/test-2.t b/tools/regression/geom_shsec/test-2.t deleted file mode 100644 index 19a4e0a..0000000 --- a/tools/regression/geom_shsec/test-2.t +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..4" - -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` -nblocks1=1024 -nblocks2=`expr $nblocks1 + 1` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 - -mdconfig -a -t malloc -s $nblocks2 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks2 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks2 -u $us2 || exit 1 - -gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 -devwait - -dd if=${src} of=/dev/shsec/${name} count=$nblocks1 >/dev/null 2>&1 - -dd if=/dev/shsec/${name} of=${dst} count=$nblocks1 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -dd if=/dev/md${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 -if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -dd if=/dev/md${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 -if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -dd if=/dev/md${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 -if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -gshsec stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 -rm -f ${src} ${dst} diff --git a/tools/regression/geom_stripe/conf.sh b/tools/regression/geom_stripe/conf.sh deleted file mode 100644 index 22e5864..0000000 --- a/tools/regression/geom_stripe/conf.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="test" -class="stripe" -base=`basename $0` - -. `dirname $0`/../geom_subr.sh diff --git a/tools/regression/geom_stripe/test-1.t b/tools/regression/geom_stripe/test-1.t deleted file mode 100644 index 9b398f0..0000000 --- a/tools/regression/geom_stripe/test-1.t +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us=45 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gstripe create -s 16384 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 -devwait - -# Size of created device should be 1MB * 3. - -size=`diskinfo /dev/stripe/${name} | awk '{print $3}'` - -if [ $size -eq 3145728 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` diff --git a/tools/regression/geom_stripe/test-2.t b/tools/regression/geom_stripe/test-2.t deleted file mode 100644 index 73937f4..0000000 --- a/tools/regression/geom_stripe/test-2.t +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us=45 -tsize=3 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gstripe create -s 8192 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 -devwait - -dd if=${src} of=/dev/stripe/${name} bs=1m count=$tsize >/dev/null 2>&1 -dd if=/dev/stripe/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 - -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` -rm -f ${src} ${dst} diff --git a/tools/regression/geom_subr.sh b/tools/regression/geom_subr.sh deleted file mode 100644 index 6047829..0000000 --- a/tools/regression/geom_subr.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -kldstat -q -m g_${class} || g${class} load || exit 1 - -devwait() -{ - while :; do - if [ -c /dev/${class}/${name} ]; then - return - fi - sleep 0.2 - done -} diff --git a/tools/regression/geom_uzip/Makefile b/tools/regression/geom_uzip/Makefile deleted file mode 100644 index 6927ff1..0000000 --- a/tools/regression/geom_uzip/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# -# $FreeBSD$ -# -# Regression test for geom_ugz. -# - -IMAGE= test-1.img -ZIMAGE= ${IMAGE}.uzip -UZIMAGE= ${ZIMAGE}.uue - -test: - @sh runtests.sh - -image: - makefs -s 1048576 ${IMAGE} etalon - printf "#\n# $$" >${UZIMAGE} - printf "FreeBSD$$\n#\n\n" >> ${UZIMAGE} - mkuzip -o ${ZIMAGE} ${IMAGE} - uuencode ${ZIMAGE} ${ZIMAGE} >>${UZIMAGE} - rm ${ZIMAGE} - -clean: - rm -f ${IMAGE} ${ZIMAGE} diff --git a/tools/regression/geom_uzip/etalon/etalon.txt b/tools/regression/geom_uzip/etalon/etalon.txt deleted file mode 100644 index cb8acf3..0000000 --- a/tools/regression/geom_uzip/etalon/etalon.txt +++ /dev/null @@ -1,43 +0,0 @@ -# -# $FreeBSD$ -# - -JABBERWOCKY - -Lewis Carroll -(from Through the Looking-Glass and What Alice Found There, 1872) - -`Twas brillig, and the slithy toves -Did gyre and gimble in the wabe: -All mimsy were the borogoves, -And the mome raths outgrabe. - -"Beware the Jabberwock, my son! -The jaws that bite, the claws that catch! -Beware the Jubjub bird, and shun -The frumious Bandersnatch!" - -He took his vorpal sword in hand: -Long time the manxome foe he sought -- -So rested he by the Tumtum tree, -And stood awhile in thought. - -And, as in uffish thought he stood, -The Jabberwock, with eyes of flame, -Came whiffling through the tulgey wood, -And burbled as it came! - -One, two! One, two! And through and through -The vorpal blade went snicker-snack! -He left it dead, and with its head -He went galumphing back. - -"And, has thou slain the Jabberwock? -Come to my arms, my beamish boy! -O frabjous day! Callooh! Callay!' -He chortled in his joy. - -`Twas brillig, and the slithy toves -Did gyre and gimble in the wabe; -All mimsy were the borogoves, -And the mome raths outgrabe. diff --git a/tools/regression/geom_uzip/runtests.sh b/tools/regression/geom_uzip/runtests.sh deleted file mode 100644 index 60e78b5..0000000 --- a/tools/regression/geom_uzip/runtests.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -dir=`dirname $0` - -for ts in `dirname $0`/test-*.sh; do - sh $ts -done diff --git a/tools/regression/geom_uzip/test-1.img.uzip.uue b/tools/regression/geom_uzip/test-1.img.uzip.uue deleted file mode 100644 index ca16f47..0000000 --- a/tools/regression/geom_uzip/test-1.img.uzip.uue +++ /dev/null @@ -1,110 +0,0 @@ -# -# $FreeBSD$ -# - -begin 755 test-1.img.uzip -M(R$O8FEN+W-H"B-6,BXP($9O&ET("0_"@```````$`````` -M0`````````*0`````````W<````````$F@````````AQ````````")@````` -M```(OP````````CF````````"0T````````)-`````````E;````````"8(` -M```````)J0````````G0````````"?<````````*'@````````I%```````` -M"FP````````*DP````````JZ````````"N$````````+"`````````LO```` -M````"U8````````+?0````````ND````````"\L````````+\@````````P9 -M````````#$`````````,9P````````R.````````#+4````````,W``````` -M``T#````````#2H````````-40````````UX````````#9\````````-Q@`` -M``````WM````````#A0````````..P````````YB````````#HD````````. -ML`````````[7````````#OX````````/)0````````],````````#W,````` -M```/F@````````_!````````#^@````````0#P```````!`V````````$%T` -M```````0A````````!"K````````$-(````````0^0```````!$@```````` -M$4<````````1;@```````!&5````````$<%XVNW4/0K",!3`\1>M$`3!42<[ -M>@1!AX)X`^_@X`VZZ.[%''1V]0+>0(@O[0OMZF`5^?_@-6GS2=L\$0`````` -M````````\"_&&A.-7&-NSX)Z7)=KR41N?1$GUD'OO18#Z[>*EWL(\@QAI-6A -MU.WQHL/J<;ZUF-8++7JM>V?5N-YN<]I7>\@LTGCK%Z.P]CA'J;%(*;/SW_H;W97M*9*ZU>^8]YR7'QWX>"< -MUTV$F>7(?M,OY:9D.W6<"0```````````'3J!63?'NAXVNW9,4I#01#&\6^3 -M"*L@6&IE2@]@$=#B@7@#!6^@X`W2F-Z+6(BEM:6%UK9>P!L(ZTS>K"^"B"&8 -M6/Q_,&]W\W8W0\A.LU)KRV+;8FBQ%Y\5\_9\<*2!]-*7DF*"C;,U:S'OT!^O -MI>B]E$WK;JA][P];UJ[+ZEB_L:8W,T[1]>\[/[Z^G.8PB*CK8YY'$^]]C['% -MJ.Z5-!&P"H\YZREW__3A/\HM_FU=I4G>PDS@0```````````"6[K2W_GFOE_R&[;M[ -M=?W^CN_&XM;BSN+>XB))^Q9G%I.%,BU?1ROS0?MFN%A8EF:;+BI(]H"1M04NE -M2FW%BA-X,IX9MYYQ9'LZS=[V`1`OP0-PV$=`W+ARX@&X\`A(_.Q)2:A8@50J -M0??WD:9V//[Y:W]_GLETVE;KU>:WX5I366V*7W]\//;E#]^\/5PN'UQ39SY\ -MZY>UYECHK_ZE_HNY[F79N2'];Y^OA+)<;S[_--?_[HK^^]?47W^)_HNY_CNM -M/^L??MWH7I;=&UK_I?[]O]'OW;!^]XK^U?Q'-Z1/$`1!$`1!$`1!$`1!$`1! -M$`1!$,3MP?]=\!D>.V0%0;R2U_\;K?65WJ*^VL,/:TU];?SY/1P\&@;TE,M8.]B"O?8)F-/AJ/1 -MWM'3P_%G7S!V(&II8@.&\['+'0AP'"7 -M6]"5RPR&]AB[.Q(UGP<]X7$L3*TG9QTH9F!UV68X73CEM<4.N)!8.IR[[SM1 -M?S1.N)OD;;8\4!6?5C'V-DFS)IM791@J-54A=65AA,W"V#+$WF7L4XQ$\R!' -M?\^UF7(%MM8F\2O-L>^`'>@R`R>+1J+@Y85?4(JY\H;Y%#CH=MFQ!DR_$XEO -MCF>A\TE5N*H`AYNE\<.B5@*\SN6EER$>_<"S.&7K&ZLTE3:_/!=4?%@G+&39 -MJQJ3!6(FT-@44L4+5!GC3\#QTU1)/^^E3>(JE0G,51C+SR:N#.8T";+>SD*T -M&3LLO=.U;L.BUJ2R&8DOZF%"<]-BQ1,4%J4#6\K)F3!=-'ERUO8.*Y$Z+Y$( -M/D],F+IT%E?'$]\E1&9<5<4T]Q./,=9OD^!+SFVP`_]?N5`>7^="H?LM0?R76'O)\_]K6'^SM;%^I'5XVG\=C[=:&^Q(3+65 -M3IM9JW4'V[Y?V;BS5SHCA24S">)_QD!_\=.-@"!N)4LO\Z)^KQ_M&PG#*H/E5WGA]5[$=NDV0!"WB]\!34_J -M#GC:[<$Q`0```,*@]4]M#!^@````````````````````@+%$%=P/6@`"! -M```````````````````````````````````````````````````````````` -2```````````````````````` -` -end diff --git a/tools/regression/geom_uzip/test-1.sh b/tools/regression/geom_uzip/test-1.sh deleted file mode 100644 index 7e8f168..0000000 --- a/tools/regression/geom_uzip/test-1.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -mntpoint="/mnt/test-1" - -# -# prepare -kldload geom_uzip -uudecode test-1.img.uzip.uue -num=`mdconfig -an -f test-1.img.uzip` || exit 1 -sleep 1 - -# -# mount -mkdir -p "${mntpoint}" -mount -o ro /dev/md${num}.uzip "${mntpoint}" || exit 1 - -# -# compare -#cat "${mntpoint}/etalon.txt" -diff -u etalon/etalon.txt "${mntpoint}/etalon.txt" -if [ $? -eq 0 ]; then - echo "PASS" -else - echo "FAIL" -fi - -# -# cleanup -umount "${mntpoint}" -rmdir "${mntpoint}" -mdconfig -d -u ${num} -sleep 1 -kldunload geom_uzip diff --git a/tools/regression/geom_uzip/test-2.sh b/tools/regression/geom_uzip/test-2.sh deleted file mode 100644 index 8662827..0000000 --- a/tools/regression/geom_uzip/test-2.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# -# prepare -kldload geom_uzip -uudecode test-1.img.uzip.uue -num=`mdconfig -an -f test-1.img.uzip` || exit 1 -sleep 1 - -# -# destroy -kldunload geom_uzip -- cgit v1.1 From 1e12304e1cee1b713495ea0b7a8222874984d7f8 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 21:50:02 +0000 Subject: - Check for root; all of these tests will fail if not root - Add attach_md/geom_test_cleanup functions to deal with the fact that many of the tests caused issues if one of the preceding tests failed (sometimes due to a test time out), which would cause a cascade of other erroneous failures due to hardcoded md(4) device names. --- sbin/geom/class/tests/geom_subr.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sbin/geom/class/tests/geom_subr.sh b/sbin/geom/class/tests/geom_subr.sh index 6047829..ad0b339 100644 --- a/sbin/geom/class/tests/geom_subr.sh +++ b/sbin/geom/class/tests/geom_subr.sh @@ -1,6 +1,11 @@ #!/bin/sh # $FreeBSD$ +if [ $(id -u) -ne 0 ]; then + echo 'Tests must be run as root' + echo 'Bail out!' + exit 1 +fi kldstat -q -m g_${class} || g${class} load || exit 1 devwait() @@ -12,3 +17,29 @@ devwait() sleep 0.2 done } + +# Need to keep track of the test md devices to avoid the scenario where a test +# failing will cause the other tests to bomb out, or a test failing will leave +# a large number of md(4) devices lingering around +: ${TMPDIR=/tmp} +TEST_MDS_FILE=${TMPDIR}/test_mds + +attach_md() +{ + local test_md + + test_md=$(mdconfig -a "$@") || exit + echo $test_md >> $TEST_MDS_FILE || exit + echo $test_md +} + +geom_test_cleanup() +{ + local test_md + + while read test_md; do + # The "#" tells the TAP parser this is a comment + echo "# Removing test memory disk: $test_md" + mdconfig -d -u $test_md + done < $TEST_MDS_FILE +} -- cgit v1.1 From 262ed9bb264feea7c7077bc94627f9a305ab0bbc Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 22:21:10 +0000 Subject: Sort imports --- sbin/ggate/ggated/ggated.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sbin/ggate/ggated/ggated.c b/sbin/ggate/ggated/ggated.c index a340f01..4e3fd45 100644 --- a/sbin/ggate/ggated/ggated.c +++ b/sbin/ggate/ggated/ggated.c @@ -26,32 +26,32 @@ * $FreeBSD$ */ -#include -#include -#include -#include -#include -#include #include -#include +#include +#include #include -#include #include +#include +#include #include #include -#include -#include +#include #include #include -#include -#include #include #include #include -#include +#include #include -#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include "ggate.h" -- cgit v1.1 From dd72c459e65f20a78ec016584b4edeb377605400 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 22:22:17 +0000 Subject: Use a more common pattern for parsing with getopt(3) --- sbin/ggate/ggated/ggated.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sbin/ggate/ggated/ggated.c b/sbin/ggate/ggated/ggated.c index 4e3fd45..262550e 100644 --- a/sbin/ggate/ggated/ggated.c +++ b/sbin/ggate/ggated/ggated.c @@ -949,17 +949,12 @@ main(int argc, char *argv[]) struct sockaddr_in serv; struct sockaddr from; socklen_t fromlen; - int sfd, tmpsfd; + int ch, sfd, tmpsfd; unsigned port; bindaddr = htonl(INADDR_ANY); port = G_GATE_PORT; - for (;;) { - int ch; - - ch = getopt(argc, argv, "a:hnp:R:S:v"); - if (ch == -1) - break; + while ((ch = getopt(argc, argv, "a:hnp:R:S:v")) != -1) { switch (ch) { case 'a': bindaddr = g_gate_str2ip(optarg); -- cgit v1.1 From ad0809c84efc791210c2c6fbb85d484050be231b Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 22:40:49 +0000 Subject: Add pidfile support to ggated --- sbin/ggate/ggated/Makefile | 2 +- sbin/ggate/ggated/ggated.8 | 13 +++++++++++++ sbin/ggate/ggated/ggated.c | 22 +++++++++++++++++++++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/sbin/ggate/ggated/Makefile b/sbin/ggate/ggated/Makefile index af5c9bd..83516c6 100644 --- a/sbin/ggate/ggated/Makefile +++ b/sbin/ggate/ggated/Makefile @@ -6,7 +6,7 @@ PROG= ggated MAN= ggated.8 SRCS= ggated.c ggate.c -LIBADD= pthread +LIBADD= pthread util CFLAGS+= -I${.CURDIR}/../shared diff --git a/sbin/ggate/ggated/ggated.8 b/sbin/ggate/ggated/ggated.8 index dd6109a..15b1792 100644 --- a/sbin/ggate/ggated/ggated.8 +++ b/sbin/ggate/ggated/ggated.8 @@ -37,6 +37,7 @@ .Op Fl v .Op Fl a Ar address .Op Fl p Ar port +.Op Fl F Ar pidfile .Op Fl R Ar rcvbuf .Op Fl S Ar sndbuf .Op Ar "exports file" @@ -67,6 +68,10 @@ Port on which .Nm listens for connections. Default is 3080. +.It Fl F Ar pidfile +PID file that +.Nm +uses. .It Fl R Ar rcvbuf Size of receive buffer to use. Default is 131072 (128kB). @@ -86,6 +91,14 @@ The format of an exports file is as follows: 1.2.3.0/24 RW /tmp/test.img hostname WO /tmp/image .Ed +.El +.Sh FILES +.Bl -tag -width ".Pa /var/run/ggated.pid" -compact +.It Pa /var/run/ggated.pid +The default location of the +.Nm +PID file. +.El .Sh EXIT STATUS Exit status is 0 on success, or 1 if the command fails. To get details about the failure, diff --git a/sbin/ggate/ggated/ggated.c b/sbin/ggate/ggated/ggated.c index 262550e..d6a2e47 100644 --- a/sbin/ggate/ggated/ggated.c +++ b/sbin/ggate/ggated/ggated.c @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include #include #include @@ -946,15 +948,18 @@ huphandler(int sig __unused) int main(int argc, char *argv[]) { + const char *ggated_pidfile = _PATH_VARRUN "/ggated.pid"; + struct pidfh *pfh; struct sockaddr_in serv; struct sockaddr from; socklen_t fromlen; + pid_t otherpid; int ch, sfd, tmpsfd; unsigned port; bindaddr = htonl(INADDR_ANY); port = G_GATE_PORT; - while ((ch = getopt(argc, argv, "a:hnp:R:S:v")) != -1) { + while ((ch = getopt(argc, argv, "a:hnp:F:R:S:v")) != -1) { switch (ch) { case 'a': bindaddr = g_gate_str2ip(optarg); @@ -963,6 +968,9 @@ main(int argc, char *argv[]) "Invalid IP/host name to bind to."); } break; + case 'F': + ggated_pidfile = optarg; + break; case 'n': nagle = 0; break; @@ -999,12 +1007,23 @@ main(int argc, char *argv[]) exports_file = argv[0]; exports_get(); + pfh = pidfile_open(ggated_pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(EXIT_FAILURE, "Daemon already running, pid: %jd.", + (intmax_t)otherpid); + } + err(EXIT_FAILURE, "Cannot open/create pidfile"); + } + if (!g_gate_verbose) { /* Run in daemon mode. */ if (daemon(0, 0) == -1) g_gate_xlog("Cannot daemonize: %s", strerror(errno)); } + pidfile_write(pfh); + signal(SIGCHLD, SIG_IGN); sfd = socket(AF_INET, SOCK_STREAM, 0); @@ -1041,5 +1060,6 @@ main(int argc, char *argv[]) close(tmpsfd); } close(sfd); + pidfile_remove(pfh); exit(EXIT_SUCCESS); } -- cgit v1.1 From 985da82d584cba87fc8be29ba7fcdfabd5c7aac0 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 23:11:01 +0000 Subject: Mute noise if no md(4) devices were attached --- sbin/geom/class/tests/geom_subr.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sbin/geom/class/tests/geom_subr.sh b/sbin/geom/class/tests/geom_subr.sh index ad0b339..a26dd15 100644 --- a/sbin/geom/class/tests/geom_subr.sh +++ b/sbin/geom/class/tests/geom_subr.sh @@ -37,9 +37,11 @@ geom_test_cleanup() { local test_md - while read test_md; do - # The "#" tells the TAP parser this is a comment - echo "# Removing test memory disk: $test_md" - mdconfig -d -u $test_md - done < $TEST_MDS_FILE + if [ -f $TEST_MDS_FILE ]; then + while read test_md; do + # The "#" tells the TAP parser this is a comment + echo "# Removing test memory disk: $test_md" + mdconfig -d -u $test_md + done < $TEST_MDS_FILE + fi } -- cgit v1.1 From 4cfe4d872e34010d4b4eef592e86542a71bc4865 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 16 Nov 2015 23:41:19 +0000 Subject: Install a conf.sh similar to ../mirror/conf.sh --- sbin/geom/class/tests/gate/Makefile | 4 ++++ sbin/geom/class/tests/gate/conf.sh | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100755 sbin/geom/class/tests/gate/conf.sh diff --git a/sbin/geom/class/tests/gate/Makefile b/sbin/geom/class/tests/gate/Makefile index 45249a1..985d98f 100644 --- a/sbin/geom/class/tests/gate/Makefile +++ b/sbin/geom/class/tests/gate/Makefile @@ -4,4 +4,8 @@ TAP_TESTS_SH+= 1_test TAP_TESTS_SH+= 2_test TAP_TESTS_SH+= 3_test +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + .include diff --git a/sbin/geom/class/tests/gate/conf.sh b/sbin/geom/class/tests/gate/conf.sh new file mode 100755 index 0000000..7e22ce4 --- /dev/null +++ b/sbin/geom/class/tests/gate/conf.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# $FreeBSD$ + +name="$(mktemp -u gate.XXXXXX)" +class="gate" +base=`basename $0` + +. `dirname $0`/../geom_subr.sh -- cgit v1.1 From 2c93802f30d38c71363ac19d86f2335bd6423ffb Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 17 Nov 2015 00:27:45 +0000 Subject: - Don't hardcode the test unit as `45`; use 47 instead - Use conf.sh - Consolidate the cleanup steps and always execute on exit - Use attach_md to track md(4) devices - Be more verbose on md5 failure - Use better variable names --- sbin/geom/class/tests/gate/3_test.sh | 50 +++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/sbin/geom/class/tests/gate/3_test.sh b/sbin/geom/class/tests/gate/3_test.sh index ba2b3c7..90a93e0 100755 --- a/sbin/geom/class/tests/gate/3_test.sh +++ b/sbin/geom/class/tests/gate/3_test.sh @@ -1,34 +1,48 @@ #!/bin/sh # $FreeBSD$ +. `dirname $0`/conf.sh + base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" +us=47 + +test_cleanup() +{ + ggatel destroy -f -u $us -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM -ggatel create -u $us $work +work=$(attach_md -t malloc -s 1M) +src=$(attach_md -t malloc -s 1M) -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/$work bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/$src bs=1m count=1 >/dev/null 2>&1 +src_checksum=$(md5 -q /dev/$src) + +if ! ggatel create -u $us /dev/$work; then + echo 'ggatel create failed' + echo 'Bail out!' + exit 1 +fi + +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +sleep 1 echo '1..2' -if [ `cat $work | md5 -q` != $sum ]; then - echo 'not ok 1 - md5 checksum' +work_checksum=$(md5 -q /dev/$work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" + echo 'not ok 2 # SKIP' else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatel destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -- cgit v1.1 From 454bf7ea1137f3d963350fcc3e4711c074aef80c Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 17 Nov 2015 00:32:39 +0000 Subject: - Use conf.sh - Consolidate the cleanup steps and always execute on exit - Use attach_md to track md(4) devices - Be more verbose on md5 failure - Use better variable names - Specify a non-standard pidfile path and port number to avoid collisions with other instances of ggated on the test host --- sbin/geom/class/tests/gate/1_test.sh | 66 +++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/sbin/geom/class/tests/gate/1_test.sh b/sbin/geom/class/tests/gate/1_test.sh index 279e316..58a05da 100755 --- a/sbin/geom/class/tests/gate/1_test.sh +++ b/sbin/geom/class/tests/gate/1_test.sh @@ -1,40 +1,58 @@ #!/bin/sh # $FreeBSD$ +. `dirname $0`/conf.sh + base=`basename $0` us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" -conf=`mktemp /tmp/$base.XXXXXX` || exit 1 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` - -echo "127.0.0.1 RW $work" > $conf -ggated $conf -ggatec create -u $us 127.0.0.1 $work +conf=`mktemp $base.XXXXXX` || exit 1 +pidfile=ggated.pid +port=33080 + +work=$(attach_md -t malloc -s 1M) +src=$(attach_md -t malloc -s 1M) + +test_cleanup() +{ + ggatec destroy -f -u $us + pkill -F $pidfile + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +dd if=/dev/random of=/dev/$work bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/$src bs=1m count=1 >/dev/null 2>&1 +src_checksum=$(md5 -q /dev/$src) + +echo "127.0.0.1 RW /dev/$work" > $conf + +if ! ggated -F $pidfile -p $port $conf; then + echo 'ggated failed to start' + echo 'Bail out!' + exit 1 +fi +if ! ggatec create -p $port -u $us 127.0.0.1 /dev/$work; then + echo 'ggatec create failed' + echo 'Bail out!' + exit 1 +fi -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +sleep 1 echo '1..2' -if [ `cat $work | md5 -q` != $sum ]; then - echo 'not ok 1 - md5 checksum' +work_checksum=$(md5 -q /dev/$work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" + echo "not ok 2 # SKIP" else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatec destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -pkill ggated $conf -rm -f $conf -- cgit v1.1 From b8f4fbac03cff46947137db648a8155a0a903b3a Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 17 Nov 2015 00:40:25 +0000 Subject: - Don't mute dd output - Use conv=sync with all non-ggate dd calls --- sbin/geom/class/tests/gate/1_test.sh | 6 +++--- sbin/geom/class/tests/gate/3_test.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/geom/class/tests/gate/1_test.sh b/sbin/geom/class/tests/gate/1_test.sh index 58a05da..5689044 100755 --- a/sbin/geom/class/tests/gate/1_test.sh +++ b/sbin/geom/class/tests/gate/1_test.sh @@ -20,8 +20,8 @@ test_cleanup() } trap test_cleanup ABRT EXIT INT TERM -dd if=/dev/random of=/dev/$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/$src bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync +dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync src_checksum=$(md5 -q /dev/$src) echo "127.0.0.1 RW /dev/$work" > $conf @@ -37,7 +37,7 @@ if ! ggatec create -p $port -u $us 127.0.0.1 /dev/$work; then exit 1 fi -dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 sleep 1 echo '1..2' diff --git a/sbin/geom/class/tests/gate/3_test.sh b/sbin/geom/class/tests/gate/3_test.sh index 90a93e0..8901aca 100755 --- a/sbin/geom/class/tests/gate/3_test.sh +++ b/sbin/geom/class/tests/gate/3_test.sh @@ -17,8 +17,8 @@ trap test_cleanup ABRT EXIT INT TERM work=$(attach_md -t malloc -s 1M) src=$(attach_md -t malloc -s 1M) -dd if=/dev/random of=/dev/$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/$src bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync +dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync src_checksum=$(md5 -q /dev/$src) if ! ggatel create -u $us /dev/$work; then @@ -27,7 +27,7 @@ if ! ggatel create -u $us /dev/$work; then exit 1 fi -dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=sync sleep 1 echo '1..2' -- cgit v1.1 From cef7e7c4ca350475c03c02e2337cf34608f34e74 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 17 Nov 2015 01:01:02 +0000 Subject: - Use conf.sh - Consolidate the cleanup steps and always execute on exit - Be more verbose on md5 failure - Use better variable names - Expect the testcase to fail, as noted in bug 204616 PR: 204616 --- sbin/geom/class/tests/gate/2_test.sh | 47 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/sbin/geom/class/tests/gate/2_test.sh b/sbin/geom/class/tests/gate/2_test.sh index 2e5e254..be89acc 100755 --- a/sbin/geom/class/tests/gate/2_test.sh +++ b/sbin/geom/class/tests/gate/2_test.sh @@ -1,31 +1,48 @@ #!/bin/sh # $FreeBSD$ +. `dirname $0`/conf.sh + base=`basename $0` -us=45 -work=`mktemp /tmp/$base.XXXXXX` || exit 1 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 +us=46 +work=`mktemp -u $base.XXXXXX` || exit 1 +src=`mktemp -u $base.XXXXXX` || exit 1 + +test_cleanup() +{ + ggatel destroy -f -u $us + rm -f $work $src + + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`md5 -q $src` +dd if=/dev/random of=$work bs=1m count=1 conv=sync +dd if=/dev/random of=$src bs=1m count=1 conv=sync -ggatel create -u $us $work +if ! ggatel create -u $us $work; then + echo 'ggatel create failed' + echo 'Bail out!' + exit 1 +fi -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=${src} of=/dev/ggate${us} bs=1m count=1 +sleep 1 echo '1..2' -if [ `md5 -q $work` != $sum ]; then - echo 'not ok 1 - md5 checksum' +src_checksum=$(md5 -q $src) +work_checksum=$(md5 -q $work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum) # TODO: bug 204616" + echo 'not ok 2 # SKIP' else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatel destroy -u $us -rm -f $work $src -- cgit v1.1 From 21f7813b188a84831d19f64a9281fe81b9b17279 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 17 Nov 2015 01:02:44 +0000 Subject: - Use unique gmirror names - Use attach_md for tracking md(4) devices - Tear down the mirror in a consolidated cleanup routine --- sbin/geom/class/tests/mirror/1_test.sh | 19 ++++--------------- sbin/geom/class/tests/mirror/2_test.sh | 25 +++++++++---------------- sbin/geom/class/tests/mirror/3_test.sh | 24 +++++++++--------------- sbin/geom/class/tests/mirror/4_test.sh | 26 +++++++++++--------------- sbin/geom/class/tests/mirror/5_test.sh | 24 +++++++++--------------- sbin/geom/class/tests/mirror/6_test.sh | 25 +++++++++---------------- sbin/geom/class/tests/mirror/7_test.sh | 24 +++++++++--------------- sbin/geom/class/tests/mirror/conf.sh | 9 ++++++++- 8 files changed, 68 insertions(+), 108 deletions(-) diff --git a/sbin/geom/class/tests/mirror/1_test.sh b/sbin/geom/class/tests/mirror/1_test.sh index b07a8d1..e115b29 100755 --- a/sbin/geom/class/tests/mirror/1_test.sh +++ b/sbin/geom/class/tests/mirror/1_test.sh @@ -5,15 +5,11 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -gmirror label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # Size of created device should be 1MB - 512b. @@ -25,10 +21,3 @@ if [ $size -eq 1048064 ]; then else echo "not ok 1" fi - -gmirror remove $name md${us0} -gmirror remove $name md${us1} -gmirror remove $name md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 diff --git a/sbin/geom/class/tests/mirror/2_test.sh b/sbin/geom/class/tests/mirror/2_test.sh index 3fb0822..5605c44 100755 --- a/sbin/geom/class/tests/mirror/2_test.sh +++ b/sbin/geom/class/tests/mirror/2_test.sh @@ -6,22 +6,19 @@ echo "1..4" balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,28 +29,24 @@ if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then else echo "ok 1" fi -dd if=/dev/md${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -dd if=/dev/md${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" else echo "ok 3" fi -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" else echo "ok 4" fi -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/3_test.sh b/sbin/geom/class/tests/mirror/3_test.sh index 5bdd2ab..b7f8525 100755 --- a/sbin/geom/class/tests/mirror/3_test.sh +++ b/sbin/geom/class/tests/mirror/3_test.sh @@ -6,22 +6,19 @@ echo "1..5" balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/4_test.sh b/sbin/geom/class/tests/mirror/4_test.sh index 0786bdb..6efcc02 100755 --- a/sbin/geom/class/tests/mirror/4_test.sh +++ b/sbin/geom/class/tests/mirror/4_test.sh @@ -6,22 +6,19 @@ echo "1..5" balance="load" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -57,6 +54,8 @@ else echo "ok 4" fi +gmirror destroy $name + # mirror/${name} should be removed. if [ -c /dev/${name} ]; then echo "not ok 5" @@ -64,7 +63,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/5_test.sh b/sbin/geom/class/tests/mirror/5_test.sh index 5b0a5ed..3a176b5 100755 --- a/sbin/geom/class/tests/mirror/5_test.sh +++ b/sbin/geom/class/tests/mirror/5_test.sh @@ -6,22 +6,19 @@ echo "1..5" balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=8192 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/6_test.sh b/sbin/geom/class/tests/mirror/6_test.sh index ec86d06..68036e9 100755 --- a/sbin/geom/class/tests/mirror/6_test.sh +++ b/sbin/geom/class/tests/mirror/6_test.sh @@ -6,26 +6,23 @@ echo "1..2" balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=8192 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} || exit 1 +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -dd if=/dev/zero of=/dev/md${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -35,18 +32,14 @@ else fi # Connect disk to the mirror. -gmirror insert ${name} md${us2} +gmirror insert ${name} ${us2} # Wait for synchronization. sleep 1 -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/7_test.sh b/sbin/geom/class/tests/mirror/7_test.sh index c911c03..f5bf71a 100755 --- a/sbin/geom/class/tests/mirror/7_test.sh +++ b/sbin/geom/class/tests/mirror/7_test.sh @@ -6,22 +6,19 @@ echo "1..5" balance="prefer" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/conf.sh b/sbin/geom/class/tests/mirror/conf.sh index 8a60a16..d8595f1 100755 --- a/sbin/geom/class/tests/mirror/conf.sh +++ b/sbin/geom/class/tests/mirror/conf.sh @@ -1,8 +1,15 @@ #!/bin/sh # $FreeBSD$ -name="test" +name="$(mktemp -u mirror.XXXXXX)" class="mirror" base=`basename $0` +gmirror_test_cleanup() +{ + [ -c /dev/$class/$name ] && gmirror destroy $name + geom_test_cleanup +} +trap gmirror_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh -- cgit v1.1 From 57ab71aae63410244a12255a168d306a69dcc6ad Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 17 Nov 2015 01:05:00 +0000 Subject: Add Makefiles for integrating the geom testcases into the FreeBSD test suite Increase the default timeouts for some of the geom_eli testcases, otherwise they will time out due to their length and cause a deterministic cascade of failures with the tests This is still a WIP --- sbin/geom/class/tests/Makefile | 2 +- sbin/geom/class/tests/Makefile.inc | 3 +++ sbin/geom/class/tests/concat/Makefile | 10 ++++++++++ sbin/geom/class/tests/eli/Makefile | 32 ++++++++++++++++++++++++++++++++ sbin/geom/class/tests/gpt/Makefile | 13 +++++++++++++ sbin/geom/class/tests/mirror/Makefile | 15 +++++++++++++++ sbin/geom/class/tests/nop/Makefile | 10 ++++++++++ sbin/geom/class/tests/raid3/Makefile | 20 ++++++++++++++++++++ sbin/geom/class/tests/shsec/Makefile | 10 ++++++++++ sbin/geom/class/tests/stripe/Makefile | 10 ++++++++++ sbin/geom/core/tests/Data/Makefile | 21 +++++++++++++++++++++ sbin/geom/core/tests/Makefile | 12 ++++++++++++ sbin/geom/core/tests/Ref/Makefile | 21 +++++++++++++++++++++ 13 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 sbin/geom/class/tests/Makefile.inc create mode 100644 sbin/geom/class/tests/concat/Makefile create mode 100644 sbin/geom/class/tests/eli/Makefile create mode 100644 sbin/geom/class/tests/gpt/Makefile create mode 100644 sbin/geom/class/tests/mirror/Makefile create mode 100644 sbin/geom/class/tests/nop/Makefile create mode 100644 sbin/geom/class/tests/raid3/Makefile create mode 100644 sbin/geom/class/tests/shsec/Makefile create mode 100644 sbin/geom/class/tests/stripe/Makefile create mode 100644 sbin/geom/core/tests/Data/Makefile create mode 100644 sbin/geom/core/tests/Makefile create mode 100644 sbin/geom/core/tests/Ref/Makefile diff --git a/sbin/geom/class/tests/Makefile b/sbin/geom/class/tests/Makefile index 0be484c..8b62d2c 100644 --- a/sbin/geom/class/tests/Makefile +++ b/sbin/geom/class/tests/Makefile @@ -3,7 +3,7 @@ TESTS_SUBDIRS+= concat TESTS_SUBDIRS+= eli TESTS_SUBDIRS+= gate -TESTS_SUBDIRS+= gpt +#TESTS_SUBDIRS+= gpt TESTS_SUBDIRS+= mirror TESTS_SUBDIRS+= nop TESTS_SUBDIRS+= raid3 diff --git a/sbin/geom/class/tests/Makefile.inc b/sbin/geom/class/tests/Makefile.inc new file mode 100644 index 0000000..522da0b --- /dev/null +++ b/sbin/geom/class/tests/Makefile.inc @@ -0,0 +1,3 @@ +GEOM_CLASS= ${.CURDIR:T} + +TESTSDIR= ${TESTSBASE}/sbin/geom/class/${GEOM_CLASS} diff --git a/sbin/geom/class/tests/concat/Makefile b/sbin/geom/class/tests/concat/Makefile new file mode 100644 index 0000000..81a4e99 --- /dev/null +++ b/sbin/geom/class/tests/concat/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/sbin/geom/class/tests/eli/Makefile b/sbin/geom/class/tests/eli/Makefile new file mode 100644 index 0000000..230cc3b --- /dev/null +++ b/sbin/geom/class/tests/eli/Makefile @@ -0,0 +1,32 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= attach_d_test +TAP_TESTS_SH+= configure_b_B_test +TAP_TESTS_SH+= delkey_test +TAP_TESTS_SH+= detach_l_test +TAP_TESTS_SH+= init_B_test +TAP_TESTS_SH+= init_J_test +TAP_TESTS_SH+= init_a_test +TAP_TESTS_SH+= init_i_P_test +TAP_TESTS_SH+= init_test +TAP_TESTS_SH+= integrity_copy_test +TAP_TESTS_SH+= integrity_data_test +TAP_TESTS_SH+= integrity_hmac_test +TAP_TESTS_SH+= kill_test +TAP_TESTS_SH+= nokey_test +TAP_TESTS_SH+= onetime_a_test +TAP_TESTS_SH+= onetime_d_test +TAP_TESTS_SH+= onetime_test +TAP_TESTS_SH+= readonly_test +TAP_TESTS_SH+= resize_test +TAP_TESTS_SH+= setkey_test + +TEST_METADATA.init_a_test+= timeout="1200" +TEST_METADATA.init_test+= timeout="300" +TEST_METADATA.integrity_copy_test+= timeout="1200" +TEST_METADATA.integrity_data_test+= timeout="600" +TEST_METADATA.integrity_hmac_test+= timeout="600" +TEST_METADATA.onetime_test+= timeout="300" +TEST_METADATA.onetime_a_test+= timeout="300" + +.include diff --git a/sbin/geom/class/tests/gpt/Makefile b/sbin/geom/class/tests/gpt/Makefile new file mode 100644 index 0000000..be11f0a --- /dev/null +++ b/sbin/geom/class/tests/gpt/Makefile @@ -0,0 +1,13 @@ +# $FreeBSD$ + +BINDIR= ${TESTSDIR} + +TAP_TESTS_PERL+= gctl_test + +PROGS+= gctl +MAN= + +DPADD.gctl+= ${LIBGEOM} +LDADD.gctl+= -lgeom + +.include diff --git a/sbin/geom/class/tests/mirror/Makefile b/sbin/geom/class/tests/mirror/Makefile new file mode 100644 index 0000000..cf3784f --- /dev/null +++ b/sbin/geom/class/tests/mirror/Makefile @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test +TAP_TESTS_SH+= 3_test +TAP_TESTS_SH+= 4_test +TAP_TESTS_SH+= 5_test +TAP_TESTS_SH+= 6_test +TAP_TESTS_SH+= 7_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/sbin/geom/class/tests/nop/Makefile b/sbin/geom/class/tests/nop/Makefile new file mode 100644 index 0000000..81a4e99 --- /dev/null +++ b/sbin/geom/class/tests/nop/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/sbin/geom/class/tests/raid3/Makefile b/sbin/geom/class/tests/raid3/Makefile new file mode 100644 index 0000000..c1c95f1 --- /dev/null +++ b/sbin/geom/class/tests/raid3/Makefile @@ -0,0 +1,20 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test +TAP_TESTS_SH+= 3_test +TAP_TESTS_SH+= 4_test +TAP_TESTS_SH+= 5_test +TAP_TESTS_SH+= 6_test +TAP_TESTS_SH+= 7_test +TAP_TESTS_SH+= 8_test +TAP_TESTS_SH+= 9_test +TAP_TESTS_SH+= 10_test +TAP_TESTS_SH+= 11_test +TAP_TESTS_SH+= 12_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/sbin/geom/class/tests/shsec/Makefile b/sbin/geom/class/tests/shsec/Makefile new file mode 100644 index 0000000..81a4e99 --- /dev/null +++ b/sbin/geom/class/tests/shsec/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/sbin/geom/class/tests/stripe/Makefile b/sbin/geom/class/tests/stripe/Makefile new file mode 100644 index 0000000..81a4e99 --- /dev/null +++ b/sbin/geom/class/tests/stripe/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/sbin/geom/core/tests/Data/Makefile b/sbin/geom/core/tests/Data/Makefile new file mode 100644 index 0000000..33d7aa6 --- /dev/null +++ b/sbin/geom/core/tests/Data/Makefile @@ -0,0 +1,21 @@ +# $FreeBSD$ + +FILES+= disk.alpha.da0.xml +FILES+= disk.alpha2.da0.xml +FILES+= disk.apple.xml +FILES+= disk.beast.da0.xml +FILES+= disk.critter.ad0.xml +FILES+= disk.empty.flp.xml +FILES+= disk.far.ad0.xml +FILES+= disk.flat.da1.xml +FILES+= disk.kern.flp.xml +FILES+= disk.msdos.ext.xml +FILES+= disk.msdos.flp.xml +FILES+= disk.pc98.wdc0.xml +FILES+= disk.sun.da0.xml +FILES+= disk.sun.da1.xml +FILES+= disk.typo.ad0.xml + +FILESDIR= ${TESTSBASE}/sbin/geom/core/Data + +.include diff --git a/sbin/geom/core/tests/Makefile b/sbin/geom/core/tests/Makefile new file mode 100644 index 0000000..eaaa997 --- /dev/null +++ b/sbin/geom/core/tests/Makefile @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sbin/geom/core + +TAP_TESTS_SH+= run_test + +SUBDIR+= ConfCmp +SUBDIR+= Data +SUBDIR+= MdLoad +SUBDIR+= Ref + +.include diff --git a/sbin/geom/core/tests/Ref/Makefile b/sbin/geom/core/tests/Ref/Makefile new file mode 100644 index 0000000..582ea33 --- /dev/null +++ b/sbin/geom/core/tests/Ref/Makefile @@ -0,0 +1,21 @@ +# $FreeBSD$ + +FILES+= disk.alpha.da0.xml +FILES+= disk.alpha2.da0.xml +FILES+= disk.apple.xml +FILES+= disk.beast.da0.xml +FILES+= disk.critter.ad0.xml +FILES+= disk.empty.flp.xml +FILES+= disk.far.ad0.xml +FILES+= disk.flat.da1.xml +FILES+= disk.kern.flp.xml +FILES+= disk.msdos.ext.xml +FILES+= disk.msdos.flp.xml +FILES+= disk.pc98.wdc0.xml +FILES+= disk.sun.da0.xml +FILES+= disk.sun.da1.xml +FILES+= disk.typo.ad0.xml + +FILESDIR= ${TESTSBASE}/sbin/geom/core/Ref + +.include -- cgit v1.1 From 4d902e4cc17d3b1cffdbd7335106dee140ad4819 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 17 Nov 2015 01:07:21 +0000 Subject: Add a note as to why the geom_part testcases are currently commented out for later Memory serves me correctly, the interface has changed --- sbin/geom/class/tests/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/geom/class/tests/Makefile b/sbin/geom/class/tests/Makefile index 8b62d2c..6213996 100644 --- a/sbin/geom/class/tests/Makefile +++ b/sbin/geom/class/tests/Makefile @@ -3,6 +3,7 @@ TESTS_SUBDIRS+= concat TESTS_SUBDIRS+= eli TESTS_SUBDIRS+= gate +# XXX: might not work due to geom(4) changes; more investigation's needed #TESTS_SUBDIRS+= gpt TESTS_SUBDIRS+= mirror TESTS_SUBDIRS+= nop -- cgit v1.1 From 02e252b417a4084cc0dff45952250e8825107b57 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 18 Nov 2015 23:38:09 +0000 Subject: Do not print out errno if the call succeeded unexpectedly; this was a mistake made in r290868 MFC after: 4 days X-MFC with: r290563, r290868 Reported by: jilles Sponsored by: EMC / Isilon Storage Division --- lib/libc/tests/net/ether_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/tests/net/ether_test.c b/lib/libc/tests/net/ether_test.c index fa8e484..5b596f0 100644 --- a/lib/libc/tests/net/ether_test.c +++ b/lib/libc/tests/net/ether_test.c @@ -65,7 +65,7 @@ ATF_TC_BODY(ether_line_bad_1, tc) char hostname[256]; ATF_REQUIRE_MSG(ether_line(ether_line_bad_1_string, &e, hostname) != 0, - "ether_line succeeded unexpectedly; errno=%d", errno); + "ether_line succeeded unexpectedly"); } static const char *ether_line_bad_2_string = "x x"; @@ -77,7 +77,7 @@ ATF_TC_BODY(ether_line_bad_2, tc) char hostname[256]; ATF_REQUIRE_MSG(ether_line(ether_line_bad_2_string, &e, hostname) != 0, - "ether_line succeeded unexpectedly; errno=%d", errno); + "ether_line succeeded unexpectedly"); } static const char *ether_aton_string = "01:23:45:67:89:ab"; -- cgit v1.1 From 71ae2448477951964cabd0a057d130d54d0e833b Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 24 Nov 2015 07:55:55 +0000 Subject: - Account for stripesize/stripeoffset in diskinfo output - Remove c partitions from output (/dev/md32c was an alias for /dev/md32 that was deprecated in 8.x) --- sbin/geom/core/tests/Ref/disk.alpha.da0.xml | 11 +++--- sbin/geom/core/tests/Ref/disk.alpha2.da0.xml | 7 ++-- sbin/geom/core/tests/Ref/disk.apple.xml | 8 ++--- sbin/geom/core/tests/Ref/disk.beast.da0.xml | 7 ++-- sbin/geom/core/tests/Ref/disk.critter.ad0.xml | 19 +++++----- sbin/geom/core/tests/Ref/disk.empty.flp.xml | 2 +- sbin/geom/core/tests/Ref/disk.far.ad0.xml | 6 ++-- sbin/geom/core/tests/Ref/disk.flat.da1.xml | 20 +++++------ sbin/geom/core/tests/Ref/disk.kern.flp.xml | 7 ++-- sbin/geom/core/tests/Ref/disk.msdos.ext.xml | 52 +++++++++++++-------------- sbin/geom/core/tests/Ref/disk.msdos.flp.xml | 2 +- sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml | 13 ++++--- sbin/geom/core/tests/Ref/disk.sun.da0.xml | 9 +++-- sbin/geom/core/tests/Ref/disk.sun.da1.xml | 15 ++++---- sbin/geom/core/tests/Ref/disk.typo.ad0.xml | 23 ++++++------ 15 files changed, 94 insertions(+), 107 deletions(-) diff --git a/sbin/geom/core/tests/Ref/disk.alpha.da0.xml b/sbin/geom/core/tests/Ref/disk.alpha.da0.xml index a300f0d..d2fcacb 100644 --- a/sbin/geom/core/tests/Ref/disk.alpha.da0.xml +++ b/sbin/geom/core/tests/Ref/disk.alpha.da0.xml @@ -1,7 +1,6 @@ $FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 251658240 491520 -/dev/md34b 512 1086291968 2121664 -/dev/md34c 512 18309995520 35761710 -/dev/md34e 512 20971520 40960 -/dev/md34f 512 16951073792 33107566 +/dev/md34 512 5120 10 0 0 +/dev/md34a 512 251658240 491520 0 0 +/dev/md34b 512 1086291968 2121664 0 0 +/dev/md34e 512 20971520 40960 0 0 +/dev/md34f 512 16951073792 33107566 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.alpha2.da0.xml b/sbin/geom/core/tests/Ref/disk.alpha2.da0.xml index 7ef7573..0323eee 100644 --- a/sbin/geom/core/tests/Ref/disk.alpha2.da0.xml +++ b/sbin/geom/core/tests/Ref/disk.alpha2.da0.xml @@ -1,5 +1,4 @@ $FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 24675840 48195 -/dev/md34b 512 4178442240 8161020 -/dev/md34c 512 74027520 144585 +/dev/md34 512 5120 10 0 0 +/dev/md34a 512 24675840 48195 0 0 +/dev/md34b 512 4178442240 8161020 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.apple.xml b/sbin/geom/core/tests/Ref/disk.apple.xml index a2a0f98..bec8403 100644 --- a/sbin/geom/core/tests/Ref/disk.apple.xml +++ b/sbin/geom/core/tests/Ref/disk.apple.xml @@ -1,5 +1,5 @@ $FreeBSD$ -/dev/md34 512 366530560 715880 -/dev/md34s1 512 366481408 715784 -/dev/md34s2 512 32256 63 -/dev/md34s3 512 16384 32 +/dev/md34 512 366530560 715880 0 0 +/dev/md34s1 512 366481408 715784 0 0 +/dev/md34s2 512 32256 63 0 0 +/dev/md34s3 512 16384 32 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.beast.da0.xml b/sbin/geom/core/tests/Ref/disk.beast.da0.xml index b6aa32e..a6c922c 100644 --- a/sbin/geom/core/tests/Ref/disk.beast.da0.xml +++ b/sbin/geom/core/tests/Ref/disk.beast.da0.xml @@ -1,5 +1,4 @@ $FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 4064280576 7938048 -/dev/md34b 512 270925824 529152 -/dev/md34c 512 4335206400 8467200 +/dev/md34 512 5120 10 0 0 +/dev/md34a 512 4064280576 7938048 0 0 +/dev/md34b 512 270925824 529152 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.critter.ad0.xml b/sbin/geom/core/tests/Ref/disk.critter.ad0.xml index 0620bfe..7d83981 100644 --- a/sbin/geom/core/tests/Ref/disk.critter.ad0.xml +++ b/sbin/geom/core/tests/Ref/disk.critter.ad0.xml @@ -1,11 +1,10 @@ $FreeBSD$ -/dev/md34 512 2671841280 5218440 -/dev/md34s1 512 20003848704 39070017 -/dev/md34s1a 512 1073741824 2097152 -/dev/md34s1b 512 1073741824 2097152 -/dev/md34s1c 512 20003848704 39070017 -/dev/md34s1d 512 4447175168 8685889 -/dev/md34s1e 512 524288000 1024000 -/dev/md34s1f 512 4294967296 8388608 -/dev/md34s1g 512 3221225472 6291456 -/dev/md34s1h 512 5368709120 10485760 +/dev/md34 512 2671841280 5218440 0 0 +/dev/md34s1 512 20003848704 39070017 0 0 +/dev/md34s1a 512 1073741824 2097152 0 0 +/dev/md34s1b 512 1073741824 2097152 0 0 +/dev/md34s1d 512 4447175168 8685889 0 0 +/dev/md34s1e 512 524288000 1024000 0 0 +/dev/md34s1f 512 4294967296 8388608 0 0 +/dev/md34s1g 512 3221225472 6291456 0 0 +/dev/md34s1h 512 5368709120 10485760 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.empty.flp.xml b/sbin/geom/core/tests/Ref/disk.empty.flp.xml index 659b416..d0a1b49 100644 --- a/sbin/geom/core/tests/Ref/disk.empty.flp.xml +++ b/sbin/geom/core/tests/Ref/disk.empty.flp.xml @@ -1,2 +1,2 @@ $FreeBSD$ -/dev/md34 512 1474560 2880 80 2 18 +/dev/md34 512 1474560 2880 0 0 80 2 18 diff --git a/sbin/geom/core/tests/Ref/disk.far.ad0.xml b/sbin/geom/core/tests/Ref/disk.far.ad0.xml index 629816a..c929d48 100644 --- a/sbin/geom/core/tests/Ref/disk.far.ad0.xml +++ b/sbin/geom/core/tests/Ref/disk.far.ad0.xml @@ -1,4 +1,4 @@ $FreeBSD$ -/dev/md34 512 5632 11 -/dev/md34s1 512 296821760 579730 -/dev/md34s2 512 4564740096 8915508 +/dev/md34 512 5632 11 0 0 +/dev/md34s1 512 296821760 579730 0 0 +/dev/md34s2 512 4564740096 8915508 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.flat.da1.xml b/sbin/geom/core/tests/Ref/disk.flat.da1.xml index 89e2df4..4a02fec 100644 --- a/sbin/geom/core/tests/Ref/disk.flat.da1.xml +++ b/sbin/geom/core/tests/Ref/disk.flat.da1.xml @@ -1,12 +1,10 @@ $FreeBSD$ -/dev/md34 512 37888 74 -/dev/md34a 512 37748736 73728 -/dev/md34b 512 268435456 524288 -/dev/md34c 512 8422686720 16450560 -/dev/md34h 512 8115978240 15851520 -/dev/md34s1 512 18367017984 35873082 -/dev/md34s1b 512 419430400 819200 -/dev/md34s1c 512 18367017984 35873082 -/dev/md34s1e 512 419430400 819200 -/dev/md34s1f 512 1073741824 2097152 -/dev/md34s1g 512 16454415360 32137530 +/dev/md34 512 37888 74 0 0 +/dev/md34a 512 37748736 73728 0 0 +/dev/md34b 512 268435456 524288 0 0 +/dev/md34h 512 8115978240 15851520 0 0 +/dev/md34s1 512 18367017984 35873082 0 0 +/dev/md34s1b 512 419430400 819200 0 0 +/dev/md34s1e 512 419430400 819200 0 0 +/dev/md34s1f 512 1073741824 2097152 0 0 +/dev/md34s1g 512 16454415360 32137530 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.kern.flp.xml b/sbin/geom/core/tests/Ref/disk.kern.flp.xml index 6ff67a0..d62c963 100644 --- a/sbin/geom/core/tests/Ref/disk.kern.flp.xml +++ b/sbin/geom/core/tests/Ref/disk.kern.flp.xml @@ -1,5 +1,4 @@ $FreeBSD$ -/dev/md34 512 5632 11 -/dev/md34a 512 1474560 2880 -/dev/md34b 512 1474560 2880 -/dev/md34c 512 1474560 2880 +/dev/md34 512 5632 11 0 0 +/dev/md34a 512 1474560 2880 0 0 +/dev/md34b 512 1474560 2880 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.msdos.ext.xml b/sbin/geom/core/tests/Ref/disk.msdos.ext.xml index dc2aced..2820c46 100644 --- a/sbin/geom/core/tests/Ref/disk.msdos.ext.xml +++ b/sbin/geom/core/tests/Ref/disk.msdos.ext.xml @@ -1,27 +1,27 @@ $FreeBSD$ -/dev/md34 512 2327759360 4546405 -/dev/md34s1 512 2146765824 4192902 -/dev/md34s10 512 8193024 16002 -/dev/md34s11 512 8193024 16002 -/dev/md34s12 512 8193024 16002 -/dev/md34s13 512 8193024 16002 -/dev/md34s14 512 8193024 16002 -/dev/md34s15 512 8193024 16002 -/dev/md34s16 512 8193024 16002 -/dev/md34s17 512 8193024 16002 -/dev/md34s18 512 8193024 16002 -/dev/md34s19 512 8193024 16002 -/dev/md34s2 512 427714560 835380 -/dev/md34s20 512 8193024 16002 -/dev/md34s21 512 8193024 16002 -/dev/md34s22 512 8193024 16002 -/dev/md34s23 512 8193024 16002 -/dev/md34s24 512 8193024 16002 -/dev/md34s25 512 8193024 16002 -/dev/md34s26 512 8193024 16002 -/dev/md34s27 512 8193024 16002 -/dev/md34s5 512 8193024 16002 -/dev/md34s6 512 8193024 16002 -/dev/md34s7 512 8193024 16002 -/dev/md34s8 512 8193024 16002 -/dev/md34s9 512 8193024 16002 +/dev/md34 512 2327759360 4546405 0 0 +/dev/md34s1 512 2146765824 4192902 0 0 +/dev/md34s10 512 8193024 16002 0 0 +/dev/md34s11 512 8193024 16002 0 0 +/dev/md34s12 512 8193024 16002 0 0 +/dev/md34s13 512 8193024 16002 0 0 +/dev/md34s14 512 8193024 16002 0 0 +/dev/md34s15 512 8193024 16002 0 0 +/dev/md34s16 512 8193024 16002 0 0 +/dev/md34s17 512 8193024 16002 0 0 +/dev/md34s18 512 8193024 16002 0 0 +/dev/md34s19 512 8193024 16002 0 0 +/dev/md34s2 512 427714560 835380 0 0 +/dev/md34s20 512 8193024 16002 0 0 +/dev/md34s21 512 8193024 16002 0 0 +/dev/md34s22 512 8193024 16002 0 0 +/dev/md34s23 512 8193024 16002 0 0 +/dev/md34s24 512 8193024 16002 0 0 +/dev/md34s25 512 8193024 16002 0 0 +/dev/md34s26 512 8193024 16002 0 0 +/dev/md34s27 512 8193024 16002 0 0 +/dev/md34s5 512 8193024 16002 0 0 +/dev/md34s6 512 8193024 16002 0 0 +/dev/md34s7 512 8193024 16002 0 0 +/dev/md34s8 512 8193024 16002 0 0 +/dev/md34s9 512 8193024 16002 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.msdos.flp.xml b/sbin/geom/core/tests/Ref/disk.msdos.flp.xml index c176c58..2b2b63e 100644 --- a/sbin/geom/core/tests/Ref/disk.msdos.flp.xml +++ b/sbin/geom/core/tests/Ref/disk.msdos.flp.xml @@ -1,2 +1,2 @@ $FreeBSD$ -/dev/md34 512 5632 11 +/dev/md34 512 5632 11 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml b/sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml index 5ffb0c9..ea89ed2 100644 --- a/sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml +++ b/sbin/geom/core/tests/Ref/disk.pc98.wdc0.xml @@ -1,8 +1,7 @@ $FreeBSD$ -/dev/md34 512 75264 147 1 8 17 -/dev/md34s1 512 1626603520 3176960 23360 8 17 -/dev/md34s1a 512 78643200 153600 1129 8 17 -/dev/md34s1b 512 104857600 204800 1505 8 17 -/dev/md34s1c 512 1626603520 3176960 23360 8 17 -/dev/md34s1e 512 52428800 102400 752 8 17 -/dev/md34s1f 512 1390673920 2716160 19971 8 17 +/dev/md34 512 75264 147 0 0 1 8 17 +/dev/md34s1 512 1626603520 3176960 23360 0 0 8 17 +/dev/md34s1a 512 78643200 153600 1129 0 0 8 17 +/dev/md34s1b 512 104857600 204800 1505 0 0 8 17 +/dev/md34s1e 512 52428800 102400 752 0 0 8 17 +/dev/md34s1f 512 1390673920 2716160 19971 0 0 8 17 diff --git a/sbin/geom/core/tests/Ref/disk.sun.da0.xml b/sbin/geom/core/tests/Ref/disk.sun.da0.xml index 15b97c8..da6c0aa 100644 --- a/sbin/geom/core/tests/Ref/disk.sun.da0.xml +++ b/sbin/geom/core/tests/Ref/disk.sun.da0.xml @@ -1,6 +1,5 @@ $FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 1529708544 2987712 -/dev/md34b 512 539320320 1053360 -/dev/md34c 512 36698296320 71676360 -/dev/md34h 512 34629267456 67635288 +/dev/md34 512 5120 10 0 0 +/dev/md34a 512 1529708544 2987712 0 0 +/dev/md34b 512 539320320 1053360 0 0 +/dev/md34h 512 34629267456 67635288 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.sun.da1.xml b/sbin/geom/core/tests/Ref/disk.sun.da1.xml index 004771b..b1fe169 100644 --- a/sbin/geom/core/tests/Ref/disk.sun.da1.xml +++ b/sbin/geom/core/tests/Ref/disk.sun.da1.xml @@ -1,9 +1,8 @@ $FreeBSD$ -/dev/md34 512 5120 10 -/dev/md34a 512 262967296 513608 -/dev/md34b 512 1075994624 2101552 -/dev/md34c 512 18108555264 35368272 -/dev/md34d 512 11124240384 21727032 -/dev/md34f 512 2149576704 4198392 -/dev/md34g 512 2149576704 4198392 -/dev/md34h 512 1343787008 2624584 +/dev/md34 512 5120 10 0 0 +/dev/md34a 512 262967296 513608 0 0 +/dev/md34b 512 1075994624 2101552 0 0 +/dev/md34d 512 11124240384 21727032 0 0 +/dev/md34f 512 2149576704 4198392 0 0 +/dev/md34g 512 2149576704 4198392 0 0 +/dev/md34h 512 1343787008 2624584 0 0 diff --git a/sbin/geom/core/tests/Ref/disk.typo.ad0.xml b/sbin/geom/core/tests/Ref/disk.typo.ad0.xml index 6d537dd..0ff1773 100644 --- a/sbin/geom/core/tests/Ref/disk.typo.ad0.xml +++ b/sbin/geom/core/tests/Ref/disk.typo.ad0.xml @@ -1,14 +1,11 @@ $FreeBSD$ -/dev/md34 512 8585262592 16768091 -/dev/md34s1 512 3220406784 6289857 -/dev/md34s1a 512 104857600 204800 -/dev/md34s1b 512 524288000 1024000 -/dev/md34s1c 512 3220406784 6289857 -/dev/md34s1e 512 524288000 1024000 -/dev/md34s1f 512 2066973184 4037057 -/dev/md34s2 512 5364817920 10478160 -/dev/md34s2c 512 5364817920 10478160 -/dev/md34s3 512 8585256960 16768080 -/dev/md34s3a 512 2097152000 4096000 -/dev/md34s3c 512 8585256960 16768080 -/dev/md34s3d 512 6488104960 12672080 +/dev/md34 512 8585262592 16768091 0 0 +/dev/md34s1 512 3220406784 6289857 0 0 +/dev/md34s1a 512 104857600 204800 0 0 +/dev/md34s1b 512 524288000 1024000 0 0 +/dev/md34s1e 512 524288000 1024000 0 0 +/dev/md34s1f 512 2066973184 4037057 0 0 +/dev/md34s2 512 5364817920 10478160 0 0 +/dev/md34s3 512 8585256960 16768080 0 0 +/dev/md34s3a 512 2097152000 4096000 0 0 +/dev/md34s3d 512 6488104960 12672080 0 0 -- cgit v1.1 From 93efb17b00ee4ca966d0c780d96e567776069e4b Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 24 Nov 2015 09:05:28 +0000 Subject: Catch relevant errors --- sbin/geom/core/tests/MdLoad/MdLoad.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/sbin/geom/core/tests/MdLoad/MdLoad.c b/sbin/geom/core/tests/MdLoad/MdLoad.c index c2e5a8a..a7238aaa 100644 --- a/sbin/geom/core/tests/MdLoad/MdLoad.c +++ b/sbin/geom/core/tests/MdLoad/MdLoad.c @@ -35,22 +35,23 @@ * $FreeBSD$ */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include #include -#include -#include -#include -#include -#include + #include -#include -#include -#include -#include -#include struct sector { LIST_ENTRY(sector) sectors; @@ -216,9 +217,12 @@ g_simdisk_xml_load(const char *file) fd = open(file, O_RDONLY); if (fd < 0) - err(1, "%s", file); - fstat(fd, &st); + err(1, "%s: opening %s failed", __func__, file); + if (fstat(fd, &st) == -1) + err(1, "%s: fstat'ing %s failed", __func__, file); p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0); + if (p == MAP_FAILED) + err(1, "%s: mmap'ing %s failed", __func__, file); i = XML_Parse(parser, p, st.st_size, 1); if (i != 1) errx(1, "XML_Parse complains: return %d", i); @@ -252,7 +256,7 @@ main(int argc, char **argv) sprintf(buf + strlen(buf), " -u %s", argv[1]); error = system(buf); if (error) - return (error); + err(1, "calling `%s` failed; status=%d", buf, error); fd = open(argv[1], O_RDWR); if (fd < 0 && errno == ENOENT) { sprintf(buf, "%s%s", _PATH_DEV, argv[1]); -- cgit v1.1 From 62bc110b37cc1be874111e1d2e57c7270197af5a Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 24 Nov 2015 09:08:31 +0000 Subject: Do some incremental work trying to improve the test script Unfortunately it seems that phk broke how labels/partitions were created in r113434 and the gap was never completed, so these testcases are broken. Exit early --- sbin/geom/core/tests/run_test.sh | 65 +++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/sbin/geom/core/tests/run_test.sh b/sbin/geom/core/tests/run_test.sh index 96a3530..bc640e5 100644 --- a/sbin/geom/core/tests/run_test.sh +++ b/sbin/geom/core/tests/run_test.sh @@ -2,49 +2,60 @@ # $FreeBSD$ MD=34 -TMP=/tmp/$$ +: ${TMPDIR=/tmp} +TMP=$TMPDIR/$$ + +# The testcases seem to have been broken when the geom_sim provider was removed +echo "# these tests need to be rewritten; they were broken in r113434" +echo "1..0 # SKIP" +exit 0 set -e # Start from the right directory so we can find all our data files. -cd `dirname $0` - -(cd MdLoad && make) > /dev/null 2>&1 +testsdir=$(realpath $(dirname $0)) # Print the test header -echo -n '1..' -echo `ls -1 Data/disk.*.xml | wc -l` +set -- $testsdir/Data/disk.*.xml +echo "1..$#" +data_files="$@" + +trap "rm -f $TMP; mdconfig -d -u $MD" EXIT INT TERM -for f in Data/disk.*.xml -do +set +e + +refdir=$(realpath $(mktemp -d Ref.XXXXXX)) +for f in $data_files; do b=`basename $f` - mdconfig -d -u $MD > /dev/null 2>&1 || true - if [ -c /dev/md$MD ] ; then - sleep 1 - fi - if [ -c /dev/md$MD ] ; then + mdconfig -d -u $MD + + i=0 + while [ $i -lt 2 -a -c /dev/md$MD ]; do sleep 1 - fi + : $(( i += 1 )) + done if [ -c /dev/md$MD ] ; then echo "Bail out!" echo "/dev/md$MD is busy" exit 1 fi - MdLoad/MdLoad md${MD} $f - if [ -f Ref/$b ] ; then - if diskinfo /dev/md${MD}* | - diff -I '$FreeBSD' -u Ref/$b - > $TMP; then - echo "ok - $b" + if ! $testsdir/MdLoad/MdLoad md${MD} $f; then + echo "not ok - $b # MdLoad failed" + continue + fi + if [ ! -f $refdir/$b ]; then + if [ -f $testsdir/Ref/$b ] ; then + grep -v '\$FreeBSD.*\$' $testsdir/Ref/$b > $refdir/$b else - echo "not ok - $b" - sed 's/^/# /' $TMP + diskinfo /dev/md${MD}* > $refdir/$b + continue fi + fi + diskinfo /dev/md${MD}* | diff -u $refdir/$b - > $TMP + if [ $? -eq 0 ]; then + echo "ok - $b" else - diskinfo /dev/md${MD}* > Ref/`basename $f` + echo "not ok - $b" + sed 's/^/# /' $TMP fi done - -mdconfig -d -u $MD > /dev/null 2>&1 || true -rm -f $TMP - -exit 0 -- cgit v1.1 From b3ea8b91158a6af4f5120cf3517792b70859a158 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 24 Nov 2015 09:52:46 +0000 Subject: Increase the timeout for onetime_test and onetime_a_test to 10 minutes --- sbin/geom/class/tests/eli/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/geom/class/tests/eli/Makefile b/sbin/geom/class/tests/eli/Makefile index 230cc3b..721774a 100644 --- a/sbin/geom/class/tests/eli/Makefile +++ b/sbin/geom/class/tests/eli/Makefile @@ -26,7 +26,7 @@ TEST_METADATA.init_test+= timeout="300" TEST_METADATA.integrity_copy_test+= timeout="1200" TEST_METADATA.integrity_data_test+= timeout="600" TEST_METADATA.integrity_hmac_test+= timeout="600" -TEST_METADATA.onetime_test+= timeout="300" -TEST_METADATA.onetime_a_test+= timeout="300" +TEST_METADATA.onetime_a_test+= timeout="600" +TEST_METADATA.onetime_test+= timeout="600" .include -- cgit v1.1 From c06a213adf329d647257f878db9b44240a873751 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 24 Nov 2015 23:44:06 +0000 Subject: Add -F pidfile to usage(..) --- sbin/ggate/ggated/ggated.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/ggate/ggated/ggated.c b/sbin/ggate/ggated/ggated.c index d6a2e47..e234cb5 100644 --- a/sbin/ggate/ggated/ggated.c +++ b/sbin/ggate/ggated/ggated.c @@ -112,8 +112,8 @@ static void usage(void) { - fprintf(stderr, "usage: %s [-nv] [-a address] [-p port] [-R rcvbuf] " - "[-S sndbuf] [exports file]\n", getprogname()); + fprintf(stderr, "usage: %s [-nv] [-a address] [-F pidfile] [-p port] " + "[-R rcvbuf] [-S sndbuf] [exports file]\n", getprogname()); exit(EXIT_FAILURE); } -- cgit v1.1 From 3fe9284580e2b63fc46a00764a006af9558a977f Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 24 Nov 2015 23:45:38 +0000 Subject: Load geom_gate.ko via kldload as `[geom ]gate load` isn't implemented. Every time geom_subr.sh tries to run the command, it'll fail --- sbin/geom/class/tests/gate/conf.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/geom/class/tests/gate/conf.sh b/sbin/geom/class/tests/gate/conf.sh index 7e22ce4..4eede08 100755 --- a/sbin/geom/class/tests/gate/conf.sh +++ b/sbin/geom/class/tests/gate/conf.sh @@ -5,4 +5,6 @@ name="$(mktemp -u gate.XXXXXX)" class="gate" base=`basename $0` +kldstat -q -m g_${class} || kldload geom_${class} || exit 1 + . `dirname $0`/../geom_subr.sh -- cgit v1.1 From 5f669205ba8e7d5af97c48482f51e599c9b48040 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 00:12:13 +0000 Subject: - Allocate random devices via attach_md - Replace hardcoded references to /tmp with $TMPDIR - Remove all manual mdconfig -d -u calls --- sbin/geom/class/tests/raid3/10_test.sh | 20 +++++++------------- sbin/geom/class/tests/raid3/11_test.sh | 20 +++++++------------- sbin/geom/class/tests/raid3/12_test.sh | 26 ++++++++++---------------- sbin/geom/class/tests/raid3/1_test.sh | 15 ++++----------- sbin/geom/class/tests/raid3/2_test.sh | 20 +++++++------------- sbin/geom/class/tests/raid3/3_test.sh | 20 +++++++------------- sbin/geom/class/tests/raid3/4_test.sh | 20 +++++++------------- sbin/geom/class/tests/raid3/5_test.sh | 20 +++++++------------- sbin/geom/class/tests/raid3/6_test.sh | 22 ++++++++-------------- sbin/geom/class/tests/raid3/7_test.sh | 24 +++++++++--------------- sbin/geom/class/tests/raid3/8_test.sh | 22 ++++++++-------------- sbin/geom/class/tests/raid3/9_test.sh | 24 +++++++++--------------- 12 files changed, 90 insertions(+), 163 deletions(-) diff --git a/sbin/geom/class/tests/raid3/10_test.sh b/sbin/geom/class/tests/raid3/10_test.sh index 1320120..fc059ac 100755 --- a/sbin/geom/class/tests/raid3/10_test.sh +++ b/sbin/geom/class/tests/raid3/10_test.sh @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label -r $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -r $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/11_test.sh b/sbin/geom/class/tests/raid3/11_test.sh index 3382214..ae35ce1 100755 --- a/sbin/geom/class/tests/raid3/11_test.sh +++ b/sbin/geom/class/tests/raid3/11_test.sh @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/12_test.sh b/sbin/geom/class/tests/raid3/12_test.sh index 3dec406..3b3647a 100755 --- a/sbin/geom/class/tests/raid3/12_test.sh +++ b/sbin/geom/class/tests/raid3/12_test.sh @@ -5,31 +5,28 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` nblocks1=9 nblocks2=`expr $nblocks1 - 1` nblocks3=`expr $nblocks2 / 2` -mdconfig -a -t malloc -s $nblocks1 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us2 || exit 1 +us0=$(attach_md -t malloc -s $nblocks1) || exit 1 +us1=$(attach_md -t malloc -s $nblocks1) || exit 1 +us2=$(attach_md -t malloc -s $nblocks1) || exit 1 -dd if=/dev/random of=/dev/md${us0} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us1} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us2} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us0} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us2} count=$nblocks1 >/dev/null 2>&1 -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # Wait for synchronization. sleep 2 graid3 stop $name # Break one component. -dd if=/dev/random of=/dev/md${us1} count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks2 >/dev/null 2>&1 # Provoke retaste of the rest components. -true > /dev/md${us0} -true > /dev/md${us2} +true > /dev/${us0} +true > /dev/${us2} sleep 1 dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 @@ -41,6 +38,3 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 diff --git a/sbin/geom/class/tests/raid3/1_test.sh b/sbin/geom/class/tests/raid3/1_test.sh index 9202967..cf88054 100755 --- a/sbin/geom/class/tests/raid3/1_test.sh +++ b/sbin/geom/class/tests/raid3/1_test.sh @@ -5,15 +5,11 @@ echo "1..2" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 devwait # Size of created device should be 2MB - 1024B. @@ -32,6 +28,3 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 diff --git a/sbin/geom/class/tests/raid3/2_test.sh b/sbin/geom/class/tests/raid3/2_test.sh index 88daf78..5742739 100755 --- a/sbin/geom/class/tests/raid3/2_test.sh +++ b/sbin/geom/class/tests/raid3/2_test.sh @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/3_test.sh b/sbin/geom/class/tests/raid3/3_test.sh index d2c1a5f..2e7da7c 100755 --- a/sbin/geom/class/tests/raid3/3_test.sh +++ b/sbin/geom/class/tests/raid3/3_test.sh @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -37,7 +34,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/4_test.sh b/sbin/geom/class/tests/raid3/4_test.sh index d437ec0..8bad777 100755 --- a/sbin/geom/class/tests/raid3/4_test.sh +++ b/sbin/geom/class/tests/raid3/4_test.sh @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # @@ -37,7 +34,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/5_test.sh b/sbin/geom/class/tests/raid3/5_test.sh index ffd85f6..8d904ec 100755 --- a/sbin/geom/class/tests/raid3/5_test.sh +++ b/sbin/geom/class/tests/raid3/5_test.sh @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # @@ -37,7 +34,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/6_test.sh b/sbin/geom/class/tests/raid3/6_test.sh index 97b5503..828f92a 100755 --- a/sbin/geom/class/tests/raid3/6_test.sh +++ b/sbin/geom/class/tests/raid3/6_test.sh @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -29,7 +26,7 @@ dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 # Rebuild of DATA component. # graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 graid3 insert -n 1 $name md${us1} sleep 1 @@ -41,7 +38,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/7_test.sh b/sbin/geom/class/tests/raid3/7_test.sh index 3d89873..c0efdda 100755 --- a/sbin/geom/class/tests/raid3/7_test.sh +++ b/sbin/geom/class/tests/raid3/7_test.sh @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -29,12 +26,12 @@ dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 # Rebuild of PARITY component. # graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 graid3 insert -n 2 $name md${us2} sleep 1 # Remove DATA component, so PARITY component can be used while reading. graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -44,7 +41,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/8_test.sh b/sbin/geom/class/tests/raid3/8_test.sh index b9621f4..3272814 100755 --- a/sbin/geom/class/tests/raid3/8_test.sh +++ b/sbin/geom/class/tests/raid3/8_test.sh @@ -5,29 +5,26 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # # Writing without DATA component and rebuild of DATA component. # graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 insert -n 1 $name md${us1} sleep 1 @@ -40,7 +37,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/9_test.sh b/sbin/geom/class/tests/raid3/9_test.sh index 0695011..aa6768b 100755 --- a/sbin/geom/class/tests/raid3/9_test.sh +++ b/sbin/geom/class/tests/raid3/9_test.sh @@ -5,35 +5,32 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # # Writing without PARITY component and rebuild of PARITY component. # graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 insert -n 2 $name md${us2} sleep 1 # Remove DATA component, so PARITY component can be used while reading. graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -43,7 +40,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} -- cgit v1.1 From a630957e2e3e0ad9b0b4e1ca166661efce74f55a Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 00:17:25 +0000 Subject: Implement graid3_test_cleanup, which calls graid3 stop $name, then geom_test_cleanup --- sbin/geom/class/tests/raid3/conf.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sbin/geom/class/tests/raid3/conf.sh b/sbin/geom/class/tests/raid3/conf.sh index 93e7dea..4f141df 100755 --- a/sbin/geom/class/tests/raid3/conf.sh +++ b/sbin/geom/class/tests/raid3/conf.sh @@ -5,4 +5,11 @@ name="test" class="raid3" base=`basename $0` +graid3_test_cleanup() +{ + [ -c /dev/$class/$name ] && graid3 stop $name + geom_test_cleanup +} +trap graid3_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh -- cgit v1.1 From 1016c2bb3f8dcd2cf789cd5f6e1d23066a6ca637 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 00:17:56 +0000 Subject: Remove `graid3 stop $name` --- sbin/geom/class/tests/raid3/10_test.sh | 1 - sbin/geom/class/tests/raid3/11_test.sh | 1 - sbin/geom/class/tests/raid3/12_test.sh | 2 -- sbin/geom/class/tests/raid3/1_test.sh | 2 -- sbin/geom/class/tests/raid3/2_test.sh | 1 - sbin/geom/class/tests/raid3/3_test.sh | 1 - sbin/geom/class/tests/raid3/4_test.sh | 1 - sbin/geom/class/tests/raid3/5_test.sh | 1 - sbin/geom/class/tests/raid3/6_test.sh | 1 - sbin/geom/class/tests/raid3/7_test.sh | 1 - sbin/geom/class/tests/raid3/8_test.sh | 1 - sbin/geom/class/tests/raid3/9_test.sh | 1 - 12 files changed, 14 deletions(-) diff --git a/sbin/geom/class/tests/raid3/10_test.sh b/sbin/geom/class/tests/raid3/10_test.sh index fc059ac..73adbfe 100755 --- a/sbin/geom/class/tests/raid3/10_test.sh +++ b/sbin/geom/class/tests/raid3/10_test.sh @@ -29,5 +29,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/11_test.sh b/sbin/geom/class/tests/raid3/11_test.sh index ae35ce1..748fdb9 100755 --- a/sbin/geom/class/tests/raid3/11_test.sh +++ b/sbin/geom/class/tests/raid3/11_test.sh @@ -29,5 +29,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/12_test.sh b/sbin/geom/class/tests/raid3/12_test.sh index 3b3647a..10533c6 100755 --- a/sbin/geom/class/tests/raid3/12_test.sh +++ b/sbin/geom/class/tests/raid3/12_test.sh @@ -36,5 +36,3 @@ if [ $ec -eq 0 ]; then else echo "ok 1" fi - -graid3 stop $name diff --git a/sbin/geom/class/tests/raid3/1_test.sh b/sbin/geom/class/tests/raid3/1_test.sh index cf88054..4c0b4a2 100755 --- a/sbin/geom/class/tests/raid3/1_test.sh +++ b/sbin/geom/class/tests/raid3/1_test.sh @@ -26,5 +26,3 @@ if [ $sectorsize -eq 1024 ]; then else echo "not ok 2" fi - -graid3 stop $name diff --git a/sbin/geom/class/tests/raid3/2_test.sh b/sbin/geom/class/tests/raid3/2_test.sh index 5742739..83fe4dc 100755 --- a/sbin/geom/class/tests/raid3/2_test.sh +++ b/sbin/geom/class/tests/raid3/2_test.sh @@ -29,5 +29,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/3_test.sh b/sbin/geom/class/tests/raid3/3_test.sh index 2e7da7c..0b00357 100755 --- a/sbin/geom/class/tests/raid3/3_test.sh +++ b/sbin/geom/class/tests/raid3/3_test.sh @@ -33,5 +33,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/4_test.sh b/sbin/geom/class/tests/raid3/4_test.sh index 8bad777..f45a9b8 100755 --- a/sbin/geom/class/tests/raid3/4_test.sh +++ b/sbin/geom/class/tests/raid3/4_test.sh @@ -33,5 +33,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/5_test.sh b/sbin/geom/class/tests/raid3/5_test.sh index 8d904ec..cfe904f 100755 --- a/sbin/geom/class/tests/raid3/5_test.sh +++ b/sbin/geom/class/tests/raid3/5_test.sh @@ -33,5 +33,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/6_test.sh b/sbin/geom/class/tests/raid3/6_test.sh index 828f92a..d9d6b97 100755 --- a/sbin/geom/class/tests/raid3/6_test.sh +++ b/sbin/geom/class/tests/raid3/6_test.sh @@ -37,5 +37,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/7_test.sh b/sbin/geom/class/tests/raid3/7_test.sh index c0efdda..189b900 100755 --- a/sbin/geom/class/tests/raid3/7_test.sh +++ b/sbin/geom/class/tests/raid3/7_test.sh @@ -40,5 +40,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/8_test.sh b/sbin/geom/class/tests/raid3/8_test.sh index 3272814..c0717c8 100755 --- a/sbin/geom/class/tests/raid3/8_test.sh +++ b/sbin/geom/class/tests/raid3/8_test.sh @@ -36,5 +36,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/9_test.sh b/sbin/geom/class/tests/raid3/9_test.sh index aa6768b..866c5d7 100755 --- a/sbin/geom/class/tests/raid3/9_test.sh +++ b/sbin/geom/class/tests/raid3/9_test.sh @@ -39,5 +39,4 @@ else echo "ok 1" fi -graid3 stop $name rm -f ${src} ${dst} -- cgit v1.1 From 5dba2d4e37064f4f3132bd26d5b93f2530f7e4fc Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 00:33:42 +0000 Subject: Move 1 to 1_test and 2 to 2_test --- sbin/geom/class/tests/uzip/1.sh | 37 ------------------------------------ sbin/geom/class/tests/uzip/1_test.sh | 37 ++++++++++++++++++++++++++++++++++++ sbin/geom/class/tests/uzip/2.sh | 18 ------------------ sbin/geom/class/tests/uzip/2_test.sh | 18 ++++++++++++++++++ sbin/geom/class/tests/uzip/Makefile | 4 ++-- 5 files changed, 57 insertions(+), 57 deletions(-) delete mode 100755 sbin/geom/class/tests/uzip/1.sh create mode 100755 sbin/geom/class/tests/uzip/1_test.sh delete mode 100755 sbin/geom/class/tests/uzip/2.sh create mode 100755 sbin/geom/class/tests/uzip/2_test.sh diff --git a/sbin/geom/class/tests/uzip/1.sh b/sbin/geom/class/tests/uzip/1.sh deleted file mode 100755 index af3e889..0000000 --- a/sbin/geom/class/tests/uzip/1.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -mntpoint="/mnt/test-1" - -# -# prepare -kldload geom_uzip -UUE=$(dirname $0)/1.img.uzip.uue -uudecode $UUE -num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 -sleep 1 - -# -# mount -mkdir -p "${mntpoint}" -mount -o ro /dev/md${num}.uzip "${mntpoint}" || exit 1 - -# -# compare -#cat "${mntpoint}/etalon.txt" -diff -u etalon/etalon.txt "${mntpoint}/etalon.txt" -if [ $? -eq 0 ]; then - echo "PASS" -else - echo "FAIL" -fi - -# -# cleanup -umount "${mntpoint}" -rmdir "${mntpoint}" -mdconfig -d -u ${num} -sleep 1 -kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/1_test.sh b/sbin/geom/class/tests/uzip/1_test.sh new file mode 100755 index 0000000..af3e889 --- /dev/null +++ b/sbin/geom/class/tests/uzip/1_test.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +mntpoint="/mnt/test-1" + +# +# prepare +kldload geom_uzip +UUE=$(dirname $0)/1.img.uzip.uue +uudecode $UUE +num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 +sleep 1 + +# +# mount +mkdir -p "${mntpoint}" +mount -o ro /dev/md${num}.uzip "${mntpoint}" || exit 1 + +# +# compare +#cat "${mntpoint}/etalon.txt" +diff -u etalon/etalon.txt "${mntpoint}/etalon.txt" +if [ $? -eq 0 ]; then + echo "PASS" +else + echo "FAIL" +fi + +# +# cleanup +umount "${mntpoint}" +rmdir "${mntpoint}" +mdconfig -d -u ${num} +sleep 1 +kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/2.sh b/sbin/geom/class/tests/uzip/2.sh deleted file mode 100755 index bf66169..0000000 --- a/sbin/geom/class/tests/uzip/2.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# -# prepare - -UUE=$(dirname $0)/1.img.uzip.uue - -kldload geom_uzip -uudecode $UUE -num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 -sleep 1 - -# -# destroy -kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/2_test.sh b/sbin/geom/class/tests/uzip/2_test.sh new file mode 100755 index 0000000..bf66169 --- /dev/null +++ b/sbin/geom/class/tests/uzip/2_test.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# +# prepare + +UUE=$(dirname $0)/1.img.uzip.uue + +kldload geom_uzip +uudecode $UUE +num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 +sleep 1 + +# +# destroy +kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/Makefile b/sbin/geom/class/tests/uzip/Makefile index a9a7341..d56fec2 100644 --- a/sbin/geom/class/tests/uzip/Makefile +++ b/sbin/geom/class/tests/uzip/Makefile @@ -28,7 +28,7 @@ FILESGROUPS= FILES etalon etalon+= etalon/etalon.txt etalonDIR= ${TESTSDIR}/etalon -PLAIN_TESTS_SH+= 1 -PLAIN_TESTS_SH+= 2 +PLAIN_TESTS_SH+= 1_test +PLAIN_TESTS_SH+= 2_test .include -- cgit v1.1 From daabb59685c0d31c648f6b7a9b0a9f50e7144999 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 00:52:10 +0000 Subject: Remove useless test --- sbin/geom/class/tests/uzip/2_test.sh | 18 ------------------ sbin/geom/class/tests/uzip/Makefile | 1 - 2 files changed, 19 deletions(-) delete mode 100755 sbin/geom/class/tests/uzip/2_test.sh diff --git a/sbin/geom/class/tests/uzip/2_test.sh b/sbin/geom/class/tests/uzip/2_test.sh deleted file mode 100755 index bf66169..0000000 --- a/sbin/geom/class/tests/uzip/2_test.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# -# prepare - -UUE=$(dirname $0)/1.img.uzip.uue - -kldload geom_uzip -uudecode $UUE -num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 -sleep 1 - -# -# destroy -kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/Makefile b/sbin/geom/class/tests/uzip/Makefile index d56fec2..ad437c7 100644 --- a/sbin/geom/class/tests/uzip/Makefile +++ b/sbin/geom/class/tests/uzip/Makefile @@ -29,6 +29,5 @@ etalon+= etalon/etalon.txt etalonDIR= ${TESTSDIR}/etalon PLAIN_TESTS_SH+= 1_test -PLAIN_TESTS_SH+= 2_test .include -- cgit v1.1 From cfb3e257cd18a318cb4b2cc6b07b8c3dac1ee37c Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 01:14:00 +0000 Subject: Add conf.sh for creating a mountpoint, unmounting the mountpoint and cleaning up any temporary md devices --- sbin/geom/class/tests/uzip/conf.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 sbin/geom/class/tests/uzip/conf.sh diff --git a/sbin/geom/class/tests/uzip/conf.sh b/sbin/geom/class/tests/uzip/conf.sh new file mode 100755 index 0000000..a0204d6 --- /dev/null +++ b/sbin/geom/class/tests/uzip/conf.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# $FreeBSD$ + +class="uzip" +base=`basename $0` +mntpoint=$(mktemp -d $TMPDIR/tmp.XXXXXX) || exit + +uzip_test_cleanup() +{ + umount $mntpoint + rmdir $mntpoint + geom_test_cleanup +} +trap uzip_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh -- cgit v1.1 From ab8d38b2870101690f78b0a0760a093de9aa4f75 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 01:15:25 +0000 Subject: - Convert 1_test into a TAP testcase - Use conf.sh - Simplify the setup/cleanup steps --- sbin/geom/class/tests/uzip/1_test.sh | 35 ++++++++++------------------------- sbin/geom/class/tests/uzip/Makefile | 5 ++++- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/sbin/geom/class/tests/uzip/1_test.sh b/sbin/geom/class/tests/uzip/1_test.sh index af3e889..222b6c9 100755 --- a/sbin/geom/class/tests/uzip/1_test.sh +++ b/sbin/geom/class/tests/uzip/1_test.sh @@ -1,37 +1,22 @@ #!/bin/sh -# # $FreeBSD$ -# -mntpoint="/mnt/test-1" +testsdir=$(dirname $0) +. $testsdir/conf.sh -# -# prepare -kldload geom_uzip -UUE=$(dirname $0)/1.img.uzip.uue +echo "1..1" + +UUE=$testsdir/1.img.uzip.uue uudecode $UUE -num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 +us0=$(attach_md -f $(basename $UUE .uue)) || exit 1 sleep 1 -# -# mount -mkdir -p "${mntpoint}" -mount -o ro /dev/md${num}.uzip "${mntpoint}" || exit 1 +mount -o ro /dev/${us0}.uzip "${mntpoint}" || exit 1 -# -# compare #cat "${mntpoint}/etalon.txt" -diff -u etalon/etalon.txt "${mntpoint}/etalon.txt" +diff -I '\$FreeBSD.*\$' -u $testsdir/etalon/etalon.txt "${mntpoint}/etalon.txt" if [ $? -eq 0 ]; then - echo "PASS" + echo "ok 1" else - echo "FAIL" + echo "not ok 1" fi - -# -# cleanup -umount "${mntpoint}" -rmdir "${mntpoint}" -mdconfig -d -u ${num} -sleep 1 -kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/Makefile b/sbin/geom/class/tests/uzip/Makefile index ad437c7..b4e1d7d 100644 --- a/sbin/geom/class/tests/uzip/Makefile +++ b/sbin/geom/class/tests/uzip/Makefile @@ -21,6 +21,9 @@ ${UZIMAGE}: ${IMAGE} ${ZIMAGE} printf "FreeBSD$$\n#\n\n" >> ${.TARGET} uuencode ${ZIMAGE} ${ZIMAGE} >>${.TARGET} +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh + FILES+= ${UZIMAGE} FILESDIR= ${TESTSDIR} @@ -28,6 +31,6 @@ FILESGROUPS= FILES etalon etalon+= etalon/etalon.txt etalonDIR= ${TESTSDIR}/etalon -PLAIN_TESTS_SH+= 1_test +TAP_TESTS_SH+= 1_test .include -- cgit v1.1 From da2e89dc44c0dd458438d1f572265d9dc9a8c1ed Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 01:27:51 +0000 Subject: - Implement gstripe_test_cleanup - Use a random name for the gstripe --- sbin/geom/class/tests/stripe/conf.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sbin/geom/class/tests/stripe/conf.sh b/sbin/geom/class/tests/stripe/conf.sh index 22e5864..fd0f41c 100755 --- a/sbin/geom/class/tests/stripe/conf.sh +++ b/sbin/geom/class/tests/stripe/conf.sh @@ -1,8 +1,15 @@ #!/bin/sh # $FreeBSD$ -name="test" +name="$(mktemp -u stripe.XXXXXX)" class="stripe" base=`basename $0` +gstripe_test_cleanup() +{ + [ -c /dev/$class/$name ] && gstripe destroy $name + geom_test_cleanup +} +trap gstripe_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh -- cgit v1.1 From 235502889cefec1fd5c4c972d9a86c0a93ed072a Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 01:29:46 +0000 Subject: - Attach md devices with attach_md - Remove unnecessary mdconfig -d -u and gstripe destroy calls at the end of the scripts --- sbin/geom/class/tests/stripe/1_test.sh | 15 ++++----------- sbin/geom/class/tests/stripe/2_test.sh | 17 ++++++----------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/sbin/geom/class/tests/stripe/1_test.sh b/sbin/geom/class/tests/stripe/1_test.sh index 9b398f0..7923763 100755 --- a/sbin/geom/class/tests/stripe/1_test.sh +++ b/sbin/geom/class/tests/stripe/1_test.sh @@ -5,13 +5,11 @@ echo "1..1" -us=45 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gstripe create -s 16384 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gstripe create -s 16384 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB * 3. @@ -23,8 +21,3 @@ if [ $size -eq 3145728 ]; then else echo "not ok 1" fi - -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` diff --git a/sbin/geom/class/tests/stripe/2_test.sh b/sbin/geom/class/tests/stripe/2_test.sh index 73937f4..9101342 100755 --- a/sbin/geom/class/tests/stripe/2_test.sh +++ b/sbin/geom/class/tests/stripe/2_test.sh @@ -5,18 +5,17 @@ echo "1..1" -us=45 tsize=3 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -gstripe create -s 8192 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gstripe create -s 8192 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait dd if=${src} of=/dev/stripe/${name} bs=1m count=$tsize >/dev/null 2>&1 @@ -28,8 +27,4 @@ else echo "ok 1" fi -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` rm -f ${src} ${dst} -- cgit v1.1 From 6bec2d835922511b32421fa8066a23f324c0cc1b Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 02:24:08 +0000 Subject: conf.sh: - Implement gshsec_test_cleanup - Use a random name for the shsec 1_test.sh/2_test.sh: - Attach md devices with attach_md - Remove unnecessary mdconfig -d -u and gstripe destroy calls at the end of the scripts --- sbin/geom/class/tests/shsec/1_test.sh | 17 ++++------------- sbin/geom/class/tests/shsec/2_test.sh | 25 +++++++++---------------- sbin/geom/class/tests/shsec/conf.sh | 9 ++++++++- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/sbin/geom/class/tests/shsec/1_test.sh b/sbin/geom/class/tests/shsec/1_test.sh index 5cb5b4f..ab0bb37 100755 --- a/sbin/geom/class/tests/shsec/1_test.sh +++ b/sbin/geom/class/tests/shsec/1_test.sh @@ -5,15 +5,11 @@ echo "1..2" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +gshsec label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 devwait # Size of created device should be 1MB - 512B. @@ -30,8 +26,3 @@ if [ $sectorsize -eq 512 ]; then else echo "not ok 2" fi - -gshsec stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 diff --git a/sbin/geom/class/tests/shsec/2_test.sh b/sbin/geom/class/tests/shsec/2_test.sh index 19a4e0a..506b34b 100755 --- a/sbin/geom/class/tests/shsec/2_test.sh +++ b/sbin/geom/class/tests/shsec/2_test.sh @@ -5,21 +5,18 @@ echo "1..4" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` nblocks1=1024 nblocks2=`expr $nblocks1 + 1` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 dd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 -mdconfig -a -t malloc -s $nblocks2 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks2 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks2 -u $us2 || exit 1 +us0=$(attach_md -t malloc -s $nblocks2) || exit 1 +us1=$(attach_md -t malloc -s $nblocks2) || exit 1 +us2=$(attach_md -t malloc -s $nblocks2) || exit 1 -gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gshsec label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait dd if=${src} of=/dev/shsec/${name} count=$nblocks1 >/dev/null 2>&1 @@ -31,29 +28,25 @@ else echo "ok 1" fi -dd if=/dev/md${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -dd if=/dev/md${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 3" else echo "ok 3" fi -dd if=/dev/md${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 4" else echo "ok 4" fi -gshsec stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/shsec/conf.sh b/sbin/geom/class/tests/shsec/conf.sh index 7648862..7800eb7 100755 --- a/sbin/geom/class/tests/shsec/conf.sh +++ b/sbin/geom/class/tests/shsec/conf.sh @@ -1,8 +1,15 @@ #!/bin/sh # $FreeBSD$ -name="test" +name="$(mktemp -u shsec.XXXXXX)" class="shsec" base=`basename $0` +shsec_test_cleanup() +{ + [ -c /dev/$class/$name ] && gshsec stop $name + geom_test_cleanup +} +trap shsec_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh -- cgit v1.1 From c11080c84d6759760b0035a4ddcd1d144346b6ad Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 03:46:49 +0000 Subject: Probe for the first available md unit number instead of hardcoding 45 Detach/mdconfig -d -u at the end of the test consistently --- sbin/geom/class/tests/eli/Makefile | 4 ++++ sbin/geom/class/tests/eli/attach_d_test.sh | 4 ++-- sbin/geom/class/tests/eli/conf.sh | 19 +++++++++++++++++++ sbin/geom/class/tests/eli/configure_b_B_test.sh | 5 ++--- sbin/geom/class/tests/eli/delkey_test.sh | 4 ++-- sbin/geom/class/tests/eli/detach_l_test.sh | 4 ++-- sbin/geom/class/tests/eli/init_B_test.sh | 8 +++----- sbin/geom/class/tests/eli/init_J_test.sh | 4 ++-- sbin/geom/class/tests/eli/init_a_test.sh | 3 ++- sbin/geom/class/tests/eli/init_i_P_test.sh | 4 ++-- sbin/geom/class/tests/eli/init_test.sh | 3 ++- sbin/geom/class/tests/eli/integrity_copy_test.sh | 3 ++- sbin/geom/class/tests/eli/integrity_data_test.sh | 3 ++- sbin/geom/class/tests/eli/integrity_hmac_test.sh | 3 ++- sbin/geom/class/tests/eli/kill_test.sh | 4 ++-- sbin/geom/class/tests/eli/nokey_test.sh | 4 ++-- sbin/geom/class/tests/eli/onetime_a_test.sh | 3 ++- sbin/geom/class/tests/eli/onetime_d_test.sh | 3 ++- sbin/geom/class/tests/eli/onetime_test.sh | 3 ++- sbin/geom/class/tests/eli/readonly_test.sh | 3 ++- sbin/geom/class/tests/eli/resize_test.sh | 8 +++----- sbin/geom/class/tests/eli/setkey_test.sh | 4 ++-- 22 files changed, 65 insertions(+), 38 deletions(-) create mode 100755 sbin/geom/class/tests/eli/conf.sh diff --git a/sbin/geom/class/tests/eli/Makefile b/sbin/geom/class/tests/eli/Makefile index 721774a..1846ed6 100644 --- a/sbin/geom/class/tests/eli/Makefile +++ b/sbin/geom/class/tests/eli/Makefile @@ -29,4 +29,8 @@ TEST_METADATA.integrity_hmac_test+= timeout="600" TEST_METADATA.onetime_a_test+= timeout="600" TEST_METADATA.onetime_test+= timeout="600" +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + .include diff --git a/sbin/geom/class/tests/eli/attach_d_test.sh b/sbin/geom/class/tests/eli/attach_d_test.sh index d1a57ce..5d700b3 100755 --- a/sbin/geom/class/tests/eli/attach_d_test.sh +++ b/sbin/geom/class/tests/eli/attach_d_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 @@ -34,5 +35,4 @@ else echo "not ok 3" fi -mdconfig -d -u $no rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/conf.sh b/sbin/geom/class/tests/eli/conf.sh new file mode 100755 index 0000000..080fa61 --- /dev/null +++ b/sbin/geom/class/tests/eli/conf.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# $FreeBSD$ + +class="eli" +base=`basename $0` + +no=0 +while [ -c /dev/md$no ]; do + : $(( no += 1 )) +done + +geli_test_cleanup() +{ + [ -c /dev/md${no}.eli ] && geli detach md${no}.eli + mdconfig -d -u $no +} +trap geli_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/eli/configure_b_B_test.sh b/sbin/geom/class/tests/eli/configure_b_B_test.sh index 23aa412..b6cdf4f 100755 --- a/sbin/geom/class/tests/eli/configure_b_B_test.sh +++ b/sbin/geom/class/tests/eli/configure_b_B_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 @@ -126,5 +127,3 @@ if [ $? -eq 0 ]; then else echo "not ok 17" fi - -mdconfig -d -u $no diff --git a/sbin/geom/class/tests/eli/delkey_test.sh b/sbin/geom/class/tests/eli/delkey_test.sh index ec839e6..67b253e 100755 --- a/sbin/geom/class/tests/eli/delkey_test.sh +++ b/sbin/geom/class/tests/eli/delkey_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile1=`mktemp $base.XXXXXX` || exit 1 keyfile2=`mktemp $base.XXXXXX` || exit 1 @@ -136,5 +137,4 @@ else echo "not ok 14" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 diff --git a/sbin/geom/class/tests/eli/detach_l_test.sh b/sbin/geom/class/tests/eli/detach_l_test.sh index 6645501..605ae94 100755 --- a/sbin/geom/class/tests/eli/detach_l_test.sh +++ b/sbin/geom/class/tests/eli/detach_l_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 @@ -40,5 +41,4 @@ else echo "not ok 4" fi -mdconfig -d -u $no rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_B_test.sh b/sbin/geom/class/tests/eli/init_B_test.sh index 70036af..3ba743c 100755 --- a/sbin/geom/class/tests/eli/init_B_test.sh +++ b/sbin/geom/class/tests/eli/init_B_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 backupfile=`mktemp $base.XXXXXX` || exit 1 @@ -99,8 +100,5 @@ if [ -c /dev/md${no}.eli ]; then else echo "not ok 13 - -B file" fi -geli detach md${no} -rm -f $backupfile -mdconfig -d -u $no -rm -f $keyfile +rm -f $backupfile $keyfile diff --git a/sbin/geom/class/tests/eli/init_J_test.sh b/sbin/geom/class/tests/eli/init_J_test.sh index 3408637..266a3d5 100755 --- a/sbin/geom/class/tests/eli/init_J_test.sh +++ b/sbin/geom/class/tests/eli/init_J_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile0=`mktemp $base.XXXXXX` || exit 1 keyfile1=`mktemp $base.XXXXXX` || exit 1 @@ -122,5 +123,4 @@ for iter in -1 0 64; do echo "ok ${i}"; i=$((i+1)) done -mdconfig -d -u $no rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} diff --git a/sbin/geom/class/tests/eli/init_a_test.sh b/sbin/geom/class/tests/eli/init_a_test.sh index e1f1b3f..dbb24fe 100755 --- a/sbin/geom/class/tests/eli/init_a_test.sh +++ b/sbin/geom/class/tests/eli/init_a_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 diff --git a/sbin/geom/class/tests/eli/init_i_P_test.sh b/sbin/geom/class/tests/eli/init_i_P_test.sh index df0d138..1c59a97 100755 --- a/sbin/geom/class/tests/eli/init_i_P_test.sh +++ b/sbin/geom/class/tests/eli/init_i_P_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 @@ -18,5 +19,4 @@ else echo "not ok 1" fi -mdconfig -d -u $no rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_test.sh b/sbin/geom/class/tests/eli/init_test.sh index c5765d0..71dd6e2 100755 --- a/sbin/geom/class/tests/eli/init_test.sh +++ b/sbin/geom/class/tests/eli/init_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 diff --git a/sbin/geom/class/tests/eli/integrity_copy_test.sh b/sbin/geom/class/tests/eli/integrity_copy_test.sh index 742fb21..4c8efd3 100755 --- a/sbin/geom/class/tests/eli/integrity_copy_test.sh +++ b/sbin/geom/class/tests/eli/integrity_copy_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 diff --git a/sbin/geom/class/tests/eli/integrity_data_test.sh b/sbin/geom/class/tests/eli/integrity_data_test.sh index e02950b..7ea7c96b 100755 --- a/sbin/geom/class/tests/eli/integrity_data_test.sh +++ b/sbin/geom/class/tests/eli/integrity_data_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 diff --git a/sbin/geom/class/tests/eli/integrity_hmac_test.sh b/sbin/geom/class/tests/eli/integrity_hmac_test.sh index 3cb4f8a..243eac9 100755 --- a/sbin/geom/class/tests/eli/integrity_hmac_test.sh +++ b/sbin/geom/class/tests/eli/integrity_hmac_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 diff --git a/sbin/geom/class/tests/eli/kill_test.sh b/sbin/geom/class/tests/eli/kill_test.sh index 513e853..ccced9f 100755 --- a/sbin/geom/class/tests/eli/kill_test.sh +++ b/sbin/geom/class/tests/eli/kill_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile1=`mktemp $base.XXXXXX` || exit 1 keyfile2=`mktemp $base.XXXXXX` || exit 1 @@ -93,5 +94,4 @@ else echo "not ok 9" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 diff --git a/sbin/geom/class/tests/eli/nokey_test.sh b/sbin/geom/class/tests/eli/nokey_test.sh index f29150b..f32e1a4 100755 --- a/sbin/geom/class/tests/eli/nokey_test.sh +++ b/sbin/geom/class/tests/eli/nokey_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 @@ -61,5 +62,4 @@ else echo "not ok 8" fi -mdconfig -d -u $no rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/onetime_a_test.sh b/sbin/geom/class/tests/eli/onetime_a_test.sh index 0fb3e5e..4e26dfb 100755 --- a/sbin/geom/class/tests/eli/onetime_a_test.sh +++ b/sbin/geom/class/tests/eli/onetime_a_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 echo "1..1380" diff --git a/sbin/geom/class/tests/eli/onetime_d_test.sh b/sbin/geom/class/tests/eli/onetime_d_test.sh index d49cb64..51a6abb 100755 --- a/sbin/geom/class/tests/eli/onetime_d_test.sh +++ b/sbin/geom/class/tests/eli/onetime_d_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 mdconfig -a -t malloc -s $sectors -u $no || exit 1 diff --git a/sbin/geom/class/tests/eli/onetime_test.sh b/sbin/geom/class/tests/eli/onetime_test.sh index 267fc27..17061d0 100755 --- a/sbin/geom/class/tests/eli/onetime_test.sh +++ b/sbin/geom/class/tests/eli/onetime_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 echo "1..460" diff --git a/sbin/geom/class/tests/eli/readonly_test.sh b/sbin/geom/class/tests/eli/readonly_test.sh index 74396b5..721ad62 100755 --- a/sbin/geom/class/tests/eli/readonly_test.sh +++ b/sbin/geom/class/tests/eli/readonly_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 diff --git a/sbin/geom/class/tests/eli/resize_test.sh b/sbin/geom/class/tests/eli/resize_test.sh index 86ee364..67d6291 100755 --- a/sbin/geom/class/tests/eli/resize_test.sh +++ b/sbin/geom/class/tests/eli/resize_test.sh @@ -1,7 +1,8 @@ -#! /bin/sh -# +#!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + echo 1..27 BLK=512 @@ -22,8 +23,6 @@ setsize() { # Initialise -kldload geom_eli >/dev/null 2>&1 - setsize 10 40 || echo -n "not " echo ok $i - "Sized ${md}a to 10m" i=$((i + 1)) @@ -145,6 +144,5 @@ echo ok $i - "Attached ${md}p1.eli" i=$((i + 1)) geli detach ${md}p1.eli -mdconfig -du$unit rm tmp.* diff --git a/sbin/geom/class/tests/eli/setkey_test.sh b/sbin/geom/class/tests/eli/setkey_test.sh index f2ebe77..458100c 100755 --- a/sbin/geom/class/tests/eli/setkey_test.sh +++ b/sbin/geom/class/tests/eli/setkey_test.sh @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 rnd=`mktemp $base.XXXXXX` || exit 1 keyfile1=`mktemp $base.XXXXXX` || exit 1 @@ -152,5 +153,4 @@ else echo "not ok 16" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 $keyfile5 -- cgit v1.1 From 2a21ca898bc762a485efb3b613009eb2a5f158f8 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 03:53:14 +0000 Subject: conf.sh: - Implement gnop_test_cleanup - Use a random name for the shsec 1_test.sh/2_test.sh: - Attach md devices with attach_md - Remove unnecessary mdconfig -d -u and gstripe destroy calls at the end of the scripts --- sbin/geom/class/tests/nop/1_test.sh | 11 +++-------- sbin/geom/class/tests/nop/2_test.sh | 15 ++++++--------- sbin/geom/class/tests/nop/conf.sh | 7 +++++++ 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/sbin/geom/class/tests/nop/1_test.sh b/sbin/geom/class/tests/nop/1_test.sh index f08f71d..4d6b65d 100755 --- a/sbin/geom/class/tests/nop/1_test.sh +++ b/sbin/geom/class/tests/nop/1_test.sh @@ -5,21 +5,16 @@ echo "1..1" -us=45 +us=$(attach_md -t malloc -s 1M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 - -gnop create /dev/md${us} || exit 1 +gnop create /dev/${us} || exit 1 # Size of created device should be 1MB. -size=`diskinfo /dev/md${us}.nop | awk '{print $3}'` +size=`diskinfo /dev/${us}.nop | awk '{print $3}'` if [ $size -eq 1048576 ]; then echo "ok 1" else echo "not ok 1" fi - -gnop destroy md${us}.nop -mdconfig -d -u $us diff --git a/sbin/geom/class/tests/nop/2_test.sh b/sbin/geom/class/tests/nop/2_test.sh index e0ddb17..7422345 100755 --- a/sbin/geom/class/tests/nop/2_test.sh +++ b/sbin/geom/class/tests/nop/2_test.sh @@ -3,20 +3,19 @@ . `dirname $0`/conf.sh -us=45 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 echo "1..1" dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 +us=$(attach_md -t malloc -s 1M) || exit 1 -gnop create /dev/md${us} || exit 1 +gnop create /dev/${us} || exit 1 -dd if=${src} of=/dev/md${us}.nop bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/md${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 +dd if=${src} of=/dev/${us}.nop bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 1" @@ -24,6 +23,4 @@ else echo "ok 1" fi -gnop destroy md${us}.nop -mdconfig -d -u $us rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/nop/conf.sh b/sbin/geom/class/tests/nop/conf.sh index 0dc9797..e38e10c 100755 --- a/sbin/geom/class/tests/nop/conf.sh +++ b/sbin/geom/class/tests/nop/conf.sh @@ -4,4 +4,11 @@ class="nop" base=`basename $0` +gnop_test_cleanup() +{ + [ -c /dev/${us}.nop ] && gnop destroy ${us}.nop + geom_test_cleanup +} +trap gnop_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh -- cgit v1.1 From 731c5014d4b12c3b2f16960ed3894a19cdfe138a Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 03:57:58 +0000 Subject: conf.sh: - Implement gconcat_test_cleanup - Use a random name for the shsec 1_test.sh/2_test.sh: - Attach md devices with attach_md - Remove unnecessary mdconfig -d -u and gconcat destroy calls at the end of the scripts --- sbin/geom/class/tests/concat/1_test.sh | 15 ++++----------- sbin/geom/class/tests/concat/2_test.sh | 19 +++++++------------ sbin/geom/class/tests/concat/conf.sh | 9 ++++++++- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/sbin/geom/class/tests/concat/1_test.sh b/sbin/geom/class/tests/concat/1_test.sh index 8984f79..ef80a61 100755 --- a/sbin/geom/class/tests/concat/1_test.sh +++ b/sbin/geom/class/tests/concat/1_test.sh @@ -5,13 +5,11 @@ echo '1..1' -us=45 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB + 2MB + 3MB. @@ -23,8 +21,3 @@ if [ $size -eq 6291456 ]; then else echo "not ok - Size is 6291456" fi - -gconcat destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` diff --git a/sbin/geom/class/tests/concat/2_test.sh b/sbin/geom/class/tests/concat/2_test.sh index 445d9bc..95636be 100755 --- a/sbin/geom/class/tests/concat/2_test.sh +++ b/sbin/geom/class/tests/concat/2_test.sh @@ -5,18 +5,17 @@ echo '1..1' -us=45 tsize=6 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 +dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 -gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1 @@ -28,8 +27,4 @@ else echo "ok - md5 checksum comparison" fi -gconcat destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/concat/conf.sh b/sbin/geom/class/tests/concat/conf.sh index 0eaf1ba..374ed12 100755 --- a/sbin/geom/class/tests/concat/conf.sh +++ b/sbin/geom/class/tests/concat/conf.sh @@ -1,8 +1,15 @@ #!/bin/sh # $FreeBSD$ -name="test" +name="$(mktemp -u concat.XXXXXX)" class="concat" base=`basename $0` +gconcat_test_cleanup() +{ + [ -c /dev/$class/$name ] && gconcat destroy $name + geom_test_cleanup +} +trap gconcat_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh -- cgit v1.1 From fb5a1b53bfb010ce0261eaebcd040786cee4b15a Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 04:01:13 +0000 Subject: Probe for the first available ggate(4) device --- sbin/geom/class/tests/gate/1_test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/geom/class/tests/gate/1_test.sh b/sbin/geom/class/tests/gate/1_test.sh index 5689044..fb6fd62 100755 --- a/sbin/geom/class/tests/gate/1_test.sh +++ b/sbin/geom/class/tests/gate/1_test.sh @@ -4,7 +4,10 @@ . `dirname $0`/conf.sh base=`basename $0` -us=45 +us=0 +while [ -c /dev/ggate${us} ]; do + : $(( us += 1 )) +done conf=`mktemp $base.XXXXXX` || exit 1 pidfile=ggated.pid port=33080 -- cgit v1.1 From 55e96df06b559a7623d59acb4f8d3bea4bf2d6ef Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 04:07:31 +0000 Subject: Remove braces around us0, us1, and us2 in gmirror label operation --- sbin/geom/class/tests/mirror/1_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/geom/class/tests/mirror/1_test.sh b/sbin/geom/class/tests/mirror/1_test.sh index e115b29..af82a14 100755 --- a/sbin/geom/class/tests/mirror/1_test.sh +++ b/sbin/geom/class/tests/mirror/1_test.sh @@ -9,7 +9,7 @@ us0=$(attach_md -t malloc -s 1M) || exit 1 us1=$(attach_md -t malloc -s 2M) || exit 1 us2=$(attach_md -t malloc -s 3M) || exit 1 -gmirror label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +gmirror label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB - 512b. -- cgit v1.1 From d26d2b7e92852446e448fcf2bef7aebd2c36c8c0 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 04:10:03 +0000 Subject: Remove all explicit references to $TMPDIR --- sbin/geom/class/tests/raid3/10_test.sh | 4 ++-- sbin/geom/class/tests/raid3/11_test.sh | 4 ++-- sbin/geom/class/tests/raid3/2_test.sh | 4 ++-- sbin/geom/class/tests/raid3/3_test.sh | 4 ++-- sbin/geom/class/tests/raid3/4_test.sh | 4 ++-- sbin/geom/class/tests/raid3/5_test.sh | 4 ++-- sbin/geom/class/tests/raid3/6_test.sh | 4 ++-- sbin/geom/class/tests/raid3/7_test.sh | 4 ++-- sbin/geom/class/tests/raid3/8_test.sh | 4 ++-- sbin/geom/class/tests/raid3/9_test.sh | 4 ++-- sbin/geom/class/tests/shsec/2_test.sh | 4 ++-- sbin/geom/class/tests/stripe/2_test.sh | 4 ++-- sbin/geom/class/tests/uzip/conf.sh | 2 +- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sbin/geom/class/tests/raid3/10_test.sh b/sbin/geom/class/tests/raid3/10_test.sh index 73adbfe..edd827d 100755 --- a/sbin/geom/class/tests/raid3/10_test.sh +++ b/sbin/geom/class/tests/raid3/10_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/11_test.sh b/sbin/geom/class/tests/raid3/11_test.sh index 748fdb9..0407261 100755 --- a/sbin/geom/class/tests/raid3/11_test.sh +++ b/sbin/geom/class/tests/raid3/11_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/2_test.sh b/sbin/geom/class/tests/raid3/2_test.sh index 83fe4dc..22ebd38 100755 --- a/sbin/geom/class/tests/raid3/2_test.sh +++ b/sbin/geom/class/tests/raid3/2_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/3_test.sh b/sbin/geom/class/tests/raid3/3_test.sh index 0b00357..f068b06 100755 --- a/sbin/geom/class/tests/raid3/3_test.sh +++ b/sbin/geom/class/tests/raid3/3_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/4_test.sh b/sbin/geom/class/tests/raid3/4_test.sh index f45a9b8..810f13d 100755 --- a/sbin/geom/class/tests/raid3/4_test.sh +++ b/sbin/geom/class/tests/raid3/4_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/5_test.sh b/sbin/geom/class/tests/raid3/5_test.sh index cfe904f..7bc8d42 100755 --- a/sbin/geom/class/tests/raid3/5_test.sh +++ b/sbin/geom/class/tests/raid3/5_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/6_test.sh b/sbin/geom/class/tests/raid3/6_test.sh index d9d6b97..20bf192 100755 --- a/sbin/geom/class/tests/raid3/6_test.sh +++ b/sbin/geom/class/tests/raid3/6_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/7_test.sh b/sbin/geom/class/tests/raid3/7_test.sh index 189b900..23666f8 100755 --- a/sbin/geom/class/tests/raid3/7_test.sh +++ b/sbin/geom/class/tests/raid3/7_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/8_test.sh b/sbin/geom/class/tests/raid3/8_test.sh index c0717c8..2eb9b1a 100755 --- a/sbin/geom/class/tests/raid3/8_test.sh +++ b/sbin/geom/class/tests/raid3/8_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/raid3/9_test.sh b/sbin/geom/class/tests/raid3/9_test.sh index 866c5d7..0ef010a 100755 --- a/sbin/geom/class/tests/raid3/9_test.sh +++ b/sbin/geom/class/tests/raid3/9_test.sh @@ -8,8 +8,8 @@ echo "1..1" ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 diff --git a/sbin/geom/class/tests/shsec/2_test.sh b/sbin/geom/class/tests/shsec/2_test.sh index 506b34b..9dfe36a 100755 --- a/sbin/geom/class/tests/shsec/2_test.sh +++ b/sbin/geom/class/tests/shsec/2_test.sh @@ -7,8 +7,8 @@ echo "1..4" nblocks1=1024 nblocks2=`expr $nblocks1 + 1` -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 diff --git a/sbin/geom/class/tests/stripe/2_test.sh b/sbin/geom/class/tests/stripe/2_test.sh index 9101342..f6e11f5 100755 --- a/sbin/geom/class/tests/stripe/2_test.sh +++ b/sbin/geom/class/tests/stripe/2_test.sh @@ -6,8 +6,8 @@ echo "1..1" tsize=3 -src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 diff --git a/sbin/geom/class/tests/uzip/conf.sh b/sbin/geom/class/tests/uzip/conf.sh index a0204d6..5494d09 100755 --- a/sbin/geom/class/tests/uzip/conf.sh +++ b/sbin/geom/class/tests/uzip/conf.sh @@ -3,7 +3,7 @@ class="uzip" base=`basename $0` -mntpoint=$(mktemp -d $TMPDIR/tmp.XXXXXX) || exit +mntpoint=$(mktemp -d tmp.XXXXXX) || exit uzip_test_cleanup() { -- cgit v1.1 From aba5cf983873d1f14954788a43526c3eee770759 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 04:11:25 +0000 Subject: Move the mntpoint definition down so the mktemp call get get a temporary directory under $TMPDIR instead of the current directory --- sbin/geom/class/tests/uzip/conf.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/geom/class/tests/uzip/conf.sh b/sbin/geom/class/tests/uzip/conf.sh index 5494d09..8a3b459 100755 --- a/sbin/geom/class/tests/uzip/conf.sh +++ b/sbin/geom/class/tests/uzip/conf.sh @@ -3,7 +3,6 @@ class="uzip" base=`basename $0` -mntpoint=$(mktemp -d tmp.XXXXXX) || exit uzip_test_cleanup() { @@ -14,3 +13,6 @@ uzip_test_cleanup() trap uzip_test_cleanup ABRT EXIT INT TERM . `dirname $0`/../geom_subr.sh + +# NOTE: make sure $TMPDIR has been set by geom_subr.sh if unset [by kyua, etc] +mntpoint=$(mktemp -d tmp.XXXXXX) || exit -- cgit v1.1 From 733f91b6ac124f0ab1a8375d9eaa6d7610567443 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 04:12:08 +0000 Subject: Make sure TMPDIR is exported so /tmp is guaranteed to be defined for mktemp --- sbin/geom/class/tests/geom_subr.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/geom/class/tests/geom_subr.sh b/sbin/geom/class/tests/geom_subr.sh index a26dd15..a039377 100644 --- a/sbin/geom/class/tests/geom_subr.sh +++ b/sbin/geom/class/tests/geom_subr.sh @@ -22,6 +22,7 @@ devwait() # failing will cause the other tests to bomb out, or a test failing will leave # a large number of md(4) devices lingering around : ${TMPDIR=/tmp} +export TMPDIR TEST_MDS_FILE=${TMPDIR}/test_mds attach_md() -- cgit v1.1 From a39f4bcb9e0fc06e366a19fee8362bde053774c1 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 25 Nov 2015 04:13:28 +0000 Subject: Hook sbin/geom/class/tests in to the build --- sbin/geom/class/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/geom/class/Makefile b/sbin/geom/class/Makefile index a7ed1b9..8ea22ff 100644 --- a/sbin/geom/class/Makefile +++ b/sbin/geom/class/Makefile @@ -21,4 +21,8 @@ SUBDIR+=shsec SUBDIR+=stripe SUBDIR+=virstor +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include -- cgit v1.1 From 0d0395b6fdd049d6a6eb596d44a66fe1b22e1b06 Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 26 Nov 2015 06:56:15 +0000 Subject: Skip over lines that start with comments --- tools/regression/lib/libc/resolv/resolv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/regression/lib/libc/resolv/resolv.c b/tools/regression/lib/libc/resolv/resolv.c index d481ecf..9392872 100644 --- a/tools/regression/lib/libc/resolv/resolv.c +++ b/tools/regression/lib/libc/resolv/resolv.c @@ -87,6 +87,8 @@ load(const char *fname) if ((fp = fopen(fname, "r")) == NULL) err(1, "Cannot open `%s'", fname); while ((line = fgetln(fp, &len)) != NULL) { + if (line[0] == '#') + continue; char c = line[len]; char *ptr; line[len] = '\0'; -- cgit v1.1 From 59c723022b468ba836263eb2a5712cea28a70e53 Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 26 Nov 2015 06:57:10 +0000 Subject: - Remove cnftp.bjpu.edu.cn (it no longer resolves) - Add localhost to resolv/mach for parity with nss/mach --- tools/regression/lib/libc/nss/mach | 1 - tools/regression/lib/libc/resolv/mach | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/regression/lib/libc/nss/mach b/tools/regression/lib/libc/nss/mach index d25d8d6..ab7ce24 100644 --- a/tools/regression/lib/libc/nss/mach +++ b/tools/regression/lib/libc/nss/mach @@ -11,7 +11,6 @@ antioche.antioche.eu.org boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no -cnftp.bjpu.edu.cn console.netbsd.org cvs.fi.netbsd.org cvs.mikrolahti.fi diff --git a/tools/regression/lib/libc/resolv/mach b/tools/regression/lib/libc/resolv/mach index f3c3981..ab7ce24 100644 --- a/tools/regression/lib/libc/resolv/mach +++ b/tools/regression/lib/libc/resolv/mach @@ -1,3 +1,5 @@ +# $FreeBSD$ +localhost above.warped.net anoncvs.cirr.com anoncvs.isc.netbsd.org @@ -9,7 +11,6 @@ antioche.antioche.eu.org boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no -cnftp.bjpu.edu.cn console.netbsd.org cvs.fi.netbsd.org cvs.mikrolahti.fi -- cgit v1.1 From 6645852f9b29830203c009f70970b616db89800a Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 26 Nov 2015 07:06:20 +0000 Subject: MFhead @ r291359 --- contrib/wpa/src/drivers/driver_bsd.c | 2 + gnu/usr.bin/cc/cc1/Makefile | 2 +- gnu/usr.bin/cc/cc1plus/Makefile | 2 +- lib/Makefile | 6 +- lib/libwrap/Makefile | 2 +- libexec/hyperv/Makefile | 3 +- libexec/rtld-elf/Makefile | 2 +- libexec/tcpd/Makefile | 2 +- sbin/ifconfig/ifieee80211.c | 2 + share/dtrace/Makefile | 2 - share/examples/Makefile | 2 - share/examples/smbfs/Makefile | 1 - share/examples/smbfs/print/Makefile | 1 - share/keys/pkg/trusted/Makefile | 2 - share/mk/Makefile | 1 - share/mk/bsd.obj.mk | 3 + share/mk/local.dirdeps.mk | 2 +- share/mk/netbsd-tests.test.mk | 2 - share/mk/src.libnames.mk | 156 ++++++++++++------------ share/security/Makefile | 1 - share/vt/keymaps/Makefile | 2 - sys/net80211/ieee80211_ioctl.c | 3 + usr.bin/makewhatis/Makefile | 2 +- usr.bin/vgrind/Makefile | 2 +- usr.bin/xlint/lint1/Makefile | 2 +- usr.bin/xlint/lint2/Makefile | 2 +- usr.sbin/bsdconfig/console/Makefile | 2 - usr.sbin/bsdconfig/console/include/Makefile | 2 - usr.sbin/bsdconfig/diskmgmt/Makefile | 2 - usr.sbin/bsdconfig/diskmgmt/include/Makefile | 2 - usr.sbin/bsdconfig/docsinstall/Makefile | 2 - usr.sbin/bsdconfig/docsinstall/include/Makefile | 2 - usr.sbin/bsdconfig/dot/Makefile | 2 - usr.sbin/bsdconfig/dot/include/Makefile | 2 - usr.sbin/bsdconfig/examples/Makefile | 2 - usr.sbin/bsdconfig/include/Makefile | 2 - usr.sbin/bsdconfig/includes/Makefile | 2 - usr.sbin/bsdconfig/includes/include/Makefile | 2 - usr.sbin/bsdconfig/mouse/Makefile | 2 - usr.sbin/bsdconfig/mouse/include/Makefile | 2 - usr.sbin/bsdconfig/networking/Makefile | 2 - usr.sbin/bsdconfig/networking/include/Makefile | 2 - usr.sbin/bsdconfig/networking/share/Makefile | 2 - usr.sbin/bsdconfig/packages/Makefile | 2 - usr.sbin/bsdconfig/packages/include/Makefile | 2 - usr.sbin/bsdconfig/password/Makefile | 2 - usr.sbin/bsdconfig/password/include/Makefile | 2 - usr.sbin/bsdconfig/password/share/Makefile | 2 - usr.sbin/bsdconfig/security/Makefile | 2 - usr.sbin/bsdconfig/security/include/Makefile | 2 - usr.sbin/bsdconfig/share/Makefile | 2 - usr.sbin/bsdconfig/share/media/Makefile | 2 - usr.sbin/bsdconfig/share/packages/Makefile | 2 - usr.sbin/bsdconfig/startup/Makefile | 2 - usr.sbin/bsdconfig/startup/include/Makefile | 2 - usr.sbin/bsdconfig/startup/share/Makefile | 2 - usr.sbin/bsdconfig/timezone/Makefile | 2 - usr.sbin/bsdconfig/timezone/include/Makefile | 2 - usr.sbin/bsdconfig/timezone/share/Makefile | 2 - usr.sbin/bsdconfig/ttys/Makefile | 2 - usr.sbin/bsdconfig/ttys/include/Makefile | 2 - usr.sbin/bsdconfig/usermgmt/Makefile | 2 - usr.sbin/bsdconfig/usermgmt/include/Makefile | 2 - usr.sbin/bsdconfig/usermgmt/share/Makefile | 2 - usr.sbin/bsdinstall/distextract/Makefile | 2 +- usr.sbin/bsdinstall/distfetch/Makefile | 2 +- usr.sbin/bsdinstall/partedit/Makefile | 2 +- usr.sbin/bsdinstall/scripts/Makefile | 2 +- usr.sbin/lpr/filters/Makefile | 2 +- usr.sbin/rpc.yppasswdd/Makefile | 2 +- usr.sbin/sendmail/Makefile | 2 +- usr.sbin/tcpdchk/Makefile | 2 +- usr.sbin/tcpdmatch/Makefile | 2 +- 73 files changed, 106 insertions(+), 197 deletions(-) diff --git a/contrib/wpa/src/drivers/driver_bsd.c b/contrib/wpa/src/drivers/driver_bsd.c index b57dd03..9d3b5e6 100644 --- a/contrib/wpa/src/drivers/driver_bsd.c +++ b/contrib/wpa/src/drivers/driver_bsd.c @@ -1497,6 +1497,8 @@ get80211opmode(struct bsd_driver_data *drv) } if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP) return IEEE80211_M_HOSTAP; + if (ifmr.ifm_current & IFM_IEEE80211_IBSS) + return IEEE80211_M_IBSS; if (ifmr.ifm_current & IFM_IEEE80211_MONITOR) return IEEE80211_M_MONITOR; #ifdef IEEE80211_M_MBSS diff --git a/gnu/usr.bin/cc/cc1/Makefile b/gnu/usr.bin/cc/cc1/Makefile index 368517c..b306bfec2 100644 --- a/gnu/usr.bin/cc/cc1/Makefile +++ b/gnu/usr.bin/cc/cc1/Makefile @@ -9,7 +9,7 @@ MAN= PROG= cc1 SRCS= main.c c-parser.c c-lang.c -BINDIR= /usr/libexec +BINDIR= ${LIBEXECDIR} .if ${MK_SHARED_TOOLCHAIN} == "no" NO_SHARED?=yes .endif diff --git a/gnu/usr.bin/cc/cc1plus/Makefile b/gnu/usr.bin/cc/cc1plus/Makefile index 5d5a64d..761dd69 100644 --- a/gnu/usr.bin/cc/cc1plus/Makefile +++ b/gnu/usr.bin/cc/cc1plus/Makefile @@ -15,7 +15,7 @@ SRCS+= main.c cp-lang.c c-opts.c call.c class.c cvt.c cxx-pretty-print.c \ search.c semantics.c tree.c typeck.c typeck2.c optimize.c \ cp-objcp-common.c cp-gimplify.c tree-mudflap.c -BINDIR= /usr/libexec +BINDIR= ${LIBEXECDIR} .if ${MK_SHARED_TOOLCHAIN} == "no" NO_SHARED?=yes .endif diff --git a/lib/Makefile b/lib/Makefile index 38003b8..4277d4e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -48,7 +48,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libdwarf \ libedit \ ${_libelftc} \ - ${_libevent} \ + libevent \ libexecinfo \ libexpat \ libfetch \ @@ -240,10 +240,6 @@ _libnetgraph= libnetgraph _libypclnt= libypclnt .endif -.if ${MK_PF} != "no" -_libevent= libevent -.endif - .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _libsmb= libsmb _libvgl= libvgl diff --git a/lib/libwrap/Makefile b/lib/libwrap/Makefile index 7c2ca9a..0acb0c4 100644 --- a/lib/libwrap/Makefile +++ b/lib/libwrap/Makefile @@ -17,7 +17,7 @@ MLINKS= hosts_access.3 hosts_ctl.3 \ .PATH: ${.CURDIR}/../../contrib/tcp_wrappers CFLAGS+=-DFACILITY=LOG_AUTH -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 \ - -DREAL_DAEMON_DIR=\"/usr/libexec\" -DPROCESS_OPTIONS \ + -DREAL_DAEMON_DIR=\"${LIBEXECDIR}\" -DPROCESS_OPTIONS \ -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 \ -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" \ -DSYS_ERRLIST_DEFINED -DALWAYS_HOSTNAME -DUSE_STRSEP -DPROCESS_OPTIONS diff --git a/libexec/hyperv/Makefile b/libexec/hyperv/Makefile index 37abdf5..a841477 100644 --- a/libexec/hyperv/Makefile +++ b/libexec/hyperv/Makefile @@ -2,9 +2,8 @@ .PATH: ${.CURDIR}/../../contrib/hyperv/tools/scripts -BINDIR= /usr/libexec/hyperv +BINDIR= ${LIBEXECDIR}/hyperv SCRIPTS= hv_set_ifconfig hv_get_dns_info hv_get_dhcp_info -NO_OBJ= .include diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 8758c8d..5667299 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -32,7 +32,7 @@ WARNS?= 2 INSTALLFLAGS= -C -b PRECIOUSPROG= BINDIR= /libexec -SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG} +SYMLINKS= ${BINDIR}/${PROG} ${LIBEXECDIR}/${PROG} MLINKS= rtld.1 ld-elf.so.1.1 \ rtld.1 ld.so.1 diff --git a/libexec/tcpd/Makefile b/libexec/tcpd/Makefile index 03e8c52..45add0b 100644 --- a/libexec/tcpd/Makefile +++ b/libexec/tcpd/Makefile @@ -7,7 +7,7 @@ PROG= tcpd MAN= tcpd.8 CSTD?= c89 -CFLAGS+=-DREAL_DAEMON_DIR=\"/usr/libexec\" \ +CFLAGS+=-DREAL_DAEMON_DIR=\"${LIBEXECDIR}\" \ -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 \ -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" \ -DFACILITY=LOG_DAEMON diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 69ffe69..628eb190 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -4085,6 +4085,8 @@ get80211opmode(int s) } if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP) return IEEE80211_M_HOSTAP; + if (ifmr.ifm_current & IFM_IEEE80211_IBSS) + return IEEE80211_M_IBSS; if (ifmr.ifm_current & IFM_IEEE80211_MONITOR) return IEEE80211_M_MONITOR; if (ifmr.ifm_current & IFM_IEEE80211_MBSS) diff --git a/share/dtrace/Makefile b/share/dtrace/Makefile index c0c3f5e..a4bb4e6 100644 --- a/share/dtrace/Makefile +++ b/share/dtrace/Makefile @@ -26,6 +26,4 @@ SCRIPTS= blocking \ SCRIPTSDIR= ${SHAREDIR}/dtrace -NO_OBJ= - .include diff --git a/share/examples/Makefile b/share/examples/Makefile index 63ad5b3..2484aff 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -187,8 +187,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ BINDIR= ${SHAREDIR}/examples -NO_OBJ= - .if ${MK_HAST} != "no" LDIRS+= hast XFILES+= hast/ucarp.sh \ diff --git a/share/examples/smbfs/Makefile b/share/examples/smbfs/Makefile index 3867b80..1bb1359 100644 --- a/share/examples/smbfs/Makefile +++ b/share/examples/smbfs/Makefile @@ -1,6 +1,5 @@ # $FreeBSD$ -NO_OBJ= FILESDIR= ${SHAREDIR}/examples/smbfs FILES= dot.nsmbrc diff --git a/share/examples/smbfs/print/Makefile b/share/examples/smbfs/print/Makefile index 67f4823..129cffa 100644 --- a/share/examples/smbfs/print/Makefile +++ b/share/examples/smbfs/print/Makefile @@ -1,6 +1,5 @@ # $FreeBSD$ -NO_OBJ= FILESDIR= ${SHAREDIR}/examples/smbfs/print FILES= lj6l ljspool printcap.sample tolj diff --git a/share/keys/pkg/trusted/Makefile b/share/keys/pkg/trusted/Makefile index bc8d13a..e55977c 100644 --- a/share/keys/pkg/trusted/Makefile +++ b/share/keys/pkg/trusted/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILES= pkg.freebsd.org.2013102301 FILESDIR= ${SHAREDIR}/keys/pkg/trusted diff --git a/share/mk/Makefile b/share/mk/Makefile index a3560b9..b088b91 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -58,7 +58,6 @@ FILES= \ sys.dependfile.mk \ version_gen.awk -NO_OBJ= FILESDIR= ${BINDIR}/mk .if ${MK_TESTS} != "no" diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk index f94181a..4333a82 100644 --- a/share/mk/bsd.obj.mk +++ b/share/mk/bsd.obj.mk @@ -55,10 +55,13 @@ CANONICALOBJDIR= ${.OBJDIR} CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} .elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" CANONICALOBJDIR:=${MAKEOBJDIR} +OBJTOP?= ${MAKEOBJDIR} .else CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif +OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} + # # Warn of unorthodox object directory. # diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 53c176e..762fae4 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -40,7 +40,7 @@ ____: # allowed to be built though since they are never installed. _need_host_libs= .for lib in ${_INTERNALLIBS} -_need_host_libs+= ${LIB${lib:tu}DIR:S,^${ROOTOBJDIR}/,,} +_need_host_libs+= ${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} .endfor N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}} diff --git a/share/mk/netbsd-tests.test.mk b/share/mk/netbsd-tests.test.mk index 92a401b..5357b08 100644 --- a/share/mk/netbsd-tests.test.mk +++ b/share/mk/netbsd-tests.test.mk @@ -3,8 +3,6 @@ .if !target(__netbsd_tests.test.mk__) __netbsd_tests.test.mk__: -OBJTOP?= ${.OBJDIR:S/${RELDIR}//} - TESTSRC?= ${SRCTOP}/contrib/netbsd-tests/${RELDIR:H} .if !exists(${TESTSRC}/) diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index bb57578..79da325 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -12,12 +12,6 @@ ____: .include -.if ${.OBJDIR:S,${.CURDIR},,} != ${.OBJDIR} -ROOTOBJDIR= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} -.elif defined(OBJTOP) && ${.OBJDIR:M${OBJTOP}*} != "" -ROOTOBJDIR= ${OBJTOP} -.endif - _PRIVATELIBS= \ atf_c \ atf_cxx \ @@ -311,127 +305,127 @@ LDADD+= ${LDADD_${_l}} .error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif -LIBELFTCDIR= ${ROOTOBJDIR}/lib/libelftc +LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a -LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline +LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a -LIBOPENBSDDIR= ${ROOTOBJDIR}/lib/libopenbsd +LIBOPENBSDDIR= ${OBJTOP}/lib/libopenbsd LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a -LIBSMDIR= ${ROOTOBJDIR}/lib/libsm +LIBSMDIR= ${OBJTOP}/lib/libsm LIBSM?= ${LIBSMDIR}/libsm.a -LIBSMDBDIR= ${ROOTOBJDIR}/lib/libsmdb +LIBSMDBDIR= ${OBJTOP}/lib/libsmdb LIBSMDB?= ${LIBSMDBDIR}/libsmdb.a -LIBSMUTILDIR= ${ROOTOBJDIR}/lib/libsmutil +LIBSMUTILDIR= ${OBJTOP}/lib/libsmutil LIBSMUTIL?= ${LIBSMDBDIR}/libsmutil.a -LIBNETBSDDIR?= ${ROOTOBJDIR}/lib/libnetbsd +LIBNETBSDDIR?= ${OBJTOP}/lib/libnetbsd LIBNETBSD?= ${LIBNETBSDDIR}/libnetbsd.a -LIBVERSDIR?= ${ROOTOBJDIR}/kerberos5/lib/libvers +LIBVERSDIR?= ${OBJTOP}/kerberos5/lib/libvers LIBVERS?= ${LIBVERSDIR}/libvers.a -LIBSLDIR= ${ROOTOBJDIR}/kerberos5/lib/libsl +LIBSLDIR= ${OBJTOP}/kerberos5/lib/libsl LIBSL?= ${LIBSLDIR}/libsl.a -LIBIPFDIR= ${ROOTOBJDIR}/sbin/ipf/libipf +LIBIPFDIR= ${OBJTOP}/sbin/ipf/libipf LIBIPF?= ${LIBIPFDIR}/libipf.a -LIBTELNETDIR= ${ROOTOBJDIR}/lib/libtelnet +LIBTELNETDIR= ${OBJTOP}/lib/libtelnet LIBTELNET?= ${LIBTELNETDIR}/libtelnet.a -LIBCRONDIR= ${ROOTOBJDIR}/usr.sbin/cron/lib +LIBCRONDIR= ${OBJTOP}/usr.sbin/cron/lib LIBCRON?= ${LIBCRONDIR}/libcron.a -LIBNTPDIR= ${ROOTOBJDIR}/usr.sbin/ntp/libntp +LIBNTPDIR= ${OBJTOP}/usr.sbin/ntp/libntp LIBNTP?= ${LIBNTPDIR}/libntp.a -LIBNTPEVENTDIR= ${ROOTOBJDIR}/usr.sbin/ntp/libntpevent +LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a -LIBOPTSDIR= ${ROOTOBJDIR}/usr.sbin/ntp/libopts +LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts LIBOTPS?= ${LIBOPTSDIR}/libopts.a -LIBPARSEDIR= ${ROOTOBJDIR}/usr.sbin/ntp/libparse +LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse LIBPARSE?= ${LIBPARSEDIR}/libparse.a -LIBLPRDIR= ${ROOTOBJDIR}/usr.sbin/lpr/common_source +LIBLPRDIR= ${OBJTOP}/usr.sbin/lpr/common_source LIBLPR?= ${LIBOPTSDIR}/liblpr.a -LIBFIFOLOGDIR= ${ROOTOBJDIR}/usr.sbin/fifolog/lib +LIBFIFOLOGDIR= ${OBJTOP}/usr.sbin/fifolog/lib LIBFIFOLOG?= ${LIBOPTSDIR}/libfifolog.a -LIBBSNMPTOOLSDIR= ${ROOTOBJDIR}/usr.sbin/bsnmpd/tools/libbsnmptools +LIBBSNMPTOOLSDIR= ${OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a -LIBAMUDIR= ${ROOTOBJDIR}/usr.sbin/amd/libamu +LIBAMUDIR= ${OBJTOP}/usr.sbin/amd/libamu LIBAMU?= ${LIBAMUDIR}/libamu/libamu.a # Define a directory for each library. This is useful for adding -L in when # not using a --sysroot or for meta mode bootstrapping when there is no # Makefile.depend. These are sorted by directory. -LIBAVLDIR= ${ROOTOBJDIR}/cddl/lib/libavl -LIBCTFDIR= ${ROOTOBJDIR}/cddl/lib/libctf -LIBDTRACEDIR= ${ROOTOBJDIR}/cddl/lib/libdtrace -LIBNVPAIRDIR= ${ROOTOBJDIR}/cddl/lib/libnvpair -LIBUMEMDIR= ${ROOTOBJDIR}/cddl/lib/libumem -LIBUUTILDIR= ${ROOTOBJDIR}/cddl/lib/libuutil -LIBZFSDIR= ${ROOTOBJDIR}/cddl/lib/libzfs -LIBZFS_COREDIR= ${ROOTOBJDIR}/cddl/lib/libzfs_core -LIBZPOOLDIR= ${ROOTOBJDIR}/cddl/lib/libzpool -LIBDIALOGDIR= ${ROOTOBJDIR}/gnu/lib/libdialog -LIBGCOVDIR= ${ROOTOBJDIR}/gnu/lib/libgcov -LIBGOMPDIR= ${ROOTOBJDIR}/gnu/lib/libgomp -LIBGNUREGEXDIR= ${ROOTOBJDIR}/gnu/lib/libregex -LIBSSPDIR= ${ROOTOBJDIR}/gnu/lib/libssp -LIBSSP_NONSHAREDDIR= ${ROOTOBJDIR}/gnu/lib/libssp/libssp_nonshared -LIBSUPCPLUSPLUSDIR= ${ROOTOBJDIR}/gnu/lib/libsupc++ -LIBASN1DIR= ${ROOTOBJDIR}/kerberos5/lib/libasn1 -LIBGSSAPI_KRB5DIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_krb5 -LIBGSSAPI_NTLMDIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_ntlm -LIBGSSAPI_SPNEGODIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_spnego -LIBHDBDIR= ${ROOTOBJDIR}/kerberos5/lib/libhdb -LIBHEIMBASEDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimbase -LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc -LIBHEIMIPCSDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcs -LIBHEIMNTLMDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimntlm -LIBHX509DIR= ${ROOTOBJDIR}/kerberos5/lib/libhx509 -LIBKADM5CLNTDIR= ${ROOTOBJDIR}/kerberos5/lib/libkadm5clnt -LIBKADM5SRVDIR= ${ROOTOBJDIR}/kerberos5/lib/libkadm5srv -LIBKAFS5DIR= ${ROOTOBJDIR}/kerberos5/lib/libkafs5 -LIBKDCDIR= ${ROOTOBJDIR}/kerberos5/lib/libkdc -LIBKRB5DIR= ${ROOTOBJDIR}/kerberos5/lib/libkrb5 -LIBROKENDIR= ${ROOTOBJDIR}/kerberos5/lib/libroken -LIBWINDDIR= ${ROOTOBJDIR}/kerberos5/lib/libwind -LIBALIASDIR= ${ROOTOBJDIR}/lib/libalias/libalias -LIBBLOCKSRUNTIMEDIR= ${ROOTOBJDIR}/lib/libblocksruntime -LIBBSNMPDIR= ${ROOTOBJDIR}/lib/libbsnmp/libbsnmp -LIBBSDXMLDIR= ${ROOTOBJDIR}/lib/libexpat -LIBKVMDIR= ${ROOTOBJDIR}/lib/libkvm -LIBPTHREADDIR= ${ROOTOBJDIR}/lib/libthr -LIBMDIR= ${ROOTOBJDIR}/lib/msun -LIBFORMDIR= ${ROOTOBJDIR}/lib/ncurses/form -LIBFORMLIBWDIR= ${ROOTOBJDIR}/lib/ncurses/formw -LIBMENUDIR= ${ROOTOBJDIR}/lib/ncurses/menu -LIBMENULIBWDIR= ${ROOTOBJDIR}/lib/ncurses/menuw -LIBTERMCAPDIR= ${ROOTOBJDIR}/lib/ncurses/ncurses -LIBTERMCAPWDIR= ${ROOTOBJDIR}/lib/ncurses/ncursesw -LIBPANELDIR= ${ROOTOBJDIR}/lib/ncurses/panel -LIBPANELWDIR= ${ROOTOBJDIR}/lib/ncurses/panelw -LIBCRYPTODIR= ${ROOTOBJDIR}/secure/lib/libcrypto -LIBSSHDIR= ${ROOTOBJDIR}/secure/lib/libssh -LIBSSLDIR= ${ROOTOBJDIR}/secure/lib/libssl -LIBTEKENDIR= ${ROOTOBJDIR}/sys/teken/libteken -LIBEGACYDIR= ${ROOTOBJDIR}/tools/build -LIBLNDIR= ${ROOTOBJDIR}/usr.bin/lex/lib +LIBAVLDIR= ${OBJTOP}/cddl/lib/libavl +LIBCTFDIR= ${OBJTOP}/cddl/lib/libctf +LIBDTRACEDIR= ${OBJTOP}/cddl/lib/libdtrace +LIBNVPAIRDIR= ${OBJTOP}/cddl/lib/libnvpair +LIBUMEMDIR= ${OBJTOP}/cddl/lib/libumem +LIBUUTILDIR= ${OBJTOP}/cddl/lib/libuutil +LIBZFSDIR= ${OBJTOP}/cddl/lib/libzfs +LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core +LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool +LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog +LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov +LIBGOMPDIR= ${OBJTOP}/gnu/lib/libgomp +LIBGNUREGEXDIR= ${OBJTOP}/gnu/lib/libregex +LIBSSPDIR= ${OBJTOP}/gnu/lib/libssp +LIBSSP_NONSHAREDDIR= ${OBJTOP}/gnu/lib/libssp/libssp_nonshared +LIBSUPCPLUSPLUSDIR= ${OBJTOP}/gnu/lib/libsupc++ +LIBASN1DIR= ${OBJTOP}/kerberos5/lib/libasn1 +LIBGSSAPI_KRB5DIR= ${OBJTOP}/kerberos5/lib/libgssapi_krb5 +LIBGSSAPI_NTLMDIR= ${OBJTOP}/kerberos5/lib/libgssapi_ntlm +LIBGSSAPI_SPNEGODIR= ${OBJTOP}/kerberos5/lib/libgssapi_spnego +LIBHDBDIR= ${OBJTOP}/kerberos5/lib/libhdb +LIBHEIMBASEDIR= ${OBJTOP}/kerberos5/lib/libheimbase +LIBHEIMIPCCDIR= ${OBJTOP}/kerberos5/lib/libheimipcc +LIBHEIMIPCSDIR= ${OBJTOP}/kerberos5/lib/libheimipcs +LIBHEIMNTLMDIR= ${OBJTOP}/kerberos5/lib/libheimntlm +LIBHX509DIR= ${OBJTOP}/kerberos5/lib/libhx509 +LIBKADM5CLNTDIR= ${OBJTOP}/kerberos5/lib/libkadm5clnt +LIBKADM5SRVDIR= ${OBJTOP}/kerberos5/lib/libkadm5srv +LIBKAFS5DIR= ${OBJTOP}/kerberos5/lib/libkafs5 +LIBKDCDIR= ${OBJTOP}/kerberos5/lib/libkdc +LIBKRB5DIR= ${OBJTOP}/kerberos5/lib/libkrb5 +LIBROKENDIR= ${OBJTOP}/kerberos5/lib/libroken +LIBWINDDIR= ${OBJTOP}/kerberos5/lib/libwind +LIBALIASDIR= ${OBJTOP}/lib/libalias/libalias +LIBBLOCKSRUNTIMEDIR= ${OBJTOP}/lib/libblocksruntime +LIBBSNMPDIR= ${OBJTOP}/lib/libbsnmp/libbsnmp +LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat +LIBKVMDIR= ${OBJTOP}/lib/libkvm +LIBPTHREADDIR= ${OBJTOP}/lib/libthr +LIBMDIR= ${OBJTOP}/lib/msun +LIBFORMDIR= ${OBJTOP}/lib/ncurses/form +LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw +LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu +LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw +LIBTERMCAPDIR= ${OBJTOP}/lib/ncurses/ncurses +LIBTERMCAPWDIR= ${OBJTOP}/lib/ncurses/ncursesw +LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel +LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw +LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto +LIBSSHDIR= ${OBJTOP}/secure/lib/libssh +LIBSSLDIR= ${OBJTOP}/secure/lib/libssl +LIBTEKENDIR= ${OBJTOP}/sys/teken/libteken +LIBEGACYDIR= ${OBJTOP}/tools/build +LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib # Default other library directories to lib/libNAME. .for lib in ${_LIBRARIES} -LIB${lib:tu}DIR?= ${ROOTOBJDIR}/lib/lib${lib} +LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} .endfor .endif # !target(____) diff --git a/share/security/Makefile b/share/security/Makefile index c25a52d..682a02b 100644 --- a/share/security/Makefile +++ b/share/security/Makefile @@ -1,7 +1,6 @@ # $FreeBSD$ FILES= lomac-policy.contexts -NO_OBJ= FILESDIR= ${BINDIR}/security .include "${.CURDIR}/../Makefile.inc" diff --git a/share/vt/keymaps/Makefile b/share/vt/keymaps/Makefile index 762cb17..283c348 100644 --- a/share/vt/keymaps/Makefile +++ b/share/vt/keymaps/Makefile @@ -88,6 +88,4 @@ FILES= INDEX.keymaps \ FILESDIR= ${SHAREDIR}/vt/keymaps -NO_OBJ= - .include diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 6388dac..1ca3d45 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -2807,6 +2807,9 @@ ieee80211_ioctl_set80211(struct ieee80211vap *vap, u_long cmd, struct ieee80211r /* XXX verify ciphers available */ flags = vap->iv_flags & ~IEEE80211_F_WPA; switch (ireq->i_val) { + case 0: + /* wpa_supplicant calls this to clear the WPA config */ + break; case 1: if (!(vap->iv_caps & IEEE80211_C_WPA1)) return EOPNOTSUPP; diff --git a/usr.bin/makewhatis/Makefile b/usr.bin/makewhatis/Makefile index ba0e1ee..1010949 100644 --- a/usr.bin/makewhatis/Makefile +++ b/usr.bin/makewhatis/Makefile @@ -4,7 +4,7 @@ PROG= makewhatis LIBADD= z SCRIPTS= makewhatis.local.sh MAN= makewhatis.1 makewhatis.local.8 -SCRIPTSDIR= /usr/libexec +SCRIPTSDIR= ${LIBEXECDIR} LINKS= ${SCRIPTSDIR}/makewhatis.local ${SCRIPTSDIR}/catman.local MLINKS= makewhatis.local.8 catman.local.8 diff --git a/usr.bin/vgrind/Makefile b/usr.bin/vgrind/Makefile index 06d9052..a7dc9a1 100644 --- a/usr.bin/vgrind/Makefile +++ b/usr.bin/vgrind/Makefile @@ -13,7 +13,7 @@ MAN= vgrind.1 vgrindefs.5 WARNS?= 3 -BINDIR= /usr/libexec +BINDIR= ${LIBEXECDIR} SCRIPTSDIR=/usr/bin CLEANFILES= vgrindefs.src.db diff --git a/usr.bin/xlint/lint1/Makefile b/usr.bin/xlint/lint1/Makefile index 2d6539e..6792ba0 100644 --- a/usr.bin/xlint/lint1/Makefile +++ b/usr.bin/xlint/lint1/Makefile @@ -11,7 +11,7 @@ LIBADD= l m CFLAGS+= -I. -I${.CURDIR} LINTFLAGS=-aehpz -BINDIR= /usr/libexec +BINDIR= ${LIBEXECDIR} .PATH: ${.CURDIR}/../common diff --git a/usr.bin/xlint/lint2/Makefile b/usr.bin/xlint/lint2/Makefile index 8f4a4ad..ad14d2a 100644 --- a/usr.bin/xlint/lint2/Makefile +++ b/usr.bin/xlint/lint2/Makefile @@ -9,6 +9,6 @@ MAN= CFLAGS+=-I${.CURDIR}/../lint1 LINTFLAGS=-abehrz -BINDIR= /usr/libexec +BINDIR= ${LIBEXECDIR} .include diff --git a/usr.sbin/bsdconfig/console/Makefile b/usr.sbin/bsdconfig/console/Makefile index c765a33..bcb2ebd 100644 --- a/usr.sbin/bsdconfig/console/Makefile +++ b/usr.sbin/bsdconfig/console/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/080.console diff --git a/usr.sbin/bsdconfig/console/include/Makefile b/usr.sbin/bsdconfig/console/include/Makefile index d2a17a0..52cb0be 100644 --- a/usr.sbin/bsdconfig/console/include/Makefile +++ b/usr.sbin/bsdconfig/console/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/080.console/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/diskmgmt/Makefile b/usr.sbin/bsdconfig/diskmgmt/Makefile index fc659f8..16a8900 100644 --- a/usr.sbin/bsdconfig/diskmgmt/Makefile +++ b/usr.sbin/bsdconfig/diskmgmt/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/050.diskmgmt diff --git a/usr.sbin/bsdconfig/diskmgmt/include/Makefile b/usr.sbin/bsdconfig/diskmgmt/include/Makefile index 33b93e0..c927153 100644 --- a/usr.sbin/bsdconfig/diskmgmt/include/Makefile +++ b/usr.sbin/bsdconfig/diskmgmt/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/050.diskmgmt/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/docsinstall/Makefile b/usr.sbin/bsdconfig/docsinstall/Makefile index 4b67834..2ab3a68 100644 --- a/usr.sbin/bsdconfig/docsinstall/Makefile +++ b/usr.sbin/bsdconfig/docsinstall/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/020.docsinstall diff --git a/usr.sbin/bsdconfig/docsinstall/include/Makefile b/usr.sbin/bsdconfig/docsinstall/include/Makefile index b86091a..a3ca529 100644 --- a/usr.sbin/bsdconfig/docsinstall/include/Makefile +++ b/usr.sbin/bsdconfig/docsinstall/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/020.docsinstall/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/dot/Makefile b/usr.sbin/bsdconfig/dot/Makefile index 0f11518..ccd10b4 100644 --- a/usr.sbin/bsdconfig/dot/Makefile +++ b/usr.sbin/bsdconfig/dot/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/dot diff --git a/usr.sbin/bsdconfig/dot/include/Makefile b/usr.sbin/bsdconfig/dot/include/Makefile index 891279f..b687b88 100644 --- a/usr.sbin/bsdconfig/dot/include/Makefile +++ b/usr.sbin/bsdconfig/dot/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/dot/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/examples/Makefile b/usr.sbin/bsdconfig/examples/Makefile index 33899d8..f66c2b1 100644 --- a/usr.sbin/bsdconfig/examples/Makefile +++ b/usr.sbin/bsdconfig/examples/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${SHAREDIR}/examples/bsdconfig FILES= add_some_packages.sh browse_packages_http.sh bsdconfigrc diff --git a/usr.sbin/bsdconfig/include/Makefile b/usr.sbin/bsdconfig/include/Makefile index 50bef4c..913481c 100644 --- a/usr.sbin/bsdconfig/include/Makefile +++ b/usr.sbin/bsdconfig/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/include FILES= bsdconfig.hlp media.hlp messages.subr network_device.hlp \ options.hlp tcp.hlp usage.hlp diff --git a/usr.sbin/bsdconfig/includes/Makefile b/usr.sbin/bsdconfig/includes/Makefile index c0bd689..367776c 100644 --- a/usr.sbin/bsdconfig/includes/Makefile +++ b/usr.sbin/bsdconfig/includes/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/includes diff --git a/usr.sbin/bsdconfig/includes/include/Makefile b/usr.sbin/bsdconfig/includes/include/Makefile index 21d55a1..3b8b3ec 100644 --- a/usr.sbin/bsdconfig/includes/include/Makefile +++ b/usr.sbin/bsdconfig/includes/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/includes/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/mouse/Makefile b/usr.sbin/bsdconfig/mouse/Makefile index b054c8b..97fa52b 100644 --- a/usr.sbin/bsdconfig/mouse/Makefile +++ b/usr.sbin/bsdconfig/mouse/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/110.mouse diff --git a/usr.sbin/bsdconfig/mouse/include/Makefile b/usr.sbin/bsdconfig/mouse/include/Makefile index 5071db8..2cc852f 100644 --- a/usr.sbin/bsdconfig/mouse/include/Makefile +++ b/usr.sbin/bsdconfig/mouse/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/110.mouse/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/networking/Makefile b/usr.sbin/bsdconfig/networking/Makefile index fcd8421..8a88067 100644 --- a/usr.sbin/bsdconfig/networking/Makefile +++ b/usr.sbin/bsdconfig/networking/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking diff --git a/usr.sbin/bsdconfig/networking/include/Makefile b/usr.sbin/bsdconfig/networking/include/Makefile index b76349a..54f66e1 100644 --- a/usr.sbin/bsdconfig/networking/include/Makefile +++ b/usr.sbin/bsdconfig/networking/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/networking/share/Makefile b/usr.sbin/bsdconfig/networking/share/Makefile index 3cb2d4e..6d77f25 100644 --- a/usr.sbin/bsdconfig/networking/share/Makefile +++ b/usr.sbin/bsdconfig/networking/share/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${SHAREDIR}/bsdconfig/networking FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \ netmask.subr resolv.subr routing.subr services.subr diff --git a/usr.sbin/bsdconfig/packages/Makefile b/usr.sbin/bsdconfig/packages/Makefile index 6450e06..fa5bd30 100644 --- a/usr.sbin/bsdconfig/packages/Makefile +++ b/usr.sbin/bsdconfig/packages/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/030.packages diff --git a/usr.sbin/bsdconfig/packages/include/Makefile b/usr.sbin/bsdconfig/packages/include/Makefile index 0c72bd4..3d30fd2 100644 --- a/usr.sbin/bsdconfig/packages/include/Makefile +++ b/usr.sbin/bsdconfig/packages/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/030.packages/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/password/Makefile b/usr.sbin/bsdconfig/password/Makefile index 0c4851f..d660e45 100644 --- a/usr.sbin/bsdconfig/password/Makefile +++ b/usr.sbin/bsdconfig/password/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password diff --git a/usr.sbin/bsdconfig/password/include/Makefile b/usr.sbin/bsdconfig/password/include/Makefile index dba8f19..a146eb2 100644 --- a/usr.sbin/bsdconfig/password/include/Makefile +++ b/usr.sbin/bsdconfig/password/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/password/share/Makefile b/usr.sbin/bsdconfig/password/share/Makefile index af707b3..65f9e8c 100644 --- a/usr.sbin/bsdconfig/password/share/Makefile +++ b/usr.sbin/bsdconfig/password/share/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${SHAREDIR}/bsdconfig/password FILES= password.subr diff --git a/usr.sbin/bsdconfig/security/Makefile b/usr.sbin/bsdconfig/security/Makefile index 4caa6ae..af83cee 100644 --- a/usr.sbin/bsdconfig/security/Makefile +++ b/usr.sbin/bsdconfig/security/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/130.security diff --git a/usr.sbin/bsdconfig/security/include/Makefile b/usr.sbin/bsdconfig/security/include/Makefile index 8b49a81..2efcc0f 100644 --- a/usr.sbin/bsdconfig/security/include/Makefile +++ b/usr.sbin/bsdconfig/security/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/130.security/include FILES= messages.subr securelevel.hlp diff --git a/usr.sbin/bsdconfig/share/Makefile b/usr.sbin/bsdconfig/share/Makefile index 400cc11..a09697a 100644 --- a/usr.sbin/bsdconfig/share/Makefile +++ b/usr.sbin/bsdconfig/share/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= media packages FILESDIR= ${SHAREDIR}/bsdconfig diff --git a/usr.sbin/bsdconfig/share/media/Makefile b/usr.sbin/bsdconfig/share/media/Makefile index 7be059b..135515b 100644 --- a/usr.sbin/bsdconfig/share/media/Makefile +++ b/usr.sbin/bsdconfig/share/media/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${SHAREDIR}/bsdconfig/media FILES= any.subr cdrom.subr common.subr directory.subr dos.subr \ floppy.subr ftp.subr http.subr httpproxy.subr network.subr \ diff --git a/usr.sbin/bsdconfig/share/packages/Makefile b/usr.sbin/bsdconfig/share/packages/Makefile index 8146346..bc0e59a 100644 --- a/usr.sbin/bsdconfig/share/packages/Makefile +++ b/usr.sbin/bsdconfig/share/packages/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${SHAREDIR}/bsdconfig/packages FILES= categories.subr index.subr musthavepkg.subr packages.subr diff --git a/usr.sbin/bsdconfig/startup/Makefile b/usr.sbin/bsdconfig/startup/Makefile index afab7b1..62a9e71 100644 --- a/usr.sbin/bsdconfig/startup/Makefile +++ b/usr.sbin/bsdconfig/startup/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/140.startup diff --git a/usr.sbin/bsdconfig/startup/include/Makefile b/usr.sbin/bsdconfig/startup/include/Makefile index 40a6539..aab9842 100644 --- a/usr.sbin/bsdconfig/startup/include/Makefile +++ b/usr.sbin/bsdconfig/startup/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/140.startup/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/startup/share/Makefile b/usr.sbin/bsdconfig/startup/share/Makefile index 221c38b..134914c 100644 --- a/usr.sbin/bsdconfig/startup/share/Makefile +++ b/usr.sbin/bsdconfig/startup/share/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${SHAREDIR}/bsdconfig/startup FILES= rcconf.subr rcedit.subr rcvar.subr diff --git a/usr.sbin/bsdconfig/timezone/Makefile b/usr.sbin/bsdconfig/timezone/Makefile index ea6a6a6..1569e7e 100644 --- a/usr.sbin/bsdconfig/timezone/Makefile +++ b/usr.sbin/bsdconfig/timezone/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/090.timezone diff --git a/usr.sbin/bsdconfig/timezone/include/Makefile b/usr.sbin/bsdconfig/timezone/include/Makefile index 82787e1..8fc6dfc 100644 --- a/usr.sbin/bsdconfig/timezone/include/Makefile +++ b/usr.sbin/bsdconfig/timezone/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/090.timezone/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/timezone/share/Makefile b/usr.sbin/bsdconfig/timezone/share/Makefile index bd67741..166fb10 100644 --- a/usr.sbin/bsdconfig/timezone/share/Makefile +++ b/usr.sbin/bsdconfig/timezone/share/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${SHAREDIR}/bsdconfig/timezone FILES= continents.subr countries.subr iso3166.subr menus.subr \ zones.subr diff --git a/usr.sbin/bsdconfig/ttys/Makefile b/usr.sbin/bsdconfig/ttys/Makefile index d53314c..044fdcf 100644 --- a/usr.sbin/bsdconfig/ttys/Makefile +++ b/usr.sbin/bsdconfig/ttys/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include FILESDIR= ${LIBEXECDIR}/bsdconfig/150.ttys diff --git a/usr.sbin/bsdconfig/ttys/include/Makefile b/usr.sbin/bsdconfig/ttys/include/Makefile index 2f32175..45c72ad 100644 --- a/usr.sbin/bsdconfig/ttys/include/Makefile +++ b/usr.sbin/bsdconfig/ttys/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/150.ttys/include FILES= messages.subr diff --git a/usr.sbin/bsdconfig/usermgmt/Makefile b/usr.sbin/bsdconfig/usermgmt/Makefile index d82f6d6..127c874 100644 --- a/usr.sbin/bsdconfig/usermgmt/Makefile +++ b/usr.sbin/bsdconfig/usermgmt/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/070.usermgmt diff --git a/usr.sbin/bsdconfig/usermgmt/include/Makefile b/usr.sbin/bsdconfig/usermgmt/include/Makefile index a63b1fe..4839654 100644 --- a/usr.sbin/bsdconfig/usermgmt/include/Makefile +++ b/usr.sbin/bsdconfig/usermgmt/include/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${LIBEXECDIR}/bsdconfig/070.usermgmt/include FILES= messages.subr usermgmt.hlp diff --git a/usr.sbin/bsdconfig/usermgmt/share/Makefile b/usr.sbin/bsdconfig/usermgmt/share/Makefile index a13c200..eba7c1c 100644 --- a/usr.sbin/bsdconfig/usermgmt/share/Makefile +++ b/usr.sbin/bsdconfig/usermgmt/share/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - FILESDIR= ${SHAREDIR}/bsdconfig/usermgmt FILES= group.subr group_input.subr user.subr user_input.subr diff --git a/usr.sbin/bsdinstall/distextract/Makefile b/usr.sbin/bsdinstall/distextract/Makefile index 313ec00..d3008f6 100644 --- a/usr.sbin/bsdinstall/distextract/Makefile +++ b/usr.sbin/bsdinstall/distextract/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -BINDIR= /usr/libexec/bsdinstall +BINDIR= ${LIBEXECDIR}/bsdinstall PROG= distextract LIBADD= archive dpv figpar ncursesw dialog m diff --git a/usr.sbin/bsdinstall/distfetch/Makefile b/usr.sbin/bsdinstall/distfetch/Makefile index 5c0f6e8..1620c9b 100644 --- a/usr.sbin/bsdinstall/distfetch/Makefile +++ b/usr.sbin/bsdinstall/distfetch/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -BINDIR= /usr/libexec/bsdinstall +BINDIR= ${LIBEXECDIR}/bsdinstall PROG= distfetch LIBADD= fetch ncursesw dialog m diff --git a/usr.sbin/bsdinstall/partedit/Makefile b/usr.sbin/bsdinstall/partedit/Makefile index d48f777..21d842e 100644 --- a/usr.sbin/bsdinstall/partedit/Makefile +++ b/usr.sbin/bsdinstall/partedit/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -BINDIR= /usr/libexec/bsdinstall +BINDIR= ${LIBEXECDIR}/bsdinstall PROG= partedit LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \ ${BINDIR}/partedit ${BINDIR}/scriptedpart diff --git a/usr.sbin/bsdinstall/scripts/Makefile b/usr.sbin/bsdinstall/scripts/Makefile index efe9700..c0d6ac2 100644 --- a/usr.sbin/bsdinstall/scripts/Makefile +++ b/usr.sbin/bsdinstall/scripts/Makefile @@ -3,7 +3,7 @@ SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \ keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \ rootpass script services time umount wlanconfig zfsboot -BINDIR= /usr/libexec/bsdinstall +BINDIR= ${LIBEXECDIR}/bsdinstall MAN= diff --git a/usr.sbin/lpr/filters/Makefile b/usr.sbin/lpr/filters/Makefile index f1bc586..7976752 100644 --- a/usr.sbin/lpr/filters/Makefile +++ b/usr.sbin/lpr/filters/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -BINDIR= /usr/libexec/lpr +BINDIR= ${LIBEXECDIR}/lpr PROG= lpf MAN= diff --git a/usr.sbin/rpc.yppasswdd/Makefile b/usr.sbin/rpc.yppasswdd/Makefile index 5f5fb77..9b2fb39 100644 --- a/usr.sbin/rpc.yppasswdd/Makefile +++ b/usr.sbin/rpc.yppasswdd/Makefile @@ -7,7 +7,7 @@ RPCDIR= ${DESTDIR}/usr/include/rpcsvc PROG= rpc.yppasswdd SCRIPTS=yppwupdate -SCRIPTSDIR= /usr/libexec +SCRIPTSDIR= ${LIBEXECDIR} MAN= rpc.yppasswdd.8 SRCS= util.c yp_access.c yp_dblookup.c yp_dbwrite.c \ yp_error.c yppasswdd_main.c yppasswdd_server.c ypxfr_misc.c ${GENSRCS} diff --git a/usr.sbin/sendmail/Makefile b/usr.sbin/sendmail/Makefile index 80ce13b..f9641c1 100644 --- a/usr.sbin/sendmail/Makefile +++ b/usr.sbin/sendmail/Makefile @@ -7,7 +7,7 @@ SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail SMDIR= ${SENDMAIL_DIR}/src .PATH: ${SMDIR} -BINDIR= /usr/libexec/sendmail +BINDIR= ${LIBEXECDIR}/sendmail PROG= sendmail MAN= mailq.1 newaliases.1 aliases.5 sendmail.8 diff --git a/usr.sbin/tcpdchk/Makefile b/usr.sbin/tcpdchk/Makefile index 5faea18..c7d4155 100644 --- a/usr.sbin/tcpdchk/Makefile +++ b/usr.sbin/tcpdchk/Makefile @@ -8,7 +8,7 @@ PROG= tcpdchk MAN= tcpdchk.8 SRCS= tcpdchk.c fakelog.c inetcf.c scaffold.c -CFLAGS+=-DREAL_DAEMON_DIR=\"/usr/libexec\" \ +CFLAGS+=-DREAL_DAEMON_DIR=\"${LIBEXECDIR}\" \ -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DPROCESS_OPTIONS \ -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" .if ${MK_INET6_SUPPORT} != "no" diff --git a/usr.sbin/tcpdmatch/Makefile b/usr.sbin/tcpdmatch/Makefile index bbe29a4..2f92427 100644 --- a/usr.sbin/tcpdmatch/Makefile +++ b/usr.sbin/tcpdmatch/Makefile @@ -8,7 +8,7 @@ PROG= tcpdmatch MAN= tcpdmatch.8 SRCS= tcpdmatch.c fakelog.c inetcf.c scaffold.c -CFLAGS+=-DREAL_DAEMON_DIR=\"/usr/libexec\" \ +CFLAGS+=-DREAL_DAEMON_DIR=\"${LIBEXECDIR}\" \ -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DINET6 -- cgit v1.1 From 13fcf1f8c2ed94cbabd6a4bee12f8ffb806252c5 Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 26 Nov 2015 07:55:20 +0000 Subject: r291359 was incorrect. Skip over tokens that start with `#' as fgetln can return more than one '\n' delimited line in a buffer Handle empty lines too, just in case MFC after: 3 days X-MFC with: r291359 --- tools/regression/lib/libc/resolv/resolv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/regression/lib/libc/resolv/resolv.c b/tools/regression/lib/libc/resolv/resolv.c index 9392872..2ec3eeb 100644 --- a/tools/regression/lib/libc/resolv/resolv.c +++ b/tools/regression/lib/libc/resolv/resolv.c @@ -87,13 +87,14 @@ load(const char *fname) if ((fp = fopen(fname, "r")) == NULL) err(1, "Cannot open `%s'", fname); while ((line = fgetln(fp, &len)) != NULL) { - if (line[0] == '#') - continue; char c = line[len]; char *ptr; line[len] = '\0'; - for (ptr = strtok(line, WS); ptr; ptr = strtok(NULL, WS)) + for (ptr = strtok(line, WS); ptr; ptr = strtok(NULL, WS)) { + if (ptr == '\0' || ptr[0] == '#') + continue; sl_add(hosts, strdup(ptr)); + } line[len] = c; } -- cgit v1.1 From c85e616e29482200cd0a47fa6c85165a98a4caaf Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 10 Dec 2015 07:38:56 +0000 Subject: MFhead @ r292053 --- MAINTAINERS | 3 + contrib/ofed/usr.bin/ibaddr/Makefile | 2 +- contrib/ofed/usr.bin/ibnetdiscover/Makefile | 4 +- contrib/ofed/usr.bin/ibping/Makefile | 2 +- contrib/ofed/usr.bin/ibportstate/Makefile | 2 +- contrib/ofed/usr.bin/ibroute/Makefile | 4 +- contrib/ofed/usr.bin/ibsendtrap/Makefile | 2 +- contrib/ofed/usr.bin/ibstat/Makefile | 2 +- contrib/ofed/usr.bin/ibsysstat/Makefile | 2 +- contrib/ofed/usr.bin/ibtracert/Makefile | 4 +- contrib/ofed/usr.bin/opensm/Makefile | 3 +- contrib/ofed/usr.bin/osmtest/Makefile | 9 +- contrib/ofed/usr.bin/perfquery/Makefile | 2 +- contrib/ofed/usr.bin/saquery/Makefile | 3 +- contrib/ofed/usr.bin/sminfo/Makefile | 2 +- contrib/ofed/usr.bin/smpdump/Makefile | 2 +- contrib/ofed/usr.bin/smpquery/Makefile | 4 +- contrib/ofed/usr.bin/vendstat/Makefile | 2 +- lib/libc/rpc/svc_vc.c | 18 +- lib/libc/stdio/open_memstream.c | 4 +- lib/libc/stdio/open_wmemstream.c | 4 +- lib/libopenbsd/Makefile | 1 - lib/libopenbsd/imsg.c | 15 +- sbin/devd/devd.cc | 23 +- sbin/geom/class/multipath/geom_multipath.c | 11 +- sbin/sysctl/sysctl.8 | 8 +- sbin/sysctl/sysctl.c | 34 +- share/man/man4/ioat.4 | 15 +- share/man/man4/isp.4 | 14 +- share/man/man9/BUS_DESCRIBE_INTR.9 | 4 +- share/mk/bsd.libnames.mk | 31 +- share/mk/src.libnames.mk | 35 +- sys/dev/hwpmc/hwpmc_logging.c | 6 + sys/dev/ioat/ioat.c | 56 +++ sys/dev/ioat/ioat.h | 13 + sys/dev/ioat/ioat_internal.h | 4 +- sys/dev/ioat/ioat_test.c | 53 ++- sys/dev/ioat/ioat_test.h | 2 + sys/dev/isp/isp.c | 4 +- sys/dev/isp/isp_pci.c | 11 + sys/dev/sfxge/common/efx.h | 3 + sys/dev/sfxge/common/efx_impl.h | 1 + sys/dev/sfxge/common/efx_mcdi.c | 244 +++++++++- sys/dev/sfxge/common/efx_mcdi.h | 36 ++ sys/dev/sfxge/common/efx_types.h | 2 +- sys/dev/sfxge/common/hunt_ev.c | 14 + sys/dev/sfxge/common/hunt_impl.h | 6 + sys/dev/sfxge/common/hunt_mcdi.c | 137 ++---- sys/dev/sfxge/common/siena_mcdi.c | 76 +-- sys/dev/usb/wlan/if_urtwn.c | 74 ++- sys/dev/usb/wlan/if_urtwnreg.h | 7 + sys/dev/usb/wlan/if_urtwnvar.h | 1 - sys/netinet/cc/cc_cubic.c | 13 +- sys/netinet/cc/cc_newreno.c | 14 +- sys/netinet/if_ether.c | 26 +- sys/netinet/in_mcast.c | 17 +- sys/netinet/ip_icmp.c | 8 +- sys/netinet/ip_input.c | 27 -- sys/netinet/ip_options.c | 14 +- sys/netinet/ip_var.h | 2 - sys/netinet/tcp_var.h | 1 + sys/netinet6/icmp6.c | 29 +- sys/netinet6/in6.c | 23 +- sys/netinet6/in6_fib.c | 8 +- sys/netinet6/in6_gif.c | 4 +- sys/netinet6/in6_mcast.c | 23 +- sys/netinet6/in6_src.c | 24 +- tools/tools/ioat/ioatcontrol.8 | 8 +- tools/tools/ioat/ioatcontrol.c | 29 +- usr.bin/clang/lldb/Makefile | 4 +- usr.sbin/iostat/iostat.c | 59 ++- usr.sbin/pmcstudy/pmcstudy.8 | 8 +- usr.sbin/pmcstudy/pmcstudy.c | 712 ++++++++++++++++++++++++---- 73 files changed, 1528 insertions(+), 546 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index b22accb..62ab287 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,9 @@ sys/dev/ixgbe erj Pre-commit phabricator review requested. sys/dev/ixl erj Pre-commit phabricator review requested. sys/netinet/ip_carp.c glebius Pre-commit review recommended. sys/netpfil/pf kp,glebius Pre-commit review recommended. +sctp rrs,tuexen Pre-commit review requested (changes need to be backported to github). +pmcstudy(8) rrs Pre-commit review requested. +callout_*(9) rrs Pre-commit review requested -- becareful its tricksy code :o. usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team. lpr gad Pre-commit review requested, particularly for lpd/recvjob.c and lpd/printjob.c. diff --git a/contrib/ofed/usr.bin/ibaddr/Makefile b/contrib/ofed/usr.bin/ibaddr/Makefile index b0af500..2270900 100644 --- a/contrib/ofed/usr.bin/ibaddr/Makefile +++ b/contrib/ofed/usr.bin/ibaddr/Makefile @@ -5,7 +5,7 @@ PROG= ibaddr SRCS= ibaddr.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= ibaddr.8 diff --git a/contrib/ofed/usr.bin/ibnetdiscover/Makefile b/contrib/ofed/usr.bin/ibnetdiscover/Makefile index 1e6bc0e..f77c6ec 100644 --- a/contrib/ofed/usr.bin/ibnetdiscover/Makefile +++ b/contrib/ofed/usr.bin/ibnetdiscover/Makefile @@ -5,8 +5,8 @@ PROG= ibnetdiscover SRCS= ibnetdiscover.c grouping.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -CFLAGS+= -pthread -I${DIAGPATH}/include +LIBADD= ibumad ibcommon ibmad osmcomp pthread +CFLAGS+= -I${DIAGPATH}/include MAN= ibnetdiscover.8 WARNS?= 1 diff --git a/contrib/ofed/usr.bin/ibping/Makefile b/contrib/ofed/usr.bin/ibping/Makefile index f152855..55ceca8 100644 --- a/contrib/ofed/usr.bin/ibping/Makefile +++ b/contrib/ofed/usr.bin/ibping/Makefile @@ -5,7 +5,7 @@ PROG= ibping SRCS= ibping.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= ibping.8 diff --git a/contrib/ofed/usr.bin/ibportstate/Makefile b/contrib/ofed/usr.bin/ibportstate/Makefile index e6af8bc..feaced2 100644 --- a/contrib/ofed/usr.bin/ibportstate/Makefile +++ b/contrib/ofed/usr.bin/ibportstate/Makefile @@ -5,7 +5,7 @@ PROG= ibportstate SRCS= ibportstate.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= ibportstate.8 diff --git a/contrib/ofed/usr.bin/ibroute/Makefile b/contrib/ofed/usr.bin/ibroute/Makefile index bbbbda3..ab73621 100644 --- a/contrib/ofed/usr.bin/ibroute/Makefile +++ b/contrib/ofed/usr.bin/ibroute/Makefile @@ -5,8 +5,8 @@ PROG= ibroute SRCS= ibroute.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -CFLAGS+= -pthread -I${DIAGPATH}/include +LIBADD= ibumad ibcommon ibmad osmcomp pthread +CFLAGS+= -I${DIAGPATH}/include MAN= ibroute.8 WARNS?= 1 diff --git a/contrib/ofed/usr.bin/ibsendtrap/Makefile b/contrib/ofed/usr.bin/ibsendtrap/Makefile index 8548838..33ac49a 100644 --- a/contrib/ofed/usr.bin/ibsendtrap/Makefile +++ b/contrib/ofed/usr.bin/ibsendtrap/Makefile @@ -5,7 +5,7 @@ PROG= ibsendtrap SRCS= ibsendtrap.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= diff --git a/contrib/ofed/usr.bin/ibstat/Makefile b/contrib/ofed/usr.bin/ibstat/Makefile index 6c2c23c..652cc68 100644 --- a/contrib/ofed/usr.bin/ibstat/Makefile +++ b/contrib/ofed/usr.bin/ibstat/Makefile @@ -5,7 +5,7 @@ PROG= ibstat SRCS= ibstat.c -LDADD= -libumad -libcommon +LIBADD= ibumad ibcommon CFLAGS+= -I${DIAGPATH}/include MAN= ibstat.8 diff --git a/contrib/ofed/usr.bin/ibsysstat/Makefile b/contrib/ofed/usr.bin/ibsysstat/Makefile index 974e015..52fec8d 100644 --- a/contrib/ofed/usr.bin/ibsysstat/Makefile +++ b/contrib/ofed/usr.bin/ibsysstat/Makefile @@ -5,7 +5,7 @@ PROG= ibsysstat SRCS= ibsysstat.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= ibsysstat.8 diff --git a/contrib/ofed/usr.bin/ibtracert/Makefile b/contrib/ofed/usr.bin/ibtracert/Makefile index cbfae3e..9c4a494 100644 --- a/contrib/ofed/usr.bin/ibtracert/Makefile +++ b/contrib/ofed/usr.bin/ibtracert/Makefile @@ -5,8 +5,8 @@ PROG= ibtracert SRCS= ibtracert.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -CFLAGS+= -pthread -I${DIAGPATH}/include +LIBADD= ibumad ibcommon ibmad osmcomp pthread +CFLAGS+= -I${DIAGPATH}/include MAN= ibtracert.8 WARNS?= 1 diff --git a/contrib/ofed/usr.bin/opensm/Makefile b/contrib/ofed/usr.bin/opensm/Makefile index ae45eaa..4dd1b06 100644 --- a/contrib/ofed/usr.bin/opensm/Makefile +++ b/contrib/ofed/usr.bin/opensm/Makefile @@ -29,8 +29,7 @@ SRCS+= osm_vl_arb_rcv.c st.c osm_perfmgr.c osm_perfmgr_db.c osm_event_plugin.c SRCS+= osm_dump.c osm_ucast_cache.c osm_qos_parser_y.y osm_qos_parser_l.l SRCS+= osm_qos_policy.c -LDADD= -lopensm -losmvendor -losmcomp -libmad -libumad -libcommon -CFLAGS+= -pthread +LIBADD= opensm osmvendor osmcomp ibmad ibumad ibcommon pthread CFLAGS+= -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP MAN= opensm.8 diff --git a/contrib/ofed/usr.bin/osmtest/Makefile b/contrib/ofed/usr.bin/osmtest/Makefile index 038d1db1..0330b2e 100644 --- a/contrib/ofed/usr.bin/osmtest/Makefile +++ b/contrib/ofed/usr.bin/osmtest/Makefile @@ -16,14 +16,7 @@ SRCS= main.c \ osmt_slvl_vl_arb.c \ osmtest.c -LDADD= -libcommon \ - -libmad \ - -libumad \ - -losmvendor \ - -losmcomp \ - -lopensm \ - -LIBADD+= pthread +LIBADD= ibcommon ibmad ibumad osmvendor osmcomp opensm pthread CFLAGS= -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP \ -I${OPENSM}/osmtest/include diff --git a/contrib/ofed/usr.bin/perfquery/Makefile b/contrib/ofed/usr.bin/perfquery/Makefile index 792d575..ba337e1 100644 --- a/contrib/ofed/usr.bin/perfquery/Makefile +++ b/contrib/ofed/usr.bin/perfquery/Makefile @@ -5,7 +5,7 @@ PROG= perfquery SRCS= perfquery.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= perfquery.8 diff --git a/contrib/ofed/usr.bin/saquery/Makefile b/contrib/ofed/usr.bin/saquery/Makefile index efb6036..210224a 100644 --- a/contrib/ofed/usr.bin/saquery/Makefile +++ b/contrib/ofed/usr.bin/saquery/Makefile @@ -5,10 +5,9 @@ PROG= saquery SRCS= saquery.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -losmvendor -lopensm +LIBADD= ibumad ibcommon ibmad osmcomp osmvendor opensm pthread CFLAGS+= -I${DIAGPATH}/include CFLAGS+= -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP -CFLAGS+= -pthread MAN= saquery.8 WARNS?= 1 diff --git a/contrib/ofed/usr.bin/sminfo/Makefile b/contrib/ofed/usr.bin/sminfo/Makefile index 90f9887..0ec6656 100644 --- a/contrib/ofed/usr.bin/sminfo/Makefile +++ b/contrib/ofed/usr.bin/sminfo/Makefile @@ -5,7 +5,7 @@ PROG= sminfo SRCS= sminfo.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= sminfo.8 diff --git a/contrib/ofed/usr.bin/smpdump/Makefile b/contrib/ofed/usr.bin/smpdump/Makefile index 4db68be..e9258a5 100644 --- a/contrib/ofed/usr.bin/smpdump/Makefile +++ b/contrib/ofed/usr.bin/smpdump/Makefile @@ -5,7 +5,7 @@ PROG= smpdump SRCS= smpdump.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= smpdump.8 diff --git a/contrib/ofed/usr.bin/smpquery/Makefile b/contrib/ofed/usr.bin/smpquery/Makefile index edfedd1..f08df7d 100644 --- a/contrib/ofed/usr.bin/smpquery/Makefile +++ b/contrib/ofed/usr.bin/smpquery/Makefile @@ -5,8 +5,8 @@ PROG= smpquery SRCS= smpquery.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -CFLAGS+= -pthread -I${DIAGPATH}/include +LIBADD= ibumad ibcommon ibmad osmcomp pthread +CFLAGS+= -I${DIAGPATH}/include MAN= smpquery.8 WARNS?= 1 diff --git a/contrib/ofed/usr.bin/vendstat/Makefile b/contrib/ofed/usr.bin/vendstat/Makefile index bfca2c8..df18313 100644 --- a/contrib/ofed/usr.bin/vendstat/Makefile +++ b/contrib/ofed/usr.bin/vendstat/Makefile @@ -5,7 +5,7 @@ PROG= vendstat SRCS= vendstat.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= vendstat.8 diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c index bafb725..e81a839 100644 --- a/lib/libc/rpc/svc_vc.c +++ b/lib/libc/rpc/svc_vc.c @@ -281,8 +281,8 @@ rendezvous_request(SVCXPRT *xprt, struct rpc_msg *msg) int sock, flags; struct cf_rendezvous *r; struct cf_conn *cd; - struct sockaddr_storage addr; - socklen_t len; + struct sockaddr_storage addr, sslocal; + socklen_t len, slen; struct __rpc_sockinfo si; SVCXPRT *newxprt; fd_set cleanfds; @@ -347,6 +347,20 @@ again: __xdrrec_setnonblock(&cd->xdrs, cd->maxrec); } else cd->nonblock = FALSE; + slen = sizeof(struct sockaddr_storage); + if(_getsockname(sock, (struct sockaddr *)(void *)&sslocal, &slen) < 0) { + warnx("svc_vc_create: could not retrieve local addr"); + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = 0; + } else { + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = sslocal.ss_len; + newxprt->xp_ltaddr.buf = mem_alloc((size_t)sslocal.ss_len); + if (newxprt->xp_ltaddr.buf == NULL) { + warnx("svc_vc_create: no mem for local addr"); + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = 0; + } else { + memcpy(newxprt->xp_ltaddr.buf, &sslocal, (size_t)sslocal.ss_len); + } + } gettimeofday(&cd->last_recv_time, NULL); diff --git a/lib/libc/stdio/open_memstream.c b/lib/libc/stdio/open_memstream.c index f3d1ee5..a7e0bae 100644 --- a/lib/libc/stdio/open_memstream.c +++ b/lib/libc/stdio/open_memstream.c @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c index 4585531..3e8713f 100644 --- a/lib/libc/stdio/open_wmemstream.c +++ b/lib/libc/stdio/open_wmemstream.c @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include diff --git a/lib/libopenbsd/Makefile b/lib/libopenbsd/Makefile index 3f16bff..3eb6b74 100644 --- a/lib/libopenbsd/Makefile +++ b/lib/libopenbsd/Makefile @@ -11,5 +11,4 @@ CFLAGS+= -I${.CURDIR} WARNS= 3 -NO_WERROR= .include diff --git a/lib/libopenbsd/imsg.c b/lib/libopenbsd/imsg.c index cb16bd7..279ab63 100644 --- a/lib/libopenbsd/imsg.c +++ b/lib/libopenbsd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.10 2015/07/19 07:18:59 nicm Exp $ */ +/* $OpenBSD: imsg.c,v 1.13 2015/12/09 11:54:12 tb Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -74,7 +74,7 @@ imsg_read(struct imsgbuf *ibuf) again: if (getdtablecount() + imsg_fd_overhead + - (CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int) + (int)((CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int)) >= getdtablesize()) { errno = EAGAIN; free(ifd); @@ -82,11 +82,9 @@ again: } if ((n = recvmsg(ibuf->fd, &msg, 0)) == -1) { - if (errno == EMSGSIZE) - goto fail; - if (errno != EINTR && errno != EAGAIN) - goto fail; - goto again; + if (errno == EINTR) + goto again; + goto fail; } ibuf->r.wpos += n; @@ -120,8 +118,7 @@ again: } fail: - if (ifd) - free(ifd); + free(ifd); return (n); } diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index 5580f6c..203d750 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -108,15 +108,26 @@ __FBSDID("$FreeBSD$"); /* * Since the client socket is nonblocking, we must increase its send buffer to * handle brief event storms. On FreeBSD, AF_UNIX sockets don't have a receive - * buffer, so the client can't increate the buffersize by itself. + * buffer, so the client can't increase the buffersize by itself. * * For example, when creating a ZFS pool, devd emits one 165 character - * resource.fs.zfs.statechange message for each vdev in the pool. A 64k - * buffer has enough space for almost 400 drives, which would be very large but - * not impossibly large pool. A 128k buffer has enough space for 794 drives, - * which is more than can fit in a rack with modern technology. + * resource.fs.zfs.statechange message for each vdev in the pool. The kernel + * allocates a 4608B mbuf for each message. Modern technology places a limit of + * roughly 450 drives/rack, and it's unlikely that a zpool will ever be larger + * than that. + * + * 450 drives * 165 bytes / drive = 74250B of data in the sockbuf + * 450 drives * 4608B / drive = 2073600B of mbufs in the sockbuf + * + * We can't directly set the sockbuf's mbuf limit, but we can do it indirectly. + * The kernel sets it to the minimum of a hard-coded maximum value and sbcc * + * kern.ipc.sockbuf_waste_factor, where sbcc is the socket buffer size set by + * the user. The default value of kern.ipc.sockbuf_waste_factor is 8. If we + * set the bufsize to 256k and use the kern.ipc.sockbuf_waste_factor, then the + * kernel will set the mbuf limit to 2MB, which is just large enough for 450 + * drives. It also happens to be the same as the hardcoded maximum value. */ -#define CLIENT_BUFSIZE 131072 +#define CLIENT_BUFSIZE 262144 using namespace std; diff --git a/sbin/geom/class/multipath/geom_multipath.c b/sbin/geom/class/multipath/geom_multipath.c index cdf35d0..5743911 100644 --- a/sbin/geom/class/multipath/geom_multipath.c +++ b/sbin/geom/class/multipath/geom_multipath.c @@ -221,17 +221,15 @@ mp_label(struct gctl_req *req) /* * Allocate a sector to write as metadata. */ - sector = malloc(secsize); + sector = calloc(1, secsize); if (sector == NULL) { gctl_error(req, "unable to allocate metadata buffer"); return; } - memset(sector, 0, secsize); rsector = malloc(secsize); if (rsector == NULL) { - free(sector); gctl_error(req, "unable to allocate metadata buffer"); - return; + goto done; } /* @@ -246,7 +244,7 @@ mp_label(struct gctl_req *req) error = g_metadata_store(name, sector, secsize); if (error != 0) { gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); - return; + goto done; } /* @@ -274,6 +272,9 @@ mp_label(struct gctl_req *req) name2, name); } } +done: + free(rsector); + free(sector); } diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index cb8145e..8d2d316 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -28,7 +28,7 @@ .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 12, 2015 +.Dd December 10, 2015 .Dt SYSCTL 8 .Os .Sh NAME @@ -36,13 +36,13 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdehiNnoRTqx +.Op Fl bdehiNnoRTtqx .Op Fl B Ar bufsize .Op Fl f Ar filename .Ar name Ns Op = Ns Ar value .Ar ... .Nm -.Op Fl bdehNnoRTqx +.Op Fl bdehNnoRTtqx .Op Fl B Ar bufsize .Fl a .Sh DESCRIPTION @@ -140,6 +140,8 @@ Suppress some warnings generated by to standard error. .It Fl T Display only variables that are settable via loader (CTLFLAG_TUN). +.It Fl t +Print the type of the variable. .It Fl W Display only writable variables that are not statistical. Useful for determining the set of runtime tunable sysctls. diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 1cd31c0..6b493c6 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -72,7 +72,7 @@ static const char rcsid[] = static const char *conffile; static int aflag, bflag, Bflag, dflag, eflag, hflag, iflag; -static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag; +static int Nflag, nflag, oflag, qflag, tflag, Tflag, Wflag, xflag; static int oidfmt(int *, int, char *, u_int *); static int parsefile(const char *); @@ -120,6 +120,9 @@ static const char *ctl_typename[CTLTYPE+1] = { [CTLTYPE_S16] = "int16_t", [CTLTYPE_S32] = "int32_t", [CTLTYPE_S64] = "int64_t", + [CTLTYPE_NODE] = "node", + [CTLTYPE_STRING] = "string", + [CTLTYPE_OPAQUE] = "opaque", }; static void @@ -127,8 +130,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqTWx] [ -B ] [-f filename] name[=value] ...", - " sysctl [-bdehNnoqTWx] [ -B ] -a"); + "usage: sysctl [-bdehiNnoqTtWx] [ -B ] [-f filename] name[=value] ...", + " sysctl [-bdehNnoqTtWx] [ -B ] -a"); exit(1); } @@ -142,7 +145,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:hiNnoqTwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -184,6 +187,9 @@ main(int argc, char **argv) case 'q': qflag = 1; break; + case 't': + tflag = 1; + break; case 'T': Tflag = 1; break; @@ -856,7 +862,7 @@ show_var(int *oid, int nlen) { u_char buf[BUFSIZ], *val, *oval, *p; char name[BUFSIZ], fmt[BUFSIZ]; - const char *sep, *sep1; + const char *sep, *sep1, *prntype; int qoid[CTL_MAXNAME+2]; uintmax_t umv; intmax_t mv; @@ -902,12 +908,23 @@ show_var(int *oid, int nlen) else sep = ": "; - if (dflag) { /* just print description */ + ctltype = (kind & CTLTYPE); + if (tflag || dflag) { + if (!nflag) + printf("%s%s", name, sep); + if (ctl_typename[ctltype] != NULL) + prntype = ctl_typename[ctltype]; + else + prntype = "unknown"; + if (tflag && dflag) + printf("%s%s", prntype, sep); + else if (tflag) { + printf("%s", prntype); + return (0); + } qoid[1] = 5; j = sizeof(buf); i = sysctl(qoid, nlen + 2, buf, &j, 0, 0); - if (!nflag) - printf("%s%s", name, sep); printf("%s", buf); return (0); } @@ -925,7 +942,6 @@ show_var(int *oid, int nlen) warnx("malloc failed"); return (1); } - ctltype = (kind & CTLTYPE); len = j; i = sysctl(oid, nlen, val, &len, 0, 0); if (i != 0 || (len == 0 && ctltype != CTLTYPE_STRING)) { diff --git a/share/man/man4/ioat.4 b/share/man/man4/ioat.4 index 62d85f1..add6495 100644 --- a/share/man/man4/ioat.4 +++ b/share/man/man4/ioat.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2015 +.Dd December 9, 2015 .Dt IOAT 4 .Os .Sh NAME @@ -78,6 +78,17 @@ In .Fa "uint32_t flags" .Fc .Ft struct bus_dmadesc * +.Fo ioat_copy_8k_aligned +.Fa "bus_dmaengine_t dmaengine" +.Fa "bus_addr_t dst1" +.Fa "bus_addr_t dst2" +.Fa "bus_addr_t src1" +.Fa "bus_addr_t src2" +.Fa "bus_dmaengine_callback_t callback_fn" +.Fa "void *callback_arg" +.Fa "uint32_t flags" +.Fc +.Ft struct bus_dmadesc * .Fo ioat_blockfill .Fa "bus_dmaengine_t dmaengine" .Fa "bus_addr_t dst" @@ -150,7 +161,7 @@ Then, they will submit one or more operations using .Fn ioat_copy , or .Fn ioat_null . -After queueing one or more individual DMA operations, they will +After queuing one or more individual DMA operations, they will .Fn ioat_release the .Ar bus_dmaengine_t diff --git a/share/man/man4/isp.4 b/share/man/man4/isp.4 index 71050a2..da6b776 100644 --- a/share/man/man4/isp.4 +++ b/share/man/man4/isp.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2015 +.Dd December 9, 2015 .Dt ISP 4 .Os .Sh NAME @@ -107,10 +107,12 @@ Optical 2Gb Fibre Channel PCIe cards. Dell branded version of the QLogic 2312. .It Qlogic 2422 Optical 4Gb Fibre Channel PCI cards. -.It Qlogic 2432 +.It Qlogic 246x (aka 2432) Optical 4Gb Fibre Channel PCIe cards. -.It Qlogic 2532 +.It Qlogic 256x (aka 2532) Optical 8Gb Fibre Channel PCIe cards. +.It Qlogic 267x/836x (aka 2031/8031) +Optical 16Gb FC/FCoE PCIe cards. .El .Sh CONFIGURATION OPTIONS Target mode support for Fibre Channel adapters may be enabled with the @@ -127,12 +129,6 @@ They are: .It Va hint.isp.0.fwload_disable A hint value to disable loading of firmware .Xr ispfw 4 . -.It Va hint.isp.0.prefer_memmap -A hint value to use PCI memory space instead of I/O space -access for. -.It Va hint.isp.0.prefer_iomap -A hint value to use PCI I/O space instead of Memory space -access for. .It Va hint.isp.0.ignore_nvram A hint value to ignore board NVRAM settings for. Otherwise use NVRAM settings. diff --git a/share/man/man9/BUS_DESCRIBE_INTR.9 b/share/man/man9/BUS_DESCRIBE_INTR.9 index c340bb2..8603417 100644 --- a/share/man/man9/BUS_DESCRIBE_INTR.9 +++ b/share/man/man9/BUS_DESCRIBE_INTR.9 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2009 +.Dd December 9, 2015 .Dt BUS_DESCRIBE_INTR 9 .Os .Sh NAME @@ -38,7 +38,7 @@ .In sys/param.h .In sys/bus.h .Ft int -.Fo BUS_BIND_INTR +.Fo BUS_DESCRIBE_INTR .Fa "device_t dev" "device_t child" "struct resource *irq" "void *cookie" .Fa "const char *descr" .Fc diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 58df94e..596aa0a 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -27,22 +27,23 @@ LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a -LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a -LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a LIBC?= ${DESTDIR}${LIBDIR}/libc.a -LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a LIBCAM?= ${DESTDIR}${LIBDIR}/libcam.a LIBCAPSICUM?= ${DESTDIR}${LIBDIR}/libcapsicum.a LIBCASPER?= ${DESTDIR}${LIBDIR}/libcasper.a -LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a LIBCOMPAT?= ${DESTDIR}${LIBDIR}/libcompat.a LIBCOMPILER_RT?=${DESTDIR}${LIBDIR}/libcompiler_rt.a +LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a +LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a +LIBCXGB4?= ${DESTDIR}${LIBDIR}/libcxgb4.a +LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a +LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a @@ -59,9 +60,9 @@ LIBFIGPAR?= ${DESTDIR}${LIBDIR}/libfigpar.a LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a -LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a LIBGEOM?= ${DESTDIR}${LIBDIR}/libgeom.a LIBGNUREGEX?= ${DESTDIR}${LIBDIR}/libgnuregex.a +LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssapi.a LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/libgssapi_krb5.a LIBHDB?= ${DESTDIR}${LIBDIR}/libhdb.a @@ -69,6 +70,12 @@ LIBHEIMBASE?= ${DESTDIR}${LIBDIR}/libheimbase.a LIBHEIMNTLM?= ${DESTDIR}${LIBDIR}/libheimntlm.a LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR}/libheimsqlite.a LIBHX509?= ${DESTDIR}${LIBDIR}/libhx509.a +LIBIBCM?= ${DESTDIR}${LIBDIR}/libibcm.a +LIBIBCOMMON?= ${DESTDIR}${LIBDIR}/libibcommon.a +LIBIBMAD?= ${DESTDIR}${LIBDIR}/libibmad.a +LIBIBSDP?= ${DESTDIR}${LIBDIR}/libibsdp.a +LIBIBUMAD?= ${DESTDIR}${LIBDIR}/libibumad.a +LIBIBVERBS?= ${DESTDIR}${LIBDIR}/libibverbs.a LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a @@ -88,8 +95,10 @@ LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a LIBMEMSTAT?= ${DESTDIR}${LIBDIR}/libmemstat.a LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a +LIBMLX4?= ${DESTDIR}${LIBDIR}/libmlx4.a LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a LIBMT?= ${DESTDIR}${LIBDIR}/libmt.a +LIBMTHCA?= ${DESTDIR}${LIBDIR}/libmthca.a LIBNANDFS?= ${DESTDIR}${LIBDIR}/libnandfs.a LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a @@ -97,7 +106,10 @@ LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a LIBNV?= ${DESTDIR}${LIBDIR}/libnv.a LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a +LIBOPENSM?= ${DESTDIR}${LIBDIR}/libopensm.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a +LIBOSMCOMP?= ${DESTDIR}${LIBDIR}/libosmcomp.a +LIBOSMVENDOR?= ${DESTDIR}${LIBDIR}/libosmvendor.a LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a @@ -108,9 +120,10 @@ LIBPROC?= ${DESTDIR}${LIBDIR}/libproc.a LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libprocstat.a LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a +LIBRDMACM?= ${DESTDIR}${LIBDIR}/librdmacm.a LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a -LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a +LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a LIBRT?= ${DESTDIR}${LIBDIR}/librt.a LIBRTLD_DB?= ${DESTDIR}${LIBDIR}/librtld_db.a LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a @@ -128,18 +141,18 @@ LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP" LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES" LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a +LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a -LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a -LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a +LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a -LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBXO?= ${DESTDIR}${LIBDIR}/libxo.a +LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 15d30cc..c77cefa 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -169,6 +169,23 @@ _LIBRARIES= \ zfs \ zpool \ +.if ${MK_OFED} != "no" +_LIBRARIES+= \ + cxgb4 \ + ibcm \ + ibcommon \ + ibmad \ + ibsdp \ + ibumad \ + ibverbs \ + mlx4 \ + mthca \ + opensm \ + osmcomp \ + osmvendor \ + rdmacm \ + +.endif # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. @@ -416,6 +433,19 @@ LIBUUTILDIR= ${OBJTOP}/cddl/lib/libuutil LIBZFSDIR= ${OBJTOP}/cddl/lib/libzfs LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool +LIBCXGB4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libcxgb4 +LIBIBCMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcm +LIBIBCOMMONDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcommon +LIBIBMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibmad +LIBIBUMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibumad +LIBIBVERBSDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibverbs +LIBMLX4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libmlx4 +LIBMTHCADIR= ${OBJTOP}/contrib/ofed/usr.lib/libmthca +LIBOPENSMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libopensm +LIBOSMCOMPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmcomp +LIBOSMVENDORDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmvendor +LIBRDMACMDIR= ${OBJTOP}/contrib/ofed/usr.lib/librdmacm +LIBIBSDPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libsdp LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov LIBGOMPDIR= ${OBJTOP}/gnu/lib/libgomp @@ -453,8 +483,6 @@ LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw -LIBTERMCAPDIR= ${LIBNCURSESDIR} -LIBTERMCAPWDIR= ${LIBNCURSESWDIR} LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto @@ -464,6 +492,9 @@ LIBTEKENDIR= ${OBJTOP}/sys/teken/libteken LIBEGACYDIR= ${OBJTOP}/tools/build LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib +LIBTERMCAPDIR= ${LIBNCURSESDIR} +LIBTERMCAPWDIR= ${LIBNCURSESWDIR} + # Default other library directories to lib/libNAME. .for lib in ${_LIBRARIES} LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index cc85481..231fbb9 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -70,6 +70,9 @@ SYSCTL_DECL(_kern_hwpmc); */ static int pmclog_buffer_size = PMC_LOG_BUFFER_SIZE; +#if (__FreeBSD_version < 1100000) +TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "logbuffersize", &pmclog_buffer_size); +#endif SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_RDTUN, &pmclog_buffer_size, 0, "size of log buffers in kilobytes"); @@ -78,6 +81,9 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_RDTUN, */ static int pmc_nlogbuffers = PMC_NLOGBUFFERS; +#if (__FreeBSD_version < 1100000) +TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "nbuffers", &pmc_nlogbuffers); +#endif SYSCTL_INT(_kern_hwpmc, OID_AUTO, nbuffers, CTLFLAG_RDTUN, &pmc_nlogbuffers, 0, "number of global log buffers"); diff --git a/sys/dev/ioat/ioat.c b/sys/dev/ioat/ioat.c index 00cf337..c5ad746 100644 --- a/sys/dev/ioat/ioat.c +++ b/sys/dev/ioat/ioat.c @@ -219,6 +219,17 @@ static struct _pcsid { 0x6f528086, "BDXDE IOAT Ch2" }, { 0x6f538086, "BDXDE IOAT Ch3" }, + { 0x6f208086, "BDX IOAT Ch0" }, + { 0x6f218086, "BDX IOAT Ch1" }, + { 0x6f228086, "BDX IOAT Ch2" }, + { 0x6f238086, "BDX IOAT Ch3" }, + { 0x6f248086, "BDX IOAT Ch4" }, + { 0x6f258086, "BDX IOAT Ch5" }, + { 0x6f268086, "BDX IOAT Ch6" }, + { 0x6f278086, "BDX IOAT Ch7" }, + { 0x6f2e8086, "BDX IOAT Ch0 (RAID)" }, + { 0x6f2f8086, "BDX IOAT Ch1 (RAID)" }, + { 0x00000000, NULL } }; @@ -833,6 +844,51 @@ ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst, } struct bus_dmadesc * +ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, bus_addr_t dst1, + bus_addr_t dst2, bus_addr_t src1, bus_addr_t src2, + bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags) +{ + struct ioat_dma_hw_descriptor *hw_desc; + struct ioat_descriptor *desc; + struct ioat_softc *ioat; + + CTR0(KTR_IOAT, __func__); + ioat = to_ioat_softc(dmaengine); + + if (((src1 | src2 | dst1 | dst2) & (0xffffull << 48)) != 0) { + ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n", + __func__); + return (NULL); + } + if (((src1 | src2 | dst1 | dst2) & PAGE_MASK) != 0) { + ioat_log_message(0, "%s: Addresses must be page-aligned\n", + __func__); + return (NULL); + } + + desc = ioat_op_generic(ioat, IOAT_OP_COPY, 2 * PAGE_SIZE, src1, dst1, + callback_fn, callback_arg, flags); + if (desc == NULL) + return (NULL); + + hw_desc = desc->u.dma; + if (src2 != src1 + PAGE_SIZE) { + hw_desc->u.control.src_page_break = 1; + hw_desc->next_src_addr = src2; + } + if (dst2 != dst1 + PAGE_SIZE) { + hw_desc->u.control.dest_page_break = 1; + hw_desc->next_dest_addr = dst2; + } + + if (g_ioat_debug_level >= 3) + dump_descriptor(hw_desc); + + ioat_submit_single(ioat); + return (&desc->bus_dmadesc); +} + +struct bus_dmadesc * ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t dst, uint64_t fillpattern, bus_size_t len, bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags) diff --git a/sys/dev/ioat/ioat.h b/sys/dev/ioat/ioat.h index c5a4855..8174ce8 100644 --- a/sys/dev/ioat/ioat.h +++ b/sys/dev/ioat/ioat.h @@ -84,6 +84,19 @@ struct bus_dmadesc *ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst, void *callback_arg, uint32_t flags); /* + * Issue a copy data operation, with constraints: + * - src1, src2, dst1, dst2 are all page-aligned addresses + * - The quantity to copy is exactly 2 pages; + * - src1 -> dst1, src2 -> dst2 + * + * Why use this instead of normal _copy()? You can copy two non-contiguous + * pages (src, dst, or both) with one descriptor. + */ +struct bus_dmadesc *ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, + bus_addr_t dst1, bus_addr_t dst2, bus_addr_t src1, bus_addr_t src2, + bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags); + +/* * Issues a null operation. This issues the operation to the hardware, but the * hardware doesn't do anything with it. */ diff --git a/sys/dev/ioat/ioat_internal.h b/sys/dev/ioat/ioat_internal.h index 4ec738e..9a00877 100644 --- a/sys/dev/ioat/ioat_internal.h +++ b/sys/dev/ioat/ioat_internal.h @@ -175,8 +175,8 @@ struct ioat_dma_hw_descriptor { uint64_t src_addr; uint64_t dest_addr; uint64_t next; - uint64_t reserved; - uint64_t reserved2; + uint64_t next_src_addr; + uint64_t next_dest_addr; uint64_t user1; uint64_t user2; }; diff --git a/sys/dev/ioat/ioat_test.c b/sys/dev/ioat/ioat_test.c index a8311ab..f39786e 100644 --- a/sys/dev/ioat/ioat_test.c +++ b/sys/dev/ioat/ioat_test.c @@ -84,11 +84,17 @@ static inline void _ioat_test_log(int verbosity, const char *fmt, ...); static void ioat_test_transaction_destroy(struct test_transaction *tx) { + struct ioat_test *test; int i; + test = tx->test; + for (i = 0; i < IOAT_MAX_BUFS; i++) { if (tx->buf[i] != NULL) { - contigfree(tx->buf[i], tx->length, M_IOAT_TEST); + if (test->testkind == IOAT_TEST_DMA_8K) + free(tx->buf[i], M_IOAT_TEST); + else + contigfree(tx->buf[i], tx->length, M_IOAT_TEST); tx->buf[i] = NULL; } } @@ -97,8 +103,8 @@ ioat_test_transaction_destroy(struct test_transaction *tx) } static struct -test_transaction *ioat_test_transaction_create(unsigned num_buffers, - uint32_t buffer_size) +test_transaction *ioat_test_transaction_create(struct ioat_test *test, + unsigned num_buffers) { struct test_transaction *tx; unsigned i; @@ -107,11 +113,16 @@ test_transaction *ioat_test_transaction_create(unsigned num_buffers, if (tx == NULL) return (NULL); - tx->length = buffer_size; + tx->length = test->buffer_size; for (i = 0; i < num_buffers; i++) { - tx->buf[i] = contigmalloc(buffer_size, M_IOAT_TEST, M_NOWAIT, - 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); + if (test->testkind == IOAT_TEST_DMA_8K) + tx->buf[i] = malloc(test->buffer_size, M_IOAT_TEST, + M_NOWAIT); + else + tx->buf[i] = contigmalloc(test->buffer_size, + M_IOAT_TEST, M_NOWAIT, 0, BUS_SPACE_MAXADDR, + PAGE_SIZE, 0); if (tx->buf[i] == NULL) { ioat_test_transaction_destroy(tx); @@ -197,8 +208,7 @@ ioat_test_prealloc_memory(struct ioat_test *test, int index) struct test_transaction *tx; for (i = 0; i < test->transactions; i++) { - tx = ioat_test_transaction_create(test->chain_depth * 2, - test->buffer_size); + tx = ioat_test_transaction_create(test, test->chain_depth * 2); if (tx == NULL) { ioat_test_log(0, "tx == NULL - memory exhausted\n"); test->status[IOAT_TEST_NO_MEMORY]++; @@ -258,8 +268,16 @@ ioat_test_submit_1_tx(struct ioat_test *test, bus_dmaengine_t dma) TAILQ_INSERT_HEAD(&test->pend_q, tx, entry); IT_UNLOCK(); - ioat_acquire(dma); + if (test->testkind != IOAT_TEST_MEMCPY) + ioat_acquire(dma); for (i = 0; i < tx->depth; i++) { + if (test->testkind == IOAT_TEST_MEMCPY) { + memcpy(tx->buf[2 * i + 1], tx->buf[2 * i], tx->length); + if (i == tx->depth - 1) + ioat_dma_test_callback(tx, 0); + continue; + } + src = vtophys((vm_offset_t)tx->buf[2*i]); dest = vtophys((vm_offset_t)tx->buf[2*i+1]); @@ -286,10 +304,20 @@ ioat_test_submit_1_tx(struct ioat_test *test, bus_dmaengine_t dma) fillpattern = *(uint64_t *)tx->buf[2*i]; desc = ioat_blockfill(dma, dest, fillpattern, tx->length, cb, tx, flags); + } else if (test->testkind == IOAT_TEST_DMA_8K) { + bus_addr_t src2, dst2; + + src2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE); + dst2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE); + + desc = ioat_copy_8k_aligned(dma, dest, dst2, src, src2, + cb, tx, flags); } if (desc == NULL) break; } + if (test->testkind == IOAT_TEST_MEMCPY) + return; ioat_release(dma); /* @@ -317,6 +345,13 @@ ioat_dma_test(void *arg) test = arg; memset(__DEVOLATILE(void *, test->status), 0, sizeof(test->status)); + if (test->testkind == IOAT_TEST_DMA_8K && + test->buffer_size != 2 * PAGE_SIZE) { + ioat_test_log(0, "Asked for 8k test and buffer size isn't 8k\n"); + test->status[IOAT_TEST_INVALID_INPUT]++; + return; + } + if (test->buffer_size > 1024 * 1024) { ioat_test_log(0, "Buffer size too large >1MB\n"); test->status[IOAT_TEST_NO_MEMORY]++; diff --git a/sys/dev/ioat/ioat_test.h b/sys/dev/ioat/ioat_test.h index b6e6a15..4306b3b 100644 --- a/sys/dev/ioat/ioat_test.h +++ b/sys/dev/ioat/ioat_test.h @@ -42,6 +42,8 @@ enum ioat_test_kind { IOAT_TEST_FILL = 0, IOAT_TEST_DMA, IOAT_TEST_RAW_DMA, + IOAT_TEST_DMA_8K, + IOAT_TEST_MEMCPY, IOAT_NUM_TESTKINDS }; diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c index a140ddb..d394011 100644 --- a/sys/dev/isp/isp.c +++ b/sys/dev/isp/isp.c @@ -7920,7 +7920,9 @@ isp_rd_2400_nvram(ispsoftc_t *isp, uint32_t addr, uint32_t *rp) uint32_t base = 0x7ffe0000; uint32_t tmp = 0; - if (IS_25XX(isp)) { + if (IS_26XX(isp)) { + base = 0x7fe7c000; /* XXX: Observation, may be wrong. */ + } else if (IS_25XX(isp)) { base = 0x7ff00000 | 0x48000; } ISP_WRITE(isp, BIU2400_FLASH_ADDR, base | addr); diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c index bd0ceea..9bc9653 100644 --- a/sys/dev/isp/isp_pci.c +++ b/sys/dev/isp/isp_pci.c @@ -294,6 +294,10 @@ static struct ispmdvec mdvec_2600 = { #define PCI_PRODUCT_QLOGIC_ISP2031 0x2031 #endif +#ifndef PCI_PRODUCT_QLOGIC_ISP8031 +#define PCI_PRODUCT_QLOGIC_ISP8031 0x8031 +#endif + #define PCI_QLOGIC_ISP5432 \ ((PCI_PRODUCT_QLOGIC_ISP5432 << 16) | PCI_VENDOR_QLOGIC) @@ -348,6 +352,9 @@ static struct ispmdvec mdvec_2600 = { #define PCI_QLOGIC_ISP2031 \ ((PCI_PRODUCT_QLOGIC_ISP2031 << 16) | PCI_VENDOR_QLOGIC) +#define PCI_QLOGIC_ISP8031 \ + ((PCI_PRODUCT_QLOGIC_ISP8031 << 16) | PCI_VENDOR_QLOGIC) + /* * Odd case for some AMI raid cards... We need to *not* attach to this. */ @@ -458,6 +465,9 @@ isp_pci_probe(device_t dev) case PCI_QLOGIC_ISP2031: device_set_desc(dev, "Qlogic ISP 2031 PCI FC-AL Adapter"); break; + case PCI_QLOGIC_ISP8031: + device_set_desc(dev, "Qlogic ISP 8031 PCI FCoE Adapter"); + break; default: return (ENXIO); } @@ -800,6 +810,7 @@ isp_pci_attach(device_t dev) pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF; break; case PCI_QLOGIC_ISP2031: + case PCI_QLOGIC_ISP8031: did = 0x2600; isp->isp_nchan += isp_nvports; isp->isp_mdvec = &mdvec_2600; diff --git a/sys/dev/sfxge/common/efx.h b/sys/dev/sfxge/common/efx.h index 531b6c9..a84454d 100644 --- a/sys/dev/sfxge/common/efx.h +++ b/sys/dev/sfxge/common/efx.h @@ -218,6 +218,9 @@ typedef struct efx_mcdi_transport_s { void (*emt_logger)(void *, efx_log_msg_t, void *, size_t, void *, size_t); #endif /* EFSYS_OPT_MCDI_LOGGING */ +#if EFSYS_OPT_MCDI_PROXY_AUTH + void (*emt_ev_proxy_response)(void *, uint32_t, efx_rc_t); +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ } efx_mcdi_transport_t; extern __checkReturn efx_rc_t diff --git a/sys/dev/sfxge/common/efx_impl.h b/sys/dev/sfxge/common/efx_impl.h index 27ea406..239d9c8 100644 --- a/sys/dev/sfxge/common/efx_impl.h +++ b/sys/dev/sfxge/common/efx_impl.h @@ -463,6 +463,7 @@ typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_fw_update_supported)(efx_nic_t *, boolean_t *); efx_rc_t (*emco_macaddr_change_supported)(efx_nic_t *, boolean_t *); efx_rc_t (*emco_link_control_supported)(efx_nic_t *, boolean_t *); + efx_rc_t (*emco_mac_spoofing_supported)(efx_nic_t *, boolean_t *); void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); } efx_mcdi_ops_t; diff --git a/sys/dev/sfxge/common/efx_mcdi.c b/sys/dev/sfxge/common/efx_mcdi.c index 25c879e..e6ca1e8 100644 --- a/sys/dev/sfxge/common/efx_mcdi.c +++ b/sys/dev/sfxge/common/efx_mcdi.c @@ -55,6 +55,7 @@ static efx_mcdi_ops_t __efx_mcdi_siena_ops = { /* emco_macaddr_change_supported */ siena_mcdi_link_control_supported, /* emco_link_control_supported */ + NULL, /* emco_mac_spoofing_supported */ siena_mcdi_read_response, /* emco_read_response */ }; @@ -74,6 +75,8 @@ static efx_mcdi_ops_t __efx_mcdi_hunt_ops = { /* emco_macaddr_change_supported */ hunt_mcdi_link_control_supported, /* emco_link_control_supported */ + hunt_mcdi_mac_spoofing_supported, + /* emco_mac_spoofing_supported */ hunt_mcdi_read_response, /* emco_read_response */ }; @@ -228,6 +231,132 @@ efx_mcdi_request_start( emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); } + + void +efx_mcdi_read_response_header( + __in efx_nic_t *enp, + __inout efx_mcdi_req_t *emrp) +{ +#if EFSYS_OPT_MCDI_LOGGING + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; +#endif /* EFSYS_OPT_MCDI_LOGGING */ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + efx_dword_t hdr[2]; + unsigned int hdr_len; + unsigned int data_len; + unsigned int seq; + unsigned int cmd; + unsigned int error; + efx_rc_t rc; + + EFSYS_ASSERT(emrp != NULL); + + emcop->emco_read_response(enp, &hdr[0], 0, sizeof (hdr[0])); + hdr_len = sizeof (hdr[0]); + + cmd = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE); + seq = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_SEQ); + error = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR); + + if (cmd != MC_CMD_V2_EXTN) { + data_len = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_DATALEN); + } else { + emcop->emco_read_response(enp, &hdr[1], hdr_len, + sizeof (hdr[1])); + hdr_len += sizeof (hdr[1]); + + cmd = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_EXTENDED_CMD); + data_len = + EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_ACTUAL_LEN); + } + + if (error && (data_len == 0)) { + /* The MC has rebooted since the request was sent. */ + EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US); + emcop->emco_poll_reboot(enp); + rc = EIO; + goto fail1; + } + if ((cmd != emrp->emr_cmd) || + (seq != ((emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ)))) { + /* Response is for a different request */ + rc = EIO; + goto fail2; + } + if (error) { + efx_dword_t err[2]; + unsigned int err_len = MIN(data_len, sizeof (err)); + int err_code = MC_CMD_ERR_EPROTO; + int err_arg = 0; + + /* Read error code (and arg num for MCDI v2 commands) */ + emcop->emco_read_response(enp, &err, hdr_len, err_len); + + if (err_len >= (MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t))) + err_code = EFX_DWORD_FIELD(err[0], EFX_DWORD_0); +#ifdef WITH_MCDI_V2 + if (err_len >= (MC_CMD_ERR_ARG_OFST + sizeof (efx_dword_t))) + err_arg = EFX_DWORD_FIELD(err[1], EFX_DWORD_0); +#endif + emrp->emr_err_code = err_code; + emrp->emr_err_arg = err_arg; + +#if EFSYS_OPT_MCDI_PROXY_AUTH + if ((err_code == MC_CMD_ERR_PROXY_PENDING) && + (err_len == sizeof (err))) { + /* + * The MCDI request would normally fail with EPERM, but + * firmware has forwarded it to an authorization agent + * attached to a privileged PF. + * + * Save the authorization request handle. The client + * must wait for a PROXY_RESPONSE event, or timeout. + */ + emrp->emr_proxy_handle = err_arg; + } +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ + +#if EFSYS_OPT_MCDI_LOGGING + if (emtp->emt_logger != NULL) { + emtp->emt_logger(emtp->emt_context, + EFX_LOG_MCDI_RESPONSE, + &hdr, hdr_len, + &err, err_len); + } +#endif /* EFSYS_OPT_MCDI_LOGGING */ + + if (!emrp->emr_quiet) { + EFSYS_PROBE3(mcdi_err_arg, int, emrp->emr_cmd, + int, err_code, int, err_arg); + } + + rc = efx_mcdi_request_errcode(err_code); + goto fail3; + } + + emrp->emr_rc = 0; + emrp->emr_out_length_used = data_len; +#if EFSYS_OPT_MCDI_PROXY_AUTH + emrp->emr_proxy_handle = 0; +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ + return; + +fail3: + if (!emrp->emr_quiet) + EFSYS_PROBE(fail3); +fail2: + if (!emrp->emr_quiet) + EFSYS_PROBE(fail2); +fail1: + if (!emrp->emr_quiet) + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + emrp->emr_rc = rc; + emrp->emr_out_length_used = 0; +} + + __checkReturn boolean_t efx_mcdi_request_poll( __in efx_nic_t *enp) @@ -352,6 +481,9 @@ efx_mcdi_request_errcode( case MC_CMD_ERR_MAC_EXIST: return (EEXIST); + case MC_CMD_ERR_PROXY_PENDING: + return (EAGAIN); + default: EFSYS_PROBE1(mc_pcol_error, int, err); return (EIO); @@ -432,6 +564,7 @@ efx_mcdi_ev_cpl( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_mcdi_req_t *emrp; int state; @@ -456,27 +589,87 @@ efx_mcdi_ev_cpl( emip->emi_pending_req = NULL; EFSYS_UNLOCK(enp->en_eslp, state); + if (encp->enc_mcdi_max_payload_length > MCDI_CTL_SDU_LEN_MAX_V1) { + /* MCDIv2 response details do not fit into an event. */ + efx_mcdi_read_response_header(enp, emrp); + } else { + if (errcode != 0) { + if (!emrp->emr_quiet) { + EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd, + int, errcode); + } + emrp->emr_out_length_used = 0; + emrp->emr_rc = efx_mcdi_request_errcode(errcode); + } else { + emrp->emr_out_length_used = outlen; + emrp->emr_rc = 0; + } + } + if (errcode == 0) { + emcop->emco_request_copyout(enp, emrp); + } + + emtp->emt_ev_cpl(emtp->emt_context); +} + +#if EFSYS_OPT_MCDI_PROXY_AUTH + + __checkReturn efx_rc_t +efx_mcdi_get_proxy_handle( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *handlep) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_rc_t rc; + /* - * Fill out the remaining hdr fields, and copyout the payload - * if the user supplied an output buffer. + * Return proxy handle from MCDI request that returned with error + * MC_MCD_ERR_PROXY_PENDING. This handle is used to wait for a matching + * PROXY_RESPONSE event. */ - if (errcode != 0) { - if (!emrp->emr_quiet) { - EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd, - int, errcode); - } - emrp->emr_out_length_used = 0; - emrp->emr_rc = efx_mcdi_request_errcode(errcode); + if ((emrp == NULL) || (handlep == NULL)) { + rc = EINVAL; + goto fail1; + } + if ((emrp->emr_rc != 0) && + (emrp->emr_err_code == MC_CMD_ERR_PROXY_PENDING)) { + *handlep = emrp->emr_proxy_handle; + rc = 0; } else { - emrp->emr_out_length_used = outlen; - emrp->emr_rc = 0; + *handlep = 0; + rc = ENOENT; } - emcop->emco_request_copyout(enp, emrp); + return (rc); - emtp->emt_ev_cpl(emtp->emt_context); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); } void +efx_mcdi_ev_proxy_response( + __in efx_nic_t *enp, + __in unsigned int handle, + __in unsigned int status) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efx_rc_t rc; + + /* + * Handle results of an authorization request for a privileged MCDI + * command. If authorization was granted then we must re-issue the + * original MCDI request. If authorization failed or timed out, + * then the original MCDI request should be completed with the + * result code from this event. + */ + rc = (status == 0) ? 0 : efx_mcdi_request_errcode(status); + + emtp->emt_ev_proxy_response(emtp->emt_context, handle, rc); +} +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ + + void efx_mcdi_ev_death( __in efx_nic_t *enp, __in int rc) @@ -1199,6 +1392,31 @@ fail1: return (rc); } + __checkReturn efx_rc_t +efx_mcdi_mac_spoofing_supported( + __in efx_nic_t *enp, + __out boolean_t *supportedp) +{ + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + efx_rc_t rc; + + if (emcop != NULL && emcop->emco_mac_spoofing_supported != NULL) { + if ((rc = emcop->emco_mac_spoofing_supported(enp, supportedp)) + != 0) + goto fail1; + } else { + /* Earlier devices always supported MAC spoofing */ + *supportedp = B_TRUE; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #if EFSYS_OPT_BIST #if EFSYS_OPT_HUNTINGTON diff --git a/sys/dev/sfxge/common/efx_mcdi.h b/sys/dev/sfxge/common/efx_mcdi.h index 9129e11..f25fb4e 100644 --- a/sys/dev/sfxge/common/efx_mcdi.h +++ b/sys/dev/sfxge/common/efx_mcdi.h @@ -59,6 +59,12 @@ struct efx_mcdi_req_s { uint8_t *emr_out_buf; size_t emr_out_length; size_t emr_out_length_used; + /* Internals: low level transport details */ + unsigned int emr_err_code; + unsigned int emr_err_arg; +#if EFSYS_OPT_MCDI_PROXY_AUTH + uint32_t emr_proxy_handle; +#endif }; typedef struct efx_mcdi_iface_s { @@ -82,6 +88,11 @@ efx_mcdi_execute_quiet( __in efx_nic_t *enp, __inout efx_mcdi_req_t *emrp); + extern void +efx_mcdi_read_response_header( + __in efx_nic_t *enp, + __inout efx_mcdi_req_t *emrp); + extern void efx_mcdi_ev_cpl( __in efx_nic_t *enp, @@ -89,6 +100,20 @@ efx_mcdi_ev_cpl( __in unsigned int outlen, __in int errcode); +#if EFSYS_OPT_MCDI_PROXY_AUTH +extern __checkReturn efx_rc_t +efx_mcdi_get_proxy_handle( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *handlep); + +extern void +efx_mcdi_ev_proxy_response( + __in efx_nic_t *enp, + __in unsigned int handle, + __in unsigned int status); +#endif + extern void efx_mcdi_ev_death( __in efx_nic_t *enp, @@ -156,6 +181,12 @@ efx_mcdi_link_control_supported( __in efx_nic_t *enp, __out boolean_t *supportedp); +extern __checkReturn efx_rc_t +efx_mcdi_mac_spoofing_supported( + __in efx_nic_t *enp, + __out boolean_t *supportedp); + + #if EFSYS_OPT_BIST #if EFSYS_OPT_HUNTINGTON extern __checkReturn efx_rc_t @@ -355,6 +386,11 @@ efx_mcdi_get_loopback_modes( #define MCDI_CMD_DWORD_FIELD(_edp, _field) \ EFX_DWORD_FIELD(*_edp, MC_CMD_ ## _field) +#define EFX_MCDI_HAVE_PRIVILEGE(mask, priv) \ + (((mask) & \ + (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) == \ + (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) + #ifdef __cplusplus } #endif diff --git a/sys/dev/sfxge/common/efx_types.h b/sys/dev/sfxge/common/efx_types.h index ee357b1..f112a4c 100644 --- a/sys/dev/sfxge/common/efx_types.h +++ b/sys/dev/sfxge/common/efx_types.h @@ -1584,7 +1584,7 @@ extern int fix_lint; #define EFX_OR_BYTE(_byte1, _byte2) \ do { \ - (_byte1).eb_u8[0] &= (_byte2).eb_u8[0]; \ + (_byte1).eb_u8[0] |= (_byte2).eb_u8[0]; \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) diff --git a/sys/dev/sfxge/common/hunt_ev.c b/sys/dev/sfxge/common/hunt_ev.c index b5585bb..5e6ccab 100644 --- a/sys/dev/sfxge/common/hunt_ev.c +++ b/sys/dev/sfxge/common/hunt_ev.c @@ -829,6 +829,20 @@ hunt_ev_mcdi( MCDI_EV_FIELD(eqp, CMDDONE_ERRNO)); break; +#if EFSYS_OPT_MCDI_PROXY_AUTH + case MCDI_EVENT_CODE_PROXY_RESPONSE: + /* + * This event notifies a function that an authorization request + * has been processed. If the request was authorized then the + * function can now re-send the original MCDI request. + * See SF-113652-SW "SR-IOV Proxied Network Access Control". + */ + efx_mcdi_ev_proxy_response(enp, + MCDI_EV_FIELD(eqp, PROXY_RESPONSE_HANDLE), + MCDI_EV_FIELD(eqp, PROXY_RESPONSE_RC)); + break; +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ + case MCDI_EVENT_CODE_LINKCHANGE: { efx_link_mode_t link_mode; diff --git a/sys/dev/sfxge/common/hunt_impl.h b/sys/dev/sfxge/common/hunt_impl.h index 313912b..1a57596 100644 --- a/sys/dev/sfxge/common/hunt_impl.h +++ b/sys/dev/sfxge/common/hunt_impl.h @@ -298,6 +298,12 @@ hunt_mcdi_link_control_supported( __in efx_nic_t *enp, __out boolean_t *supportedp); +extern __checkReturn efx_rc_t +hunt_mcdi_mac_spoofing_supported( + __in efx_nic_t *enp, + __out boolean_t *supportedp); + + #endif /* EFSYS_OPT_MCDI */ /* NVRAM */ diff --git a/sys/dev/sfxge/common/hunt_mcdi.c b/sys/dev/sfxge/common/hunt_mcdi.c index 592406f..11ad231 100644 --- a/sys/dev/sfxge/common/hunt_mcdi.c +++ b/sys/dev/sfxge/common/hunt_mcdi.c @@ -303,16 +303,8 @@ hunt_mcdi_read_response( hunt_mcdi_request_poll( __in efx_nic_t *enp) { -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif /* EFSYS_OPT_MCDI_LOGGING */ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; - efx_dword_t hdr[2]; - unsigned int hdr_len; - unsigned int data_len; - unsigned int seq; - unsigned int cmd; int state; efx_rc_t rc; @@ -332,101 +324,26 @@ hunt_mcdi_request_poll( } /* Read the response header */ - hdr_len = sizeof (hdr[0]); - hunt_mcdi_read_response(enp, &hdr[0], 0, hdr_len); - - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { - hunt_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); - hdr_len += sizeof (hdr[1]); - - cmd = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_EXTENDED_CMD); - data_len = - EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_ACTUAL_LEN); - } else { - cmd = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE); - data_len = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_DATALEN); - } + efx_mcdi_read_response_header(enp, emrp); /* Request complete */ emip->emi_pending_req = NULL; - seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ); - - /* Check for synchronous reboot */ - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR) != 0 && data_len == 0) { - /* The MC has rebooted since the request was sent. */ - EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US); - hunt_mcdi_poll_reboot(enp); - - EFSYS_UNLOCK(enp->en_eslp, state); - rc = EIO; - goto fail1; - } /* Ensure stale MCDI requests fail after an MC reboot. */ emip->emi_new_epoch = B_FALSE; EFSYS_UNLOCK(enp->en_eslp, state); - /* Check that the returned data is consistent */ - if (cmd != emrp->emr_cmd || - EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_SEQ) != seq) { - /* Response is for a different request */ - rc = EIO; - goto fail2; - } - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR)) { - efx_dword_t err[2]; - unsigned int err_len = MIN(data_len, sizeof (err)); - int err_code = MC_CMD_ERR_EPROTO; - int err_arg = 0; - - /* Read error code (and arg num for MCDI v2 commands) */ - hunt_mcdi_read_response(enp, &err[0], hdr_len, err_len); - - if (err_len >= MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t)) - err_code = EFX_DWORD_FIELD(err[0], EFX_DWORD_0); - - if (err_len >= MC_CMD_ERR_ARG_OFST + sizeof (efx_dword_t)) - err_arg = EFX_DWORD_FIELD(err[1], EFX_DWORD_0); - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, - EFX_LOG_MCDI_RESPONSE, - &hdr, hdr_len, - &err, err_len); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ - - rc = efx_mcdi_request_errcode(err_code); - if (!emrp->emr_quiet) { - EFSYS_PROBE3(mcdi_err_arg, int, emrp->emr_cmd, - int, err_code, int, err_arg); - } - goto fail3; - - } else { - emrp->emr_out_length_used = data_len; - emrp->emr_rc = 0; - hunt_mcdi_request_copyout(enp, emrp); - } + if ((rc = emrp->emr_rc) != 0) + goto fail1; + hunt_mcdi_request_copyout(enp, emrp); goto out; -fail3: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail3); -fail2: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail2); fail1: if (!emrp->emr_quiet) EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* Fill out error state */ - emrp->emr_rc = rc; - emrp->emr_out_length_used = 0; - /* Reboot/Assertion */ if (rc == EIO || rc == EINTR) efx_mcdi_raise_exception(enp, emrp, rc); @@ -495,9 +412,8 @@ hunt_mcdi_fw_update_supported( * Admin privilege must be used prior to introduction of * specific flag. */ - *supportedp = (encp->enc_privilege_mask & - MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) - == MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN; + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(encp->enc_privilege_mask, ADMIN); return (0); } @@ -515,18 +431,43 @@ hunt_mcdi_macaddr_change_supported( /* * Use privilege mask state at MCDI attach. * Admin privilege must be used prior to introduction of - * specific flag (at v4.6). + * mac spoofing privilege (at v4.6), which is used up to + * introduction of change mac spoofing privilege (at v4.7) */ *supportedp = - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) || - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN); + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, CHANGE_MAC) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); return (0); } __checkReturn efx_rc_t +hunt_mcdi_mac_spoofing_supported( + __in efx_nic_t *enp, + __out boolean_t *supportedp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint32_t privilege_mask = encp->enc_privilege_mask; + + EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + + /* + * Use privilege mask state at MCDI attach. + * Admin privilege must be used prior to introduction of + * mac spoofing privilege (at v4.6), which is used up to + * introduction of mac spoofing TX privilege (at v4.7) + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING_TX) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + + return (0); +} + + + __checkReturn efx_rc_t hunt_mcdi_link_control_supported( __in efx_nic_t *enp, __out boolean_t *supportedp) @@ -542,10 +483,8 @@ hunt_mcdi_link_control_supported( * specific flag. */ *supportedp = - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK) || - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN); + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, LINK) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); return (0); } diff --git a/sys/dev/sfxge/common/siena_mcdi.c b/sys/dev/sfxge/common/siena_mcdi.c index 64707ab..557bd54 100644 --- a/sys/dev/sfxge/common/siena_mcdi.c +++ b/sys/dev/sfxge/common/siena_mcdi.c @@ -222,15 +222,8 @@ siena_mcdi_read_response( siena_mcdi_request_poll( __in efx_nic_t *enp) { -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; - efx_dword_t hdr; - unsigned int hdr_len; - unsigned int data_len; - unsigned int seq; int state; efx_rc_t rc; @@ -260,76 +253,19 @@ siena_mcdi_request_poll( } /* Read the response header */ - hdr_len = sizeof (hdr); - siena_mcdi_read_response(enp, &hdr, 0, hdr_len); + efx_mcdi_read_response_header(enp, emrp); /* Request complete */ emip->emi_pending_req = NULL; - seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ); - - /* Check for synchronous reboot */ - if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_ERROR) != 0 && - EFX_DWORD_FIELD(hdr, MCDI_HEADER_DATALEN) == 0) { - /* Consume status word */ - EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US); - siena_mcdi_poll_reboot(enp); - EFSYS_UNLOCK(enp->en_eslp, state); - rc = EIO; - goto fail2; - } EFSYS_UNLOCK(enp->en_eslp, state); - /* Check that the returned data is consistent */ - if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_CODE) != emrp->emr_cmd || - EFX_DWORD_FIELD(hdr, MCDI_HEADER_SEQ) != seq) { - /* Response is for a different request */ - rc = EIO; - goto fail3; - } - - data_len = EFX_DWORD_FIELD(hdr, MCDI_HEADER_DATALEN); - if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_ERROR)) { - efx_dword_t err; - int err_code = MC_CMD_ERR_EPROTO; - unsigned int err_len = MIN(data_len, sizeof (err)); - - /* Read error code */ - siena_mcdi_read_response(enp, &err, hdr_len, err_len); - - if (err_len >= MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t)) - err_code = EFX_DWORD_FIELD(err, EFX_DWORD_0); - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, - EFX_LOG_MCDI_RESPONSE, - &hdr, hdr_len, - &err, err_len); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ - - rc = efx_mcdi_request_errcode(err_code); - if (!emrp->emr_quiet) { - EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd, - int, err_code); - } - goto fail4; - - } else { - emrp->emr_out_length_used = data_len; - emrp->emr_rc = 0; - siena_mcdi_request_copyout(enp, emrp); - } + if ((rc = emrp->emr_rc) != 0) + goto fail2; + siena_mcdi_request_copyout(enp, emrp); goto out; -fail4: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail4); -fail3: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail3); fail2: if (!emrp->emr_quiet) EFSYS_PROBE(fail2); @@ -337,10 +273,6 @@ fail1: if (!emrp->emr_quiet) EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* Fill out error state */ - emrp->emr_rc = rc; - emrp->emr_out_length_used = 0; - /* Reboot/Assertion */ if (rc == EIO || rc == EINTR) efx_mcdi_raise_exception(enp, emrp, rc); diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c index d705267..78ead15 100644 --- a/sys/dev/usb/wlan/if_urtwn.c +++ b/sys/dev/usb/wlan/if_urtwn.c @@ -291,6 +291,7 @@ static void urtwn_set_gain(struct urtwn_softc *, uint8_t); static void urtwn_scan_start(struct ieee80211com *); static void urtwn_scan_end(struct ieee80211com *); static void urtwn_set_channel(struct ieee80211com *); +static int urtwn_wme_update(struct ieee80211com *); static void urtwn_set_promisc(struct urtwn_softc *); static void urtwn_update_promisc(struct ieee80211com *); static void urtwn_update_mcast(struct ieee80211com *); @@ -376,6 +377,16 @@ static const struct usb_config urtwn_config[URTWN_N_TRANSFER] = { }, }; +static const struct wme_to_queue { + uint16_t reg; + uint8_t qid; +} wme2queue[WME_NUM_AC] = { + { R92C_EDCA_BE_PARAM, URTWN_BULK_TX_BE}, + { R92C_EDCA_BK_PARAM, URTWN_BULK_TX_BK}, + { R92C_EDCA_VI_PARAM, URTWN_BULK_TX_VI}, + { R92C_EDCA_VO_PARAM, URTWN_BULK_TX_VO} +}; + static int urtwn_match(device_t self) { @@ -473,6 +484,7 @@ urtwn_attach(device_t self) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_WPA /* 802.11i */ + | IEEE80211_C_WME /* 802.11e */ ; bands = 0; @@ -489,6 +501,7 @@ urtwn_attach(device_t self) ic->ic_parent = urtwn_parent; ic->ic_vap_create = urtwn_vap_create; ic->ic_vap_delete = urtwn_vap_delete; + ic->ic_wme.wme_update = urtwn_wme_update; ic->ic_update_promisc = urtwn_update_promisc; ic->ic_update_mcast = urtwn_update_mcast; @@ -2158,8 +2171,8 @@ urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211_node *ni, struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = ni->ni_vap; struct r92c_tx_desc *txd; - uint8_t macid, raid, ridx, subtype, type, qsel; - int ismcast; + uint8_t macid, raid, ridx, subtype, type, tid, qsel; + int hasqos, ismcast; URTWN_ASSERT_LOCKED(sc); @@ -2169,8 +2182,16 @@ urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211_node *ni, wh = mtod(m, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + hasqos = IEEE80211_QOS_HAS_SEQ(wh); ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); + /* Select TX ring for this frame. */ + if (hasqos) { + tid = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; + tid &= IEEE80211_QOS_TID; + } else + tid = 0; + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { @@ -2199,7 +2220,7 @@ urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211_node *ni, macid = URTWN_MACID_BSS; if (type == IEEE80211_FC0_TYPE_DATA) { - qsel = R92C_TXDW1_QSEL_BE; + qsel = tid % URTWN_MAX_TID; if (!(m->m_flags & M_EAPOL)) { if (ic->ic_curmode != IEEE80211_MODE_11B) { @@ -2255,7 +2276,7 @@ urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211_node *ni, (m->m_flags & M_EAPOL)) txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); - if (!IEEE80211_QOS_HAS_SEQ(wh)) { + if (!hasqos) { /* Use HW sequence numbering for non-QoS frames. */ if (sc->chip & URTWN_CHIP_88E) txd->txdseq = htole16(R88E_TXDSEQ_HWSEQ_EN); @@ -2292,12 +2313,6 @@ urtwn_tx_start(struct urtwn_softc *sc, struct mbuf *m, uint8_t type, struct r92c_tx_desc *txd; uint16_t ac, sum; int i, xferlen; - struct usb_xfer *urtwn_pipes[WME_NUM_AC] = { - sc->sc_xfer[URTWN_BULK_TX_BE], - sc->sc_xfer[URTWN_BULK_TX_BK], - sc->sc_xfer[URTWN_BULK_TX_VI], - sc->sc_xfer[URTWN_BULK_TX_VO] - }; URTWN_ASSERT_LOCKED(sc); @@ -2309,7 +2324,7 @@ urtwn_tx_start(struct urtwn_softc *sc, struct mbuf *m, uint8_t type, xfer = sc->sc_xfer[URTWN_BULK_TX_VO]; break; default: - xfer = urtwn_pipes[ac]; + xfer = sc->sc_xfer[wme2queue[ac].qid]; break; } @@ -3598,6 +3613,43 @@ urtwn_set_channel(struct ieee80211com *ic) URTWN_UNLOCK(sc); } +static int +urtwn_wme_update(struct ieee80211com *ic) +{ + const struct wmeParams *wmep = + ic->ic_wme.wme_chanParams.cap_wmeParams; + struct urtwn_softc *sc = ic->ic_softc; + uint8_t aifs, acm, slottime; + int ac; + + acm = 0; + slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? + IEEE80211_DUR_SHSLOT : IEEE80211_DUR_SLOT; + + URTWN_LOCK(sc); + for (ac = WME_AC_BE; ac < WME_NUM_AC; ac++) { + /* AIFS[AC] = AIFSN[AC] * aSlotTime + aSIFSTime. */ + aifs = wmep[ac].wmep_aifsn * slottime + IEEE80211_DUR_SIFS; + urtwn_write_4(sc, wme2queue[ac].reg, + SM(R92C_EDCA_PARAM_TXOP, wmep[ac].wmep_txopLimit) | + SM(R92C_EDCA_PARAM_ECWMIN, wmep[ac].wmep_logcwmin) | + SM(R92C_EDCA_PARAM_ECWMAX, wmep[ac].wmep_logcwmax) | + SM(R92C_EDCA_PARAM_AIFS, aifs)); + if (ac != WME_AC_BE) + acm |= wmep[ac].wmep_acm << ac; + } + + if (acm != 0) + acm |= R92C_ACMHWCTRL_EN; + urtwn_write_1(sc, R92C_ACMHWCTRL, + (urtwn_read_1(sc, R92C_ACMHWCTRL) & ~R92C_ACMHWCTRL_ACM_MASK) | + acm); + + URTWN_UNLOCK(sc); + + return 0; +} + static void urtwn_set_promisc(struct urtwn_softc *sc) { diff --git a/sys/dev/usb/wlan/if_urtwnreg.h b/sys/dev/usb/wlan/if_urtwnreg.h index 75a65f7..993a00b 100644 --- a/sys/dev/usb/wlan/if_urtwnreg.h +++ b/sys/dev/usb/wlan/if_urtwnreg.h @@ -503,6 +503,13 @@ #define R92C_DUAL_TSF_RST0 0x01 #define R92C_DUAL_TSF_RST1 0x02 +/* Bits for R92C_ACMHWCTRL. */ +#define R92C_ACMHWCTRL_EN 0x01 +#define R92C_ACMHWCTRL_BE 0x02 +#define R92C_ACMHWCTRL_VI 0x04 +#define R92C_ACMHWCTRL_VO 0x08 +#define R92C_ACMHWCTRL_ACM_MASK 0x0f + /* Bits for R92C_APSD_CTRL. */ #define R92C_APSD_CTRL_OFF 0x40 #define R92C_APSD_CTRL_OFF_STATUS 0x80 diff --git a/sys/dev/usb/wlan/if_urtwnvar.h b/sys/dev/usb/wlan/if_urtwnvar.h index 6e0b149..8901c75 100644 --- a/sys/dev/usb/wlan/if_urtwnvar.h +++ b/sys/dev/usb/wlan/if_urtwnvar.h @@ -140,7 +140,6 @@ struct urtwn_softc { struct usb_device *sc_udev; uint8_t sc_iface_index; - int ac2idx[WME_NUM_AC]; u_int sc_flags; #define URTWN_FLAG_CCK_HIPWR 0x01 #define URTWN_DETACHED 0x02 diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index 17a6985..339ee6f 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -299,8 +299,10 @@ static void cubic_post_recovery(struct cc_var *ccv) { struct cubic *cubic_data; + int pipe; cubic_data = ccv->cc_data; + pipe = 0; /* Fast convergence heuristic. */ if (cubic_data->max_cwnd < cubic_data->prev_max_cwnd) @@ -315,10 +317,13 @@ cubic_post_recovery(struct cc_var *ccv) * * XXXLAS: Find a way to do this without needing curack */ - if (SEQ_GT(ccv->curack + CCV(ccv, snd_ssthresh), - CCV(ccv, snd_max))) - CCV(ccv, snd_cwnd) = CCV(ccv, snd_max) - ccv->curack + - CCV(ccv, t_maxseg); + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(ccv->ccvc.tcp); + else + pipe = CCV(ccv, snd_max) - ccv->curack; + + if (pipe < CCV(ccv, snd_ssthresh)) + CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg); else /* Update cwnd based on beta and adjusted max_cwnd. */ CCV(ccv, snd_cwnd) = max(1, ((CUBIC_BETA * diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 96d64fe..31b70cc 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -214,6 +214,9 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) static void newreno_post_recovery(struct cc_var *ccv) { + int pipe; + pipe = 0; + if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { /* * Fast recovery will conclude after returning from this @@ -224,10 +227,13 @@ newreno_post_recovery(struct cc_var *ccv) * * XXXLAS: Find a way to do this without needing curack */ - if (SEQ_GT(ccv->curack + CCV(ccv, snd_ssthresh), - CCV(ccv, snd_max))) - CCV(ccv, snd_cwnd) = CCV(ccv, snd_max) - - ccv->curack + CCV(ccv, t_maxseg); + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(ccv->ccvc.tcp); + else + pipe = CCV(ccv, snd_max) - ccv->curack; + + if (pipe < CCV(ccv, snd_ssthresh)) + CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg); else CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); } diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 1dfa244..72c2a60 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -671,7 +672,6 @@ in_arpinput(struct mbuf *m) struct arphdr *ah; struct ifnet *ifp = m->m_pkthdr.rcvif; struct llentry *la = NULL, *la_tmp; - struct rtentry *rt; struct ifaddr *ifa; struct in_ifaddr *ia; struct sockaddr sa; @@ -682,6 +682,8 @@ in_arpinput(struct mbuf *m) int carped; struct sockaddr_in sin; struct sockaddr *dst; + struct nhop4_basic nh4; + sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr.s_addr = 0; @@ -921,10 +923,8 @@ reply: if (!V_arp_proxyall) goto drop; - sin.sin_addr = itaddr; /* XXX MRT use table 0 for arp reply */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) + if (fib4_lookup_nh_basic(0, itaddr, 0, 0, &nh4) != 0) goto drop; /* @@ -932,11 +932,8 @@ reply: * as this one came out of, or we'll get into a fight * over who claims what Ether address. */ - if (!rt->rt_ifp || rt->rt_ifp == ifp) { - RTFREE_LOCKED(rt); + if (nh4.nh_ifp == ifp) goto drop; - } - RTFREE_LOCKED(rt); (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); @@ -947,21 +944,16 @@ reply: * avoids ARP chaos if an interface is connected to the * wrong network. */ - sin.sin_addr = isaddr; /* XXX MRT use table 0 for arp checks */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) + if (fib4_lookup_nh_basic(0, isaddr, 0, 0, &nh4) != 0) goto drop; - if (rt->rt_ifp != ifp) { + if (nh4.nh_ifp != ifp) { ARP_LOG(LOG_INFO, "proxy: ignoring request" - " from %s via %s, expecting %s\n", - inet_ntoa(isaddr), ifp->if_xname, - rt->rt_ifp->if_xname); - RTFREE_LOCKED(rt); + " from %s via %s\n", + inet_ntoa(isaddr), ifp->if_xname); goto drop; } - RTFREE_LOCKED(rt); #ifdef DEBUG_PROXY printf("arp: proxying for %s\n", inet_ntoa(itaddr)); diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 5c65ce0..f2a985b 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1883,6 +1884,8 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, { struct rm_priotracker in_ifa_tracker; struct ifnet *ifp; + struct nhop4_basic nh4; + uint32_t fibnum; KASSERT(gsin->sin_family == AF_INET, ("%s: not AF_INET", __func__)); KASSERT(IN_MULTICAST(ntohl(gsin->sin_addr.s_addr)), @@ -1892,16 +1895,10 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, if (!in_nullhost(ina)) { INADDR_TO_IFP(ina, ifp); } else { - struct route ro; - - ro.ro_rt = NULL; - memcpy(&ro.ro_dst, gsin, sizeof(struct sockaddr_in)); - in_rtalloc_ign(&ro, 0, inp ? inp->inp_inc.inc_fibnum : 0); - if (ro.ro_rt != NULL) { - ifp = ro.ro_rt->rt_ifp; - KASSERT(ifp != NULL, ("%s: null ifp", __func__)); - RTFREE(ro.ro_rt); - } else { + fibnum = inp ? inp->inp_inc.inc_fibnum : 0; + if (fib4_lookup_nh_basic(fibnum, gsin->sin_addr, 0, 0, &nh4)==0) + ifp = nh4.nh_ifp; + else { struct in_ifaddr *ia; struct ifnet *mifp; diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 57553f5..6e6202a 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -655,6 +656,7 @@ icmp_reflect(struct mbuf *m) struct ifnet *ifp; struct in_ifaddr *ia; struct in_addr t; + struct nhop4_extended nh_ext; struct mbuf *opts = 0; int optlen = (ip->ip_hl << 2) - sizeof(struct ip); @@ -748,14 +750,12 @@ icmp_reflect(struct mbuf *m) * When we don't have a route back to the packet source, stop here * and drop the packet. */ - ia = ip_rtaddr(ip->ip_dst, M_GETFIB(m)); - if (ia == NULL) { + if (fib4_lookup_nh_ext(M_GETFIB(m), ip->ip_dst, 0, 0, &nh_ext) != 0) { m_freem(m); ICMPSTAT_INC(icps_noroute); goto done; } - t = IA_SIN(ia)->sin_addr; - ifa_free(&ia->ia_ifa); + t = nh_ext.nh_src; match: #ifdef MAC mac_netinet_icmp_replyinplace(m); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index edcafd5..6f25e08 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -878,33 +878,6 @@ ipproto_unregister(short ipproto) return (0); } -/* - * Given address of next destination (final or next hop), return (referenced) - * internet address info of interface to be used to get there. - */ -struct in_ifaddr * -ip_rtaddr(struct in_addr dst, u_int fibnum) -{ - struct route sro; - struct sockaddr_in *sin; - struct in_ifaddr *ia; - - bzero(&sro, sizeof(sro)); - sin = (struct sockaddr_in *)&sro.ro_dst; - sin->sin_family = AF_INET; - sin->sin_len = sizeof(*sin); - sin->sin_addr = dst; - in_rtalloc_ign(&sro, 0, fibnum); - - if (sro.ro_rt == NULL) - return (NULL); - - ia = ifatoia(sro.ro_rt->rt_ifa); - ifa_ref(&ia->ia_ifa); - RTFREE(sro.ro_rt); - return (ia); -} - u_char inetctlerrmap[PRC_NCMDS] = { 0, 0, 0, 0, 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c index 6db9c91..5daf653 100644 --- a/sys/netinet/ip_options.c +++ b/sys/netinet/ip_options.c @@ -290,15 +290,19 @@ dropit: * destination, use the incoming interface (should be * same). */ - if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == NULL && - (ia = ip_rtaddr(ipaddr.sin_addr, M_GETFIB(m))) == NULL) { + if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) != NULL) { + memcpy(cp + off, &(IA_SIN(ia)->sin_addr), + sizeof(struct in_addr)); + ifa_free(&ia->ia_ifa); + } else if (fib4_lookup_nh_ext(M_GETFIB(m), + ipaddr.sin_addr, 0, 0, &nh_ext) == 0) { + memcpy(cp + off, &nh_ext.nh_src, + sizeof(struct in_addr)); + } else { type = ICMP_UNREACH; code = ICMP_UNREACH_HOST; goto bad; } - (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr), - sizeof(struct in_addr)); - ifa_free(&ia->ia_ifa); cp[IPOPT_OFFSET] += sizeof(struct in_addr); break; diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index 3416805..f4ad4ff 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -222,8 +222,6 @@ int ipproto_register(short); int ipproto_unregister(short); struct mbuf * ip_reass(struct mbuf *); -struct in_ifaddr * - ip_rtaddr(struct in_addr, u_int fibnum); void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *, struct mbuf *); void ip_slowtimo(void); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 652ca07..a298edf 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -78,6 +78,7 @@ struct sackhint { * Total sacked bytes reported by the * receiver via sack option */ + uint32_t _pad1[1]; /* TBD */ uint64_t _pad[1]; /* TBD */ }; diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index c918e69..f0c5371 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -100,6 +100,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -2289,7 +2290,6 @@ icmp6_redirect_input(struct mbuf *m, int off) int icmp6len = ntohs(ip6->ip6_plen); char *lladdr = NULL; int lladdrlen = 0; - struct rtentry *rt = NULL; int is_router; int is_onlink; struct in6_addr src6 = ip6->ip6_src; @@ -2344,18 +2344,13 @@ icmp6_redirect_input(struct mbuf *m, int off) } { /* ip6->ip6_src must be equal to gw for icmp6->icmp6_reddst */ - struct sockaddr_in6 sin6; - struct in6_addr *gw6; - - bzero(&sin6, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - bcopy(&reddst6, &sin6.sin6_addr, sizeof(reddst6)); - rt = in6_rtalloc1((struct sockaddr *)&sin6, 0, 0UL, RT_DEFAULT_FIB); - if (rt) { - if (rt->rt_gateway == NULL || - rt->rt_gateway->sa_family != AF_INET6) { - RTFREE_LOCKED(rt); + struct nhop6_basic nh6; + struct in6_addr kdst; + uint32_t scopeid; + + in6_splitscope(&reddst6, &kdst, &scopeid); + if (fib6_lookup_nh_basic(RT_DEFAULT_FIB, &kdst, scopeid, 0, 0,&nh6)==0){ + if ((nh6.nh_flags & NHF_GATEWAY) == 0) { nd6log((LOG_ERR, "ICMP6 redirect rejected; no route " "with inet6 gateway found for redirect dst: %s\n", @@ -2363,14 +2358,12 @@ icmp6_redirect_input(struct mbuf *m, int off) goto bad; } - gw6 = &(((struct sockaddr_in6 *)rt->rt_gateway)->sin6_addr); - if (bcmp(&src6, gw6, sizeof(struct in6_addr)) != 0) { - RTFREE_LOCKED(rt); + if (IN6_ARE_ADDR_EQUAL(&src6, &nh6.nh_addr) == 0) { nd6log((LOG_ERR, "ICMP6 redirect rejected; " "not equal to gw-for-src=%s (must be same): " "%s\n", - ip6_sprintf(ip6buf, gw6), + ip6_sprintf(ip6buf, &nh6.nh_addr), icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); goto bad; } @@ -2381,8 +2374,6 @@ icmp6_redirect_input(struct mbuf *m, int off) icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); goto bad; } - RTFREE_LOCKED(rt); - rt = NULL; } if (IN6_IS_ADDR_MULTICAST(&reddst6)) { nd6log((LOG_ERR, diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index cae186d..b168a53 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix); @@ -2144,17 +2145,22 @@ in6_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr) { - struct rtentry *rt; + const struct sockaddr_in6 *sin6; + struct nhop6_basic nh6; + struct in6_addr dst; + uint32_t scopeid; + int error; char ip6buf[INET6_ADDRSTRLEN]; KASSERT(l3addr->sa_family == AF_INET6, ("sin_family %d", l3addr->sa_family)); /* Our local addresses are always only installed on the default FIB. */ - /* XXX rtalloc1 should take a const param */ - rt = in6_rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0, - RT_DEFAULT_FIB); - if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || rt->rt_ifp != ifp) { + + sin6 = (const struct sockaddr_in6 *)l3addr; + in6_splitscope(&sin6->sin6_addr, &dst, &scopeid); + error = fib6_lookup_nh_basic(RT_DEFAULT_FIB, &dst, scopeid, 0, 0, &nh6); + if (error != 0 || (nh6.nh_flags & NHF_GATEWAY) || nh6.nh_ifp != ifp) { struct ifaddr *ifa; /* * Create an ND6 cache for an IPv6 neighbor @@ -2163,17 +2169,12 @@ in6_lltable_rtcheck(struct ifnet *ifp, ifa = ifaof_ifpforaddr(l3addr, ifp); if (ifa != NULL) { ifa_free(ifa); - if (rt != NULL) - RTFREE_LOCKED(rt); return 0; } log(LOG_INFO, "IPv6 address: \"%s\" is not on the network\n", - ip6_sprintf(ip6buf, &((const struct sockaddr_in6 *)l3addr)->sin6_addr)); - if (rt != NULL) - RTFREE_LOCKED(rt); + ip6_sprintf(ip6buf, &sin6->sin6_addr)); return EINVAL; } - RTFREE_LOCKED(rt); return 0; } diff --git a/sys/netinet6/in6_fib.c b/sys/netinet6/in6_fib.c index 70bd1772..eba5b7c 100644 --- a/sys/netinet6/in6_fib.c +++ b/sys/netinet6/in6_fib.c @@ -164,6 +164,7 @@ fib6_rte_to_nh_extended(struct rtentry *rte, const struct in6_addr *dst, * interface "ix0" pointer to "ix0" interface will be returned instead * of "lo0") * - howewer mtu from "transmit" interface will be returned. + * - scope will be embedded in nh_addr */ int fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scopeid, @@ -182,6 +183,7 @@ fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scope /* Prepare lookup key */ memset(&sin6, 0, sizeof(sin6)); sin6.sin6_addr = *dst; + sin6.sin6_len = sizeof(struct sockaddr_in6); /* Assume scopeid is valid and embed it directly */ if (IN6_IS_SCOPE_LINKLOCAL(dst)) sin6.sin6_addr.s6_addr16[1] = htons(scopeid & 0xffff); @@ -192,7 +194,7 @@ fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scope rte = RNTORT(rn); /* Ensure route & ifp is UP */ if (RT_LINK_IS_UP(rte->rt_ifp)) { - fib6_rte_to_nh_basic(rte, dst, flags, pnh6); + fib6_rte_to_nh_basic(rte, &sin6.sin6_addr, flags, pnh6); RADIX_NODE_HEAD_RUNLOCK(rh); return (0); } @@ -211,6 +213,7 @@ fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scope * - nh_ifp represents logical transmit interface (rt_ifp) by default * - nh_ifp represents "address" interface if NHR_IFAIF flag is passed * - mtu from logical transmit interface will be returned. + * - scope will be embedded in nh_addr */ int fib6_lookup_nh_ext(uint32_t fibnum, const struct in6_addr *dst,uint32_t scopeid, @@ -240,7 +243,8 @@ fib6_lookup_nh_ext(uint32_t fibnum, const struct in6_addr *dst,uint32_t scopeid, rte = RNTORT(rn); /* Ensure route & ifp is UP */ if (RT_LINK_IS_UP(rte->rt_ifp)) { - fib6_rte_to_nh_extended(rte, dst, flags, pnh6); + fib6_rte_to_nh_extended(rte, &sin6.sin6_addr, flags, + pnh6); if ((flags & NHR_REF) != 0) { /* TODO: Do lwref on egress ifp's */ } diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 76ab400..e6901ba 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -205,10 +205,10 @@ in6_gif_encapcheck(const struct mbuf *m, int off, int proto, void *arg) /* ingress filters on outer source */ if ((GIF2IFP(sc)->if_flags & IFF_LINK2) == 0) { struct nhop6_basic nh6; - struct in6_addr *dst; /* XXX empty scope id */ - if (fib6_lookup_nh_basic(sc->gif_fibnum, dst, 0, 0, 0, &nh6)!=0) + if (fib6_lookup_nh_basic(sc->gif_fibnum, &ip6->ip6_src, 0, 0, 0, + &nh6) != 0) return (0); if (nh6.nh_ifp != m->m_pkthdr.rcvif) diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index 131130f..9d96cf5 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1772,26 +1773,22 @@ static struct ifnet * in6p_lookup_mcast_ifp(const struct inpcb *in6p, const struct sockaddr_in6 *gsin6) { - struct route_in6 ro6; - struct ifnet *ifp; + struct nhop6_basic nh6; + struct in6_addr dst; + uint32_t scopeid; + uint32_t fibnum; KASSERT(in6p->inp_vflag & INP_IPV6, ("%s: not INP_IPV6 inpcb", __func__)); KASSERT(gsin6->sin6_family == AF_INET6, ("%s: not AF_INET6 group", __func__)); - ifp = NULL; - memset(&ro6, 0, sizeof(struct route_in6)); - memcpy(&ro6.ro_dst, gsin6, sizeof(struct sockaddr_in6)); - rtalloc_ign_fib((struct route *)&ro6, 0, - in6p ? in6p->inp_inc.inc_fibnum : RT_DEFAULT_FIB); - if (ro6.ro_rt != NULL) { - ifp = ro6.ro_rt->rt_ifp; - KASSERT(ifp != NULL, ("%s: null ifp", __func__)); - RTFREE(ro6.ro_rt); - } + in6_splitscope(&gsin6->sin6_addr, &dst, &scopeid); + fibnum = in6p ? in6p->inp_inc.inc_fibnum : RT_DEFAULT_FIB; + if (fib6_lookup_nh_basic(fibnum, &dst, scopeid, 0, 0, &nh6) != 0) + return (NULL); - return (ifp); + return (nh6.nh_ifp); } /* diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 020c5cf..c2e26f8f 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -105,6 +105,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -860,19 +861,16 @@ in6_selecthlim(struct inpcb *in6p, struct ifnet *ifp) else if (ifp) return (ND_IFINFO(ifp)->chlim); else if (in6p && !IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) { - struct route_in6 ro6; - struct ifnet *lifp; - - bzero(&ro6, sizeof(ro6)); - ro6.ro_dst.sin6_family = AF_INET6; - ro6.ro_dst.sin6_len = sizeof(struct sockaddr_in6); - ro6.ro_dst.sin6_addr = in6p->in6p_faddr; - in6_rtalloc(&ro6, in6p->inp_inc.inc_fibnum); - if (ro6.ro_rt) { - lifp = ro6.ro_rt->rt_ifp; - RTFREE(ro6.ro_rt); - if (lifp) - return (ND_IFINFO(lifp)->chlim); + struct nhop6_basic nh6; + struct in6_addr dst; + uint32_t fibnum, scopeid; + int hlim; + + fibnum = in6p->inp_inc.inc_fibnum; + in6_splitscope(&in6p->in6p_faddr, &dst, &scopeid); + if (fib6_lookup_nh_basic(fibnum, &dst, scopeid, 0, 0, &nh6)==0){ + hlim = ND_IFINFO(nh6.nh_ifp)->chlim; + return (hlim); } } return (V_ip6_defhlim); diff --git a/tools/tools/ioat/ioatcontrol.8 b/tools/tools/ioat/ioatcontrol.8 index 2306d38..002759f 100644 --- a/tools/tools/ioat/ioatcontrol.8 +++ b/tools/tools/ioat/ioatcontrol.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2015 +.Dd December 9, 2015 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -33,7 +33,9 @@ .Xr ioat 4 .Sh SYNOPSIS .Nm +.Op Fl E .Op Fl f +.Op Fl m .Op Fl V .Ar channel_number .Ar num_txns @@ -55,10 +57,14 @@ allows one to issue some number of test operations to the driver on a specific hardware channel. The arguments are as follows: .Bl -tag -width Ds +.It Fl E +Test non-contiguous 8k copy. .It Fl f Test block fill (by default, .Nm tests copy) +.It Fl m +Test memcpy instead of DMA. .It Fl V Verify copies/fills for accuracy .El diff --git a/tools/tools/ioat/ioatcontrol.c b/tools/tools/ioat/ioatcontrol.c index 90255e7..d40ae15 100644 --- a/tools/tools/ioat/ioatcontrol.c +++ b/tools/tools/ioat/ioatcontrol.c @@ -48,7 +48,7 @@ static void usage(void) { - printf("Usage: %s [-fV] [ " + printf("Usage: %s [-E|-f|-m] [-V] [ " "[ [duration]]]\n", getprogname()); printf(" %s -r [-vV] []\n", getprogname()); @@ -97,15 +97,29 @@ main(int argc, char **argv) { struct ioat_test t; int fd, ch; - bool fflag, rflag; + bool fflag, rflag, Eflag, mflag; + unsigned modeflags; - while ((ch = getopt(argc, argv, "rfvVw")) != -1) { + fflag = rflag = Eflag = mflag = false; + modeflags = 0; + + while ((ch = getopt(argc, argv, "EfmrvVw")) != -1) { switch (ch) { + case 'E': + Eflag = true; + modeflags++; + break; case 'f': fflag = true; + modeflags++; + break; + case 'm': + mflag = true; + modeflags++; break; case 'r': rflag = true; + modeflags++; break; case 'v': t.raw_is_virtual = true; @@ -126,8 +140,8 @@ main(int argc, char **argv) if (argc < 2) usage(); - if (rflag && fflag) { - printf("Invalid: -r and -f\n"); + if (modeflags > 1) { + printf("Invalid: Cannot use >1 mode flag (-E, -f, -m, or -r)\n"); usage(); } @@ -139,6 +153,11 @@ main(int argc, char **argv) if (fflag) t.testkind = IOAT_TEST_FILL; + else if (Eflag) { + t.testkind = IOAT_TEST_DMA_8K; + t.buffer_size = 8 * 1024; + } else if (mflag) + t.testkind = IOAT_TEST_MEMCPY; t.channel_index = atoi(argv[0]); if (t.channel_index > 8) { diff --git a/usr.bin/clang/lldb/Makefile b/usr.bin/clang/lldb/Makefile index 7a052a7..1b014e6 100644 --- a/usr.bin/clang/lldb/Makefile +++ b/usr.bin/clang/lldb/Makefile @@ -161,6 +161,6 @@ LIBDEPS=\ llvmcore \ llvmsupport -.include "../clang.prog.mk" +LIBADD+= pthread -LDADD+= -lpthread +.include "../clang.prog.mk" diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index 195e59c..170ce0d 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -110,6 +110,7 @@ #include #include #include +#include #include #include #include @@ -135,6 +136,8 @@ struct device_selection *dev_select; int maxshowdevs; volatile sig_atomic_t headercount; volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +volatile sig_atomic_t alarm_rang; +volatile sig_atomic_t return_requested; unsigned short wrows; /* Current number of tty rows. */ int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; int xflag = 0, zflag = 0; @@ -143,6 +146,8 @@ int xflag = 0, zflag = 0; static void usage(void); static void needhdr(int signo); static void needresize(int signo); +static void needreturn(int signo); +static void alarm_clock(int signo); static void doresize(void); static void phdr(void); static void devstats(int perf_select, long double etime, int havelast); @@ -172,6 +177,7 @@ main(int argc, char **argv) int count = 0, waittime = 0; char *memf = NULL, *nlistf = NULL; struct devstat_match *matches; + struct itimerval alarmspec; int num_matches = 0; char errbuf[_POSIX2_LINE_MAX]; kvm_t *kd = NULL; @@ -442,10 +448,28 @@ main(int argc, char **argv) wrows = IOSTAT_DEFAULT_ROWS; } + /* + * Register a SIGINT handler so that we can print out final statistics + * when we get that signal + */ + (void)signal(SIGINT, needreturn); + + /* + * Register a SIGALRM handler to implement sleeps if the user uses the + * -c or -w options + */ + (void)signal(SIGALRM, alarm_clock); + alarmspec.it_interval.tv_sec = waittime / 1000; + alarmspec.it_interval.tv_usec = 1000 * (waittime % 1000); + alarmspec.it_value.tv_sec = waittime / 1000; + alarmspec.it_value.tv_usec = 1000 * (waittime % 1000); + setitimer(ITIMER_REAL, &alarmspec, NULL); + for (headercount = 1;;) { struct devinfo *tmp_dinfo; long tmp; long double etime; + sigset_t sigmask, oldsigmask; if (Tflag > 0) { if ((readvar(kd, "kern.tty_nin", X_TTY_NIN, &cur.tk_nin, @@ -599,10 +623,23 @@ main(int argc, char **argv) } fflush(stdout); - if (count >= 0 && --count <= 0) + if ((count >= 0 && --count <= 0) || return_requested) break; - usleep(waittime * 1000); + /* + * Use sigsuspend to safely sleep until either signal is + * received + */ + alarm_rang = 0; + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGINT); + sigaddset(&sigmask, SIGALRM); + sigprocmask(SIG_BLOCK, &sigmask, &oldsigmask); + while (! (alarm_rang || return_requested) ) { + sigsuspend(&oldsigmask); + } + sigprocmask(SIG_UNBLOCK, &sigmask, NULL); + havelast = 1; } @@ -633,6 +670,24 @@ needresize(int signo) } /* + * Record the alarm so the main loop can break its sleep + */ +void +alarm_clock(int signo) +{ + alarm_rang = 1; +} + +/* + * Request that the main loop exit soon + */ +void +needreturn(int signo) +{ + return_requested = 1; +} + +/* * Update the global `wrows' count of terminal rows. */ void diff --git a/usr.sbin/pmcstudy/pmcstudy.8 b/usr.sbin/pmcstudy/pmcstudy.8 index 4ddb3e4..7c03897 100644 --- a/usr.sbin/pmcstudy/pmcstudy.8 +++ b/usr.sbin/pmcstudy/pmcstudy.8 @@ -32,7 +32,7 @@ .Nd Perform various studies on a system's overall PMCs. .Sh SYNOPSIS .Nm -.Oo Fl i Ar inputfile | Fl T | Fl v | Fl m Ar max | Fl e exp | Fl Ar E | Fl h | fl H Oc +.Oo Fl i Ar inputfile | Fl A | Fl T | Fl v | Fl m Ar max | Fl e exp | Fl Ar E | Fl h | fl H Oc .Nm .Fl i Ar inputfile .Nm @@ -59,8 +59,8 @@ PMCs and then run various formulas on the output information. These formulas can be found in Intel documentation "Using Intel Vtune amplifier xe on NNN Generation Intel Core Processors". The NNN is either -2nd, 3rd or 4th generation i.e., Sandy Bridge, Ivy Bridge and Haswell. -Currently the program only works on these three Intel processor types. +2nd, 3rd, 4th or 5th generation i.e., Sandy Bridge, Ivy Bridge, Haswell and Broadwell. +Currently the program only works on these four Intel processor types. .Sh OPTIONS The following options are available: .Bl -tag -width indent @@ -128,6 +128,8 @@ test like "UOPS_RETIRED.RETIRE_SLOTS / (4 * CPU_CLK_UNHALTED.THREAD_P)". .It Fl L This option will list all known PMCs and their abbreviation (%NNN). +.It Fl A +Run all canned tests. .El .Sh SEE ALSO .Xr pmc 3 , diff --git a/usr.sbin/pmcstudy/pmcstudy.c b/usr.sbin/pmcstudy/pmcstudy.c index 1a3da45..16c9f51 100644 --- a/usr.sbin/pmcstudy/pmcstudy.c +++ b/usr.sbin/pmcstudy/pmcstudy.c @@ -38,6 +38,9 @@ #include "eval_expr.h" __FBSDID("$FreeBSD$"); +static int max_pmc_counters = 1; +static int run_all = 0; + #define MAX_COUNTER_SLOTS 1024 #define MAX_NLEN 64 #define MAX_CPU 64 @@ -191,9 +194,9 @@ struct cpu_entry { const char *thresh; const char *command; int (*func)(struct counters *, int); + int counters_required; }; - struct cpu_type { char cputype[32]; int number; @@ -217,10 +220,10 @@ explain_name_sb(const char *name) printf("Examine (20 * BR_MISP_RETIRED.ALL_BRANCHES)/CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .2"; } else if (strcmp(name, "splitload") == 0) { - printf("Examine MEM_UOP_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); + printf("Examine MEM_UOPS_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .1"; } else if (strcmp(name, "splitstore") == 0) { - printf("Examine MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES\n"); + printf("Examine MEM_UOPS_RETIRED.SPLIT_STORES / MEM_UOPS_RETIRED.ALL_STORES\n"); mythresh = "thresh >= .01"; } else if (strcmp(name, "contested") == 0) { printf("Examine (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60) / CPU_CLK_UNHALTED.THREAD_P\n"); @@ -323,7 +326,7 @@ explain_name_ib(const char *name) printf(" LD_BLOCKS.NO_SR)/CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .1"; } else if (strcmp(name, "splitstore") == 0) { - printf("Examine MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES\n"); + printf("Examine MEM_UOPS_RETIRED.SPLIT_STORES / MEM_UOPS_RETIRED.ALL_STORES\n"); mythresh = "thresh >= .01"; } else if (strcmp(name, "aliasing_4k") == 0) { printf("Examine (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); @@ -403,10 +406,10 @@ explain_name_has(const char *name) printf("Examine (LD_BLOCKS_STORE_FORWARD * 13) / CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .05"; } else if (strcmp(name, "splitload") == 0) { - printf("Examine (MEM_UOP_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); + printf("Examine (MEM_UOPS_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .1"; } else if (strcmp(name, "splitstore") == 0) { - printf("Examine MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES\n"); + printf("Examine MEM_UOPS_RETIRED.SPLIT_STORES / MEM_UOPS_RETIRED.ALL_STORES\n"); mythresh = "thresh >= .01"; } else if (strcmp(name, "aliasing_4k") == 0) { printf("Examine (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); @@ -444,6 +447,7 @@ explain_name_has(const char *name) } + static struct counters * find_counter(struct counters *base, const char *name) { @@ -589,6 +593,48 @@ br_mispredictib(struct counters *cpu, int pos) return(ret); } + +static int +br_mispredict_broad(struct counters *cpu, int pos) +{ + struct counters *brctr; + struct counters *unhalt; + struct counters *clear; + struct counters *uops; + struct counters *uops_ret; + struct counters *recv; + int ret; + double br, cl, uo, uo_r, re, con, un, res; + + con = 4.0; + + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); + clear = find_counter(cpu, "MACHINE_CLEARS.CYCLES"); + uops = find_counter(cpu, "UOPS_ISSUED.ANY"); + uops_ret = find_counter(cpu, "UOPS_RETIRED.RETIRE_SLOTS"); + recv = find_counter(cpu, "INT_MISC.RECOVERY_CYCLES"); + + if (pos != -1) { + un = unhalt->vals[pos] * 1.0; + br = brctr->vals[pos] * 1.0; + cl = clear->vals[pos] * 1.0; + uo = uops->vals[pos] * 1.0; + uo_r = uops_ret->vals[pos] * 1.0; + re = recv->vals[pos] * 1.0; + } else { + un = unhalt->sum * 1.0; + br = brctr->sum * 1.0; + cl = clear->sum * 1.0; + uo = uops->sum * 1.0; + uo_r = uops_ret->sum * 1.0; + re = recv->sum * 1.0; + } + res = br / (br + cl) * (uo - uo_r + con * re) / (un * con); + ret = printf("%1.3f", res); + return(ret); +} + static int splitloadib(struct counters *cpu, int pos) { @@ -622,6 +668,7 @@ splitloadib(struct counters *cpu, int pos) return(ret); } + static int splitload(struct counters *cpu, int pos) { @@ -629,6 +676,31 @@ splitload(struct counters *cpu, int pos) struct counters *mem; struct counters *unhalt; double con, un, memd, res; +/* 4 - (MEM_UOPS_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .1)*/ + + con = 5.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + mem = find_counter(cpu, "MEM_UOPS_RETIRED.SPLIT_LOADS"); + if (pos != -1) { + memd = mem->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + memd = mem->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = (memd * con)/un; + ret = printf("%1.3f", res); + return(ret); +} + + +static int +splitload_sb(struct counters *cpu, int pos) +{ + int ret; + struct counters *mem; + struct counters *unhalt; + double con, un, memd, res; /* 4 - (MEM_UOP_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .1)*/ con = 5.0; @@ -646,8 +718,9 @@ splitload(struct counters *cpu, int pos) return(ret); } + static int -splitstore(struct counters *cpu, int pos) +splitstore_sb(struct counters *cpu, int pos) { /* 5 - MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES (thresh > 0.01) */ int ret; @@ -669,6 +742,30 @@ splitstore(struct counters *cpu, int pos) } + +static int +splitstore(struct counters *cpu, int pos) +{ + /* 5 - MEM_UOPS_RETIRED.SPLIT_STORES / MEM_UOPS_RETIRED.ALL_STORES (thresh > 0.01) */ + int ret; + struct counters *mem_split; + struct counters *mem_stores; + double memsplit, memstore, res; + mem_split = find_counter(cpu, "MEM_UOPS_RETIRED.SPLIT_STORES"); + mem_stores = find_counter(cpu, "MEM_UOPS_RETIRED.ALL_STORES"); + if (pos != -1) { + memsplit = mem_split->vals[pos] * 1.0; + memstore = mem_stores->vals[pos] * 1.0; + } else { + memsplit = mem_split->sum * 1.0; + memstore = mem_stores->sum * 1.0; + } + res = memsplit/memstore; + ret = printf("%1.3f", res); + return(ret); +} + + static int contested(struct counters *cpu, int pos) { @@ -717,6 +814,35 @@ contested_has(struct counters *cpu, int pos) return(ret); } +static int +contestedbroad(struct counters *cpu, int pos) +{ + /* 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / CPU_CLK_UNHALTED.THREAD_P (thresh >.05) */ + int ret; + struct counters *mem; + struct counters *mem2; + struct counters *unhalt; + double con, un, memd, memtoo, res; + + con = 84.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + mem = find_counter(cpu, "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM"); + mem2 = find_counter(cpu,"MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS"); + + if (pos != -1) { + memd = mem->vals[pos] * 1.0; + memtoo = mem2->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + memd = mem->sum * 1.0; + memtoo = mem2->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = ((memd * con) + memtoo)/un; + ret = printf("%1.3f", res); + return(ret); +} + static int blockstoreforward(struct counters *cpu, int pos) @@ -897,6 +1023,34 @@ cache2has(struct counters *cpu, int pos) return(ret); } + +static int +cache2broad(struct counters *cpu, int pos) +{ + /* + * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + */ + int ret; + struct counters *mem; + struct counters *unhalt; + double con, un, me, res; + + con = 36.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + mem = find_counter(cpu, "MEM_LOAD_UOPS_RETIRED.L3_HIT"); + if (pos != -1) { + me = mem->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + me = mem->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = (con * me)/un; + ret = printf("%1.3f", res); + return(ret); +} + + static int cache1(struct counters *cpu, int pos) { @@ -947,6 +1101,31 @@ cache1ib(struct counters *cpu, int pos) static int +cache1broad(struct counters *cpu, int pos) +{ + /* 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ + int ret; + struct counters *mem; + struct counters *unhalt; + double con, un, me, res; + + con = 180.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + mem = find_counter(cpu, "MEM_LOAD_UOPS_RETIRED.L3_MISS"); + if (pos != -1) { + me = mem->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + me = mem->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = (me * con)/un; + ret = printf("%1.3f", res); + return(ret); +} + + +static int dtlb_missload(struct counters *cpu, int pos) { /* 10 - ((DTLB_LOAD_MISSES.STLB_HIT * 7) + DTLB_LOAD_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P (t >=.1) */ @@ -1026,6 +1205,35 @@ itlb_miss(struct counters *cpu, int pos) return(ret); } + +static int +itlb_miss_broad(struct counters *cpu, int pos) +{ + /* (7 * ITLB_MISSES.STLB_HIT_4K + ITLB_MISSES.WALK_DURATION) / CPU_CLK_UNTHREAD_P */ + int ret; + struct counters *itlb; + struct counters *unhalt; + struct counters *four_k; + double un, d1, res, k; + + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + itlb = find_counter(cpu, "ITLB_MISSES.WALK_DURATION"); + four_k = find_counter(cpu, "ITLB_MISSES.STLB_HIT_4K"); + if (pos != -1) { + d1 = itlb->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + k = four_k->vals[pos] * 1.0; + } else { + d1 = itlb->sum * 1.0; + un = unhalt->sum * 1.0; + k = four_k->sum * 1.0; + } + res = (7.0 * k + d1)/un; + ret = printf("%1.3f", res); + return(ret); +} + + static int icache_miss(struct counters *cpu, int pos) { @@ -1162,6 +1370,45 @@ clears(struct counters *cpu, int pos) return(ret); } + + +static int +clears_broad(struct counters *cpu, int pos) +{ + int ret; + struct counters *clr1, *clr2, *clr3, *cyc; + struct counters *unhalt; + double con, un, cl1, cl2, cl3, cy, res; + + con = 100.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + clr1 = find_counter(cpu, "MACHINE_CLEARS.MEMORY_ORDERING"); + clr2 = find_counter(cpu, "MACHINE_CLEARS.SMC"); + clr3 = find_counter(cpu, "MACHINE_CLEARS.MASKMOV"); + cyc = find_counter(cpu, "MACHINE_CLEARS.CYCLES"); + if (pos != -1) { + cl1 = clr1->vals[pos] * 1.0; + cl2 = clr2->vals[pos] * 1.0; + cl3 = clr3->vals[pos] * 1.0; + cy = cyc->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + cl1 = clr1->sum * 1.0; + cl2 = clr2->sum * 1.0; + cl3 = clr3->sum * 1.0; + cy = cyc->sum * 1.0; + un = unhalt->sum * 1.0; + } + /* Formula not listed but extrapulated to add the cy ?? */ + res = ((cl1 + cl2 + cl3 + cy) * con)/un; + ret = printf("%1.3f", res); + return(ret); +} + + + + + static int microassist(struct counters *cpu, int pos) { @@ -1188,6 +1435,38 @@ microassist(struct counters *cpu, int pos) static int +microassist_broad(struct counters *cpu, int pos) +{ + int ret; + struct counters *idq; + struct counters *unhalt; + struct counters *uopiss; + struct counters *uopret; + double un, id, res, con, uoi, uor; + + con = 4.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + idq = find_counter(cpu, "IDQ.MS_UOPS"); + uopiss = find_counter(cpu, "UOPS_ISSUED.ANY"); + uopret = find_counter(cpu, "UOPS_RETIRED.RETIRE_SLOTS"); + if (pos != -1) { + id = idq->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + uoi = uopiss->vals[pos] * 1.0; + uor = uopret->vals[pos] * 1.0; + } else { + id = idq->sum * 1.0; + un = unhalt->sum * 1.0; + uoi = uopiss->sum * 1.0; + uor = uopret->sum * 1.0; + } + res = (uor/uoi) * (id/(un * con)); + ret = printf("%1.3f", res); + return(ret); +} + + +static int aliasing(struct counters *cpu, int pos) { /* 15 - (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 5) / CPU_CLK_UNHALTED.THREAD_P (thresh > .1) */ @@ -1212,6 +1491,31 @@ aliasing(struct counters *cpu, int pos) } static int +aliasing_broad(struct counters *cpu, int pos) +{ + /* 15 - (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 5) / CPU_CLK_UNHALTED.THREAD_P (thresh > .1) */ + int ret; + struct counters *ld; + struct counters *unhalt; + double un, lds, con, res; + + con = 7.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + ld = find_counter(cpu, "LD_BLOCKS_PARTIAL.ADDRESS_ALIAS"); + if (pos != -1) { + lds = ld->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + lds = ld->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = (lds * con)/un; + ret = printf("%1.3f", res); + return(ret); +} + + +static int fpassists(struct counters *cpu, int pos) { /* 16 - FP_ASSIST.ANY/INST_RETIRED.ANY_P */ @@ -1336,64 +1640,65 @@ efficiency2(struct counters *cpu, int pos) static struct cpu_entry sandy_bridge[SANDY_BRIDGE_COUNT] = { /*01*/ { "allocstall1", "thresh > .05", "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW -w 1", - allocstall1 }, -/*02*/ { "allocstall2", "thresh > .05", - "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s PARTIAL_RAT_STALLS.FLAGS_MERGE_UOP_CYCLES -w 1", - allocstall2 }, + allocstall1, 2 }, +/* -- not defined for SB right (partial-rat_stalls) 02*/ + { "allocstall2", "thresh > .05", + "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s PARTIAL_RAT_STALLS.FLAGS_MERGE_UOP -w 1", + allocstall2, 2 }, /*03*/ { "br_miss", "thresh >= .2", "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s BR_MISP_RETIRED.ALL_BRANCHES -w 1", - br_mispredict }, + br_mispredict, 2 }, /*04*/ { "splitload", "thresh >= .1", "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s MEM_UOP_RETIRED.SPLIT_LOADS -w 1", - splitload }, -/*05*/ { "splitstore", "thresh >= .01", + splitload_sb, 2 }, +/* 05*/ { "splitstore", "thresh >= .01", "pmcstat -s MEM_UOP_RETIRED.SPLIT_STORES -s MEM_UOP_RETIRED.ALL_STORES -w 1", - splitstore }, + splitstore_sb, 2 }, /*06*/ { "contested", "thresh >= .05", "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM -s CPU_CLK_UNHALTED.THREAD_P -w 1", - contested }, + contested, 2 }, /*07*/ { "blockstorefwd", "thresh >= .05", "pmcstat -s LD_BLOCKS_STORE_FORWARD -s CPU_CLK_UNHALTED.THREAD_P -w 1", - blockstoreforward }, + blockstoreforward, 2 }, /*08*/ { "cache2", "thresh >= .2", "pmcstat -s MEM_LOAD_UOPS_RETIRED.LLC_HIT -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM -s CPU_CLK_UNHALTED.THREAD_P -w 1", - cache2 }, + cache2, 4 }, /*09*/ { "cache1", "thresh >= .2", "pmcstat -s MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS -s CPU_CLK_UNHALTED.THREAD_P -w 1", - cache1 }, + cache1, 2 }, /*10*/ { "dtlbmissload", "thresh >= .1", "pmcstat -s DTLB_LOAD_MISSES.STLB_HIT -s DTLB_LOAD_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", - dtlb_missload }, + dtlb_missload, 3 }, /*11*/ { "dtlbmissstore", "thresh >= .05", "pmcstat -s DTLB_STORE_MISSES.STLB_HIT -s DTLB_STORE_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", - dtlb_missstore }, + dtlb_missstore, 3 }, /*12*/ { "frontendstall", "thresh >= .15", "pmcstat -s IDQ_UOPS_NOT_DELIVERED.CORE -s CPU_CLK_UNHALTED.THREAD_P -w 1", - frontendstall }, + frontendstall, 2 }, /*13*/ { "clears", "thresh >= .02", "pmcstat -s MACHINE_CLEARS.MEMORY_ORDERING -s MACHINE_CLEARS.SMC -s MACHINE_CLEARS.MASKMOV -s CPU_CLK_UNHALTED.THREAD_P -w 1", - clears }, + clears, 4 }, /*14*/ { "microassist", "thresh >= .05", "pmcstat -s IDQ.MS_UOPS,cmask=1 -s CPU_CLK_UNHALTED.THREAD_P -w 1", - microassist }, + microassist, 2 }, /*15*/ { "aliasing_4k", "thresh >= .1", "pmcstat -s LD_BLOCKS_PARTIAL.ADDRESS_ALIAS -s CPU_CLK_UNHALTED.THREAD_P -w 1", - aliasing }, + aliasing, 2 }, /*16*/ { "fpassist", "look for a excessive value", "pmcstat -s FP_ASSIST.ANY -s INST_RETIRED.ANY_P -w 1", - fpassists }, + fpassists, 2 }, /*17*/ { "otherassistavx", "look for a excessive value", "pmcstat -s OTHER_ASSISTS.AVX_TO_SSE -s CPU_CLK_UNHALTED.THREAD_P -w 1", - otherassistavx }, + otherassistavx, 2}, /*18*/ { "otherassistsse", "look for a excessive value", "pmcstat -s OTHER_ASSISTS.SSE_TO_AVX -s CPU_CLK_UNHALTED.THREAD_P -w 1", - otherassistsse }, + otherassistsse, 2 }, /*19*/ { "eff1", "thresh < .9", "pmcstat -s UOPS_RETIRED.RETIRE_SLOTS -s CPU_CLK_UNHALTED.THREAD_P -w 1", - efficiency1 }, + efficiency1, 2 }, /*20*/ { "eff2", "thresh > 1.0", "pmcstat -s INST_RETIRED.ANY_P -s CPU_CLK_UNHALTED.THREAD_P -w 1", - efficiency2 }, + efficiency2, 2 }, }; @@ -1401,131 +1706,257 @@ static struct cpu_entry sandy_bridge[SANDY_BRIDGE_COUNT] = { static struct cpu_entry ivy_bridge[IVY_BRIDGE_COUNT] = { /*1*/ { "eff1", "thresh < .75", "pmcstat -s UOPS_RETIRED.RETIRE_SLOTS -s CPU_CLK_UNHALTED.THREAD_P -w 1", - efficiency1 }, + efficiency1, 2 }, /*2*/ { "eff2", "thresh > 1.0", "pmcstat -s INST_RETIRED.ANY_P -s CPU_CLK_UNHALTED.THREAD_P -w 1", - efficiency2 }, + efficiency2, 2 }, /*3*/ { "itlbmiss", "thresh > .05", "pmcstat -s ITLB_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", - itlb_miss }, + itlb_miss, 2 }, /*4*/ { "icachemiss", "thresh > .05", "pmcstat -s ICACHE.IFETCH_STALL -s ITLB_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", - icache_miss }, + icache_miss, 3 }, /*5*/ { "lcpstall", "thresh > .05", "pmcstat -s ILD_STALL.LCP -s CPU_CLK_UNHALTED.THREAD_P -w 1", - lcp_stall }, + lcp_stall, 2 }, /*6*/ { "cache1", "thresh >= .2", "pmcstat -s MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM -s CPU_CLK_UNHALTED.THREAD_P -w 1", - cache1ib }, + cache1ib, 2 }, /*7*/ { "cache2", "thresh >= .2", "pmcstat -s MEM_LOAD_UOPS_RETIRED.LLC_HIT -s CPU_CLK_UNHALTED.THREAD_P -w 1", - cache2ib }, + cache2ib, 2 }, /*8*/ { "contested", "thresh >= .05", "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM -s CPU_CLK_UNHALTED.THREAD_P -w 1", - contested }, + contested, 2 }, /*9*/ { "datashare", "thresh >= .05", "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT -s CPU_CLK_UNHALTED.THREAD_P -w 1", - datasharing }, + datasharing, 2 }, /*10*/ { "blockstorefwd", "thresh >= .05", "pmcstat -s LD_BLOCKS_STORE_FORWARD -s CPU_CLK_UNHALTED.THREAD_P -w 1", - blockstoreforward }, + blockstoreforward, 2 }, /*11*/ { "splitload", "thresh >= .1", "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s L1D_PEND_MISS.PENDING -s MEM_LOAD_UOPS_RETIRED.L1_MISS -s LD_BLOCKS.NO_SR -w 1", - splitloadib }, + splitloadib, 4 }, /*12*/ { "splitstore", "thresh >= .01", - "pmcstat -s MEM_UOP_RETIRED.SPLIT_STORES -s MEM_UOP_RETIRED.ALL_STORES -w 1", - splitstore }, + "pmcstat -s MEM_UOPS_RETIRED.SPLIT_STORES -s MEM_UOPS_RETIRED.ALL_STORES -w 1", + splitstore, 2 }, /*13*/ { "aliasing_4k", "thresh >= .1", "pmcstat -s LD_BLOCKS_PARTIAL.ADDRESS_ALIAS -s CPU_CLK_UNHALTED.THREAD_P -w 1", - aliasing }, + aliasing, 2 }, /*14*/ { "dtlbmissload", "thresh >= .1", "pmcstat -s DTLB_LOAD_MISSES.STLB_HIT -s DTLB_LOAD_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", - dtlb_missload }, + dtlb_missload , 3}, /*15*/ { "dtlbmissstore", "thresh >= .05", "pmcstat -s DTLB_STORE_MISSES.STLB_HIT -s DTLB_STORE_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", - dtlb_missstore }, + dtlb_missstore, 3 }, /*16*/ { "br_miss", "thresh >= .2", "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s BR_MISP_RETIRED.ALL_BRANCHES -s MACHINE_CLEARS.MEMORY_ORDERING -s MACHINE_CLEARS.SMC -s MACHINE_CLEARS.MASKMOV -s UOPS_ISSUED.ANY -s UOPS_RETIRED.RETIRE_SLOTS -s INT_MISC.RECOVERY_CYCLES -w 1", - br_mispredictib }, + br_mispredictib, 8 }, /*17*/ { "clears", "thresh >= .02", "pmcstat -s MACHINE_CLEARS.MEMORY_ORDERING -s MACHINE_CLEARS.SMC -s MACHINE_CLEARS.MASKMOV -s CPU_CLK_UNHALTED.THREAD_P -w 1", - clears }, + clears, 4 }, /*18*/ { "microassist", "thresh >= .05", "pmcstat -s IDQ.MS_UOPS,cmask=1 -s CPU_CLK_UNHALTED.THREAD_P -w 1", - microassist }, + microassist, 2 }, /*19*/ { "fpassist", "look for a excessive value", "pmcstat -s FP_ASSIST.ANY -s INST_RETIRED.ANY_P -w 1", - fpassists }, + fpassists, 2 }, /*20*/ { "otherassistavx", "look for a excessive value", "pmcstat -s OTHER_ASSISTS.AVX_TO_SSE -s CPU_CLK_UNHALTED.THREAD_P -w 1", - otherassistavx }, + otherassistavx , 2}, /*21*/ { "otherassistsse", "look for a excessive value", "pmcstat -s OTHER_ASSISTS.SSE_TO_AVX -s CPU_CLK_UNHALTED.THREAD_P -w 1", - otherassistsse }, + otherassistsse, 2 }, }; #define HASWELL_COUNT 20 static struct cpu_entry haswell[HASWELL_COUNT] = { /*1*/ { "eff1", "thresh < .75", "pmcstat -s UOPS_RETIRED.RETIRE_SLOTS -s CPU_CLK_UNHALTED.THREAD_P -w 1", - efficiency1 }, + efficiency1, 2 }, /*2*/ { "eff2", "thresh > 1.0", "pmcstat -s INST_RETIRED.ANY_P -s CPU_CLK_UNHALTED.THREAD_P -w 1", - efficiency2 }, + efficiency2, 2 }, /*3*/ { "itlbmiss", "thresh > .05", "pmcstat -s ITLB_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", - itlb_miss }, + itlb_miss, 2 }, /*4*/ { "icachemiss", "thresh > .05", - "pmcstat -s ICACHE.MISSES --s CPU_CLK_UNHALTED.THREAD_P -w 1", - icache_miss_has }, + "pmcstat -s ICACHE.MISSES -s CPU_CLK_UNHALTED.THREAD_P -w 1", + icache_miss_has, 2 }, /*5*/ { "lcpstall", "thresh > .05", "pmcstat -s ILD_STALL.LCP -s CPU_CLK_UNHALTED.THREAD_P -w 1", - lcp_stall }, + lcp_stall, 2 }, /*6*/ { "cache1", "thresh >= .2", "pmcstat -s MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM -s CPU_CLK_UNHALTED.THREAD_P -w 1", - cache1ib }, + cache1ib, 2 }, /*7*/ { "cache2", "thresh >= .2", "pmcstat -s MEM_LOAD_UOPS_RETIRED.LLC_HIT -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM -s CPU_CLK_UNHALTED.THREAD_P -w 1", - cache2has }, + cache2has, 4 }, /*8*/ { "contested", "thresh >= .05", "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM -s CPU_CLK_UNHALTED.THREAD_P -w 1", - contested_has }, + contested_has, 2 }, /*9*/ { "datashare", "thresh >= .05", "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT -s CPU_CLK_UNHALTED.THREAD_P -w 1", - datasharing_has }, + datasharing_has, 2 }, /*10*/ { "blockstorefwd", "thresh >= .05", "pmcstat -s LD_BLOCKS_STORE_FORWARD -s CPU_CLK_UNHALTED.THREAD_P -w 1", - blockstoreforward }, + blockstoreforward, 2 }, /*11*/ { "splitload", "thresh >= .1", - "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s MEM_UOP_RETIRED.SPLIT_LOADS -w 1", - splitload }, + "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s MEM_UOPS_RETIRED.SPLIT_LOADS -w 1", + splitload , 2}, /*12*/ { "splitstore", "thresh >= .01", - "pmcstat -s MEM_UOP_RETIRED.SPLIT_STORES -s MEM_UOP_RETIRED.ALL_STORES -w 1", - splitstore }, + "pmcstat -s MEM_UOPS_RETIRED.SPLIT_STORES -s MEM_UOPS_RETIRED.ALL_STORES -w 1", + splitstore, 2 }, /*13*/ { "aliasing_4k", "thresh >= .1", "pmcstat -s LD_BLOCKS_PARTIAL.ADDRESS_ALIAS -s CPU_CLK_UNHALTED.THREAD_P -w 1", - aliasing }, + aliasing, 2 }, /*14*/ { "dtlbmissload", "thresh >= .1", "pmcstat -s DTLB_LOAD_MISSES.STLB_HIT -s DTLB_LOAD_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", - dtlb_missload }, + dtlb_missload, 3 }, /*15*/ { "br_miss", "thresh >= .2", "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s BR_MISP_RETIRED.ALL_BRANCHES -w 1", - br_mispredict }, + br_mispredict, 2 }, /*16*/ { "clears", "thresh >= .02", "pmcstat -s MACHINE_CLEARS.MEMORY_ORDERING -s MACHINE_CLEARS.SMC -s MACHINE_CLEARS.MASKMOV -s CPU_CLK_UNHALTED.THREAD_P -w 1", - clears }, + clears, 4 }, /*17*/ { "microassist", "thresh >= .05", "pmcstat -s IDQ.MS_UOPS,cmask=1 -s CPU_CLK_UNHALTED.THREAD_P -w 1", - microassist }, + microassist, 2 }, /*18*/ { "fpassist", "look for a excessive value", "pmcstat -s FP_ASSIST.ANY -s INST_RETIRED.ANY_P -w 1", - fpassists }, + fpassists, 2 }, /*19*/ { "otherassistavx", "look for a excessive value", "pmcstat -s OTHER_ASSISTS.AVX_TO_SSE -s CPU_CLK_UNHALTED.THREAD_P -w 1", - otherassistavx }, + otherassistavx, 2 }, /*20*/ { "otherassistsse", "look for a excessive value", "pmcstat -s OTHER_ASSISTS.SSE_TO_AVX -s CPU_CLK_UNHALTED.THREAD_P -w 1", - otherassistsse }, + otherassistsse, 2 }, +}; + + +static void +explain_name_broad(const char *name) +{ + const char *mythresh; + if (strcmp(name, "eff1") == 0) { + printf("Examine (UOPS_RETIRED.RETIRE_SLOTS)/(4 *CPU_CLK_UNHALTED.THREAD_P)\n"); + mythresh = "thresh < .75"; + } else if (strcmp(name, "eff2") == 0) { + printf("Examine CPU_CLK_UNHALTED.THREAD_P/INST_RETIRED.ANY_P\n"); + mythresh = "thresh > 1.0"; + } else if (strcmp(name, "itlbmiss") == 0) { + printf("Examine (7 * ITLB_MISSES_STLB_HIT_4K + ITLB_MISSES.WALK_DURATION)/ CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh > .05"; + } else if (strcmp(name, "icachemiss") == 0) { + printf("Examine ( 36.0 * ICACHE.MISSES)/ CPU_CLK_UNHALTED.THREAD_P ??? may not be right \n"); + mythresh = "thresh > .05"; + } else if (strcmp(name, "lcpstall") == 0) { + printf("Examine ILD_STALL.LCP/CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh > .05"; + } else if (strcmp(name, "cache1") == 0) { + printf("Examine (MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM * 180) / CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .1"; + } else if (strcmp(name, "cache2") == 0) { + printf("Examine (36.0 * MEM_LOAD_UOPS_RETIRED.L3_HIT / CPU_CLK_UNHALTED.THREAD_P)\n"); + mythresh = "thresh >= .2"; + } else if (strcmp(name, "contested") == 0) { + printf("Examine ((MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) + MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS)/ CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .05"; + } else if (strcmp(name, "datashare") == 0) { + printf("Examine (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 72)/CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh > .05"; + } else if (strcmp(name, "blockstorefwd") == 0) { + printf("Examine (LD_BLOCKS_STORE_FORWARD * 13) / CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .05"; + } else if (strcmp(name, "aliasing_4k") == 0) { + printf("Examine (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 7) / CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .1"; + } else if (strcmp(name, "dtlbmissload") == 0) { + printf("Examine (((DTLB_LOAD_MISSES.STLB_HIT * 7) + DTLB_LOAD_MISSES.WALK_DURATION)\n"); + printf(" / CPU_CLK_UNHALTED.THREAD_P)\n"); + mythresh = "thresh >= .1"; + + } else if (strcmp(name, "br_miss") == 0) { + printf("Examine BR_MISP_RETIRED.ALL_BRANCHS_PS / (BR_MISP_RETIED.ALL_BRANCHES_PS + MACHINE_CLEARS.COUNT) *\n"); + printf(" (UOPS_ISSUEDF.ANY - UOPS_RETIRED.RETIRE_SLOTS + 4 * INT_MISC.RECOVERY_CYCLES) /\n"); + printf("CPU_CLK_UNHALTED.THREAD * 4)\n"); + mythresh = "thresh >= .2"; + } else if (strcmp(name, "clears") == 0) { + printf("Examine ((MACHINE_CLEARS.MEMORY_ORDERING + \n"); + printf(" MACHINE_CLEARS.SMC + \n"); + printf(" MACHINE_CLEARS.MASKMOV ) * 100 ) / CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .02"; + } else if (strcmp(name, "fpassist") == 0) { + printf("Examine FP_ASSIST.ANY/INST_RETIRED.ANY_P\n"); + mythresh = "look for a excessive value"; + } else if (strcmp(name, "otherassistavx") == 0) { + printf("Examine (OTHER_ASSISTS.AVX_TO_SSE * 75)/CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "look for a excessive value"; + } else if (strcmp(name, "microassist") == 0) { + printf("Examine (UOPS_RETIRED.RETIRE_SLOTS/UOPS_ISSUED.ANY) * (IDQ.MS_CYCLES / (4 * CPU_CLK_UNHALTED.THREAD_P)\n"); + printf("***We use IDQ.MS_UOPS,cmask=1 to get cycles\n"); + mythresh = "thresh >= .05"; + } else { + printf("Unknown name:%s\n", name); + mythresh = "unknown entry"; + } + printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); +} + + +#define BROADWELL_COUNT 17 +static struct cpu_entry broadwell[BROADWELL_COUNT] = { +/*1*/ { "eff1", "thresh < .75", + "pmcstat -s UOPS_RETIRED.RETIRE_SLOTS -s CPU_CLK_UNHALTED.THREAD_P -w 1", + efficiency1, 2 }, +/*2*/ { "eff2", "thresh > 1.0", + "pmcstat -s INST_RETIRED.ANY_P -s CPU_CLK_UNHALTED.THREAD_P -w 1", + efficiency2, 2 }, +/*3*/ { "itlbmiss", "thresh > .05", + "pmcstat -s ITLB_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -s ITLB_MISSES.STLB_HIT_4K -w 1", + itlb_miss_broad, 3 }, +/*4*/ { "icachemiss", "thresh > .05", + "pmcstat -s ICACHE.MISSES -s CPU_CLK_UNHALTED.THREAD_P -w 1", + icache_miss_has, 2 }, +/*5*/ { "lcpstall", "thresh > .05", + "pmcstat -s ILD_STALL.LCP -s CPU_CLK_UNHALTED.THREAD_P -w 1", + lcp_stall, 2 }, +/*6*/ { "cache1", "thresh >= .1", + "pmcstat -s MEM_LOAD_UOPS_RETIRED.L3_MISS -s CPU_CLK_UNHALTED.THREAD_P -w 1", + cache1broad, 2 }, +/*7*/ { "cache2", "thresh >= .2", + "pmcstat -s MEM_LOAD_UOPS_RETIRED.L3_HIT -s CPU_CLK_UNHALTED.THREAD_P -w 1", + cache2broad, 2 }, +/*8*/ { "contested", "thresh >= .05", + "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM -s CPU_CLK_UNHALTED.THREAD_P -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS -w 1", + contestedbroad, 2 }, +/*9*/ { "datashare", "thresh >= .05", + "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT -s CPU_CLK_UNHALTED.THREAD_P -w 1", + datasharing_has, 2 }, +/*10*/ { "blockstorefwd", "thresh >= .05", + "pmcstat -s LD_BLOCKS_STORE_FORWARD -s CPU_CLK_UNHALTED.THREAD_P -w 1", + blockstoreforward, 2 }, +/*11*/ { "aliasing_4k", "thresh >= .1", + "pmcstat -s LD_BLOCKS_PARTIAL.ADDRESS_ALIAS -s CPU_CLK_UNHALTED.THREAD_P -w 1", + aliasing_broad, 2 }, +/*12*/ { "dtlbmissload", "thresh >= .1", + "pmcstat -s DTLB_LOAD_MISSES.STLB_HIT_4K -s DTLB_LOAD_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", + dtlb_missload, 3 }, +/*13*/ { "br_miss", "thresh >= .2", + "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s BR_MISP_RETIRED.ALL_BRANCHES -s MACHINE_CLEARS.CYCLES -s UOPS_ISSUED.ANY -s UOPS_RETIRED.RETIRE_SLOTS -s INT_MISC.RECOVERY_CYCLES -w 1", + br_mispredict_broad, 7 }, +/*14*/ { "clears", "thresh >= .02", + "pmcstat -s MACHINE_CLEARS.CYCLES -s MACHINE_CLEARS.MEMORY_ORDERING -s MACHINE_CLEARS.SMC -s MACHINE_CLEARS.MASKMOV -s CPU_CLK_UNHALTED.THREAD_P -w 1", + clears_broad, 5 }, +/*15*/ { "fpassist", "look for a excessive value", + "pmcstat -s FP_ASSIST.ANY -s INST_RETIRED.ANY_P -w 1", + fpassists, 2 }, +/*16*/ { "otherassistavx", "look for a excessive value", + "pmcstat -s OTHER_ASSISTS.AVX_TO_SSE -s CPU_CLK_UNHALTED.THREAD_P -w 1", + otherassistavx, 2 }, +/*17*/ { "microassist", "thresh >= .2", + "pmcstat -s IDQ.MS_UOPS,cmask=1 -s CPU_CLK_UNHALTED.THREAD_P -s UOPS_ISSUED.ANY -s UOPS_RETIRED.RETIRE_SLOTS -w 1", + microassist_broad, 4 }, }; @@ -1557,8 +1988,19 @@ set_haswell(void) the_cpu.explain = explain_name_has; } + static void -set_expression(char *name) +set_broadwell(void) +{ + strcpy(the_cpu.cputype, "HASWELL PMC"); + the_cpu.number = BROADWELL_COUNT; + the_cpu.ents = broadwell; + the_cpu.explain = explain_name_broad; +} + + +static int +set_expression(const char *name) { int found = 0, i; for(i=0 ; i< the_cpu.number; i++) { @@ -1567,6 +2009,17 @@ set_expression(char *name) expression = the_cpu.ents[i].func; command = the_cpu.ents[i].command; threshold = the_cpu.ents[i].thresh; + if (the_cpu.ents[i].counters_required > max_pmc_counters) { + printf("Test %s requires that the CPU have %d counters and this CPU has only %d\n", + the_cpu.ents[i].name, + the_cpu.ents[i].counters_required, max_pmc_counters); + printf("Sorry this test can not be run\n"); + if (run_all == 0) { + exit(-1); + } else { + return(-1); + } + } break; } } @@ -1575,6 +2028,7 @@ set_expression(char *name) the_cpu.cputype, name); exit(-1); } + return(0); } @@ -1796,10 +2250,6 @@ process_file(char *filename) if (filename == NULL) { io = my_popen(command, "r", &pid_of_command); - if (io == NULL) { - printf("Can't popen the command %s\n", command); - return; - } } else { io = fopen(filename, "r"); if (io == NULL) { @@ -1812,10 +2262,8 @@ process_file(char *filename) if (cnts == NULL) { /* Nothing we can do */ printf("Nothing to do -- no counters built\n"); - if (filename) { - fclose(io); - } else { - my_pclose(io, pid_of_command); + if (io) { + fclose(io); } return; } @@ -1863,8 +2311,22 @@ process_file(char *filename) #if defined(__amd64__) #define cpuid(in,a,b,c,d)\ asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in)); + +static __inline void +do_cpuid(u_int ax, u_int cx, u_int *p) +{ + __asm __volatile("cpuid" + : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (ax), "c" (cx) ); +} + #else #define cpuid(in, a, b, c, d) +static __inline void +do_cpuid(u_int ax, u_int cx, u_int *p) +{ +} + #endif static void @@ -1876,6 +2338,7 @@ get_cpuid_set(void) size_t sz, len; FILE *io; char linebuf[1024], *str; + u_int reg[4]; eax = ebx = ecx = edx = 0; @@ -1992,6 +2455,23 @@ get_cpuid_set(void) printf("Intel HASWELL\n"); set_haswell(); break; + + case 0x4e: + case 0x5e: + printf("Intel SKY-LAKE\n"); + goto not_supported; + break; + case 0x3D: + case 0x47: + printf("Intel BROADWELL\n"); + set_broadwell(); + break; + case 0x4f: + case 0x56: + printf("Intel BROADWEL (Xeon)\n"); + set_broadwell(); + break; + case 0x4D: /* Per Intel document 330061-001 01/2014. */ printf("Intel ATOM_SILVERMONT\n"); @@ -2009,6 +2489,9 @@ get_cpuid_set(void) goto not_supported; break; } + do_cpuid(0xa, 0, reg); + max_pmc_counters = (reg[3] & 0x0000000f) + 1; + printf("We have %d PMC counters to work with\n", max_pmc_counters); /* Ok lets load the list of all known PMC's */ io = my_popen("/usr/sbin/pmccontrol -L", "r", &pid_of_command); if (valid_pmcs == NULL) { @@ -2320,14 +2803,18 @@ main(int argc, char **argv) { int i, j, cnt; char *filename=NULL; - char *name=NULL; + const char *name=NULL; int help_only = 0; int test_mode = 0; + int test_at = 0; get_cpuid_set(); memset(glob_cpu, 0, sizeof(glob_cpu)); - while ((i = getopt(argc, argv, "LHhvm:i:?e:TE:")) != -1) { + while ((i = getopt(argc, argv, "ALHhvm:i:?e:TE:")) != -1) { switch (i) { + case 'A': + run_all = 1; + break; case 'L': list_all(); return(0); @@ -2383,23 +2870,28 @@ main(int argc, char **argv) printf("-h -- Don't do the expression I put in -e xxx just explain what it does and exit\n"); printf("-H -- Don't run anything, just explain all canned expressions\n"); printf("-T -- Test all PMC's defined by this processor\n"); + printf("-A -- Run all canned tests\n"); return(0); break; }; } - if ((name == NULL) && (filename == NULL) && (test_mode == 0) && (master_exp == NULL)) { + if ((run_all == 0) && (name == NULL) && (filename == NULL) && + (test_mode == 0) && (master_exp == NULL)) { printf("Without setting an expression we cannot dynamically gather information\n"); printf("you must supply a filename (and you probably want verbosity)\n"); goto use; } + if (run_all && max_to_collect > 10) { + max_to_collect = 3; + } if (test_mode) { run_tests(); return(0); } printf("*********************************\n"); - if (master_exp == NULL) { + if ((master_exp == NULL) && name) { (*the_cpu.explain)(name); - } else { + } else if (master_exp) { printf("Examine your expression "); print_exp(master_exp); printf("User defined threshold\n"); @@ -2407,6 +2899,19 @@ main(int argc, char **argv) if (help_only) { return(0); } + if (run_all) { + more: + name = the_cpu.ents[test_at].name; + printf("***Test %s (threshold %s)****\n", name, the_cpu.ents[test_at].thresh); + test_at++; + if (set_expression(name) == -1) { + if (test_at >= the_cpu.number) { + goto done; + } else + goto more; + } + + } process_file(filename); if (verbose >= 2) { for (i=0; i 1) { + for(i=0, cnt=0; i Date: Wed, 30 Dec 2015 08:02:11 +0000 Subject: Hook the tests into the build automatically by creating a stub tests/ directory which installs the autotraversing Kyuafile --- sbin/geom/Makefile | 6 ++++++ sbin/geom/tests/Makefile | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 sbin/geom/tests/Makefile diff --git a/sbin/geom/Makefile b/sbin/geom/Makefile index 19a5636..070e3bc 100644 --- a/sbin/geom/Makefile +++ b/sbin/geom/Makefile @@ -20,8 +20,14 @@ LIBADD= geom util .else +.include + SUBDIR= core class +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include .endif diff --git a/sbin/geom/tests/Makefile b/sbin/geom/tests/Makefile new file mode 100644 index 0000000..f0d4d12 --- /dev/null +++ b/sbin/geom/tests/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/tests + +TESTSDIR= ${TESTSBASE}/sbin/geom +KYUAFILE= yes + +.include -- cgit v1.1 From a50007a155e7fbf5abe60669584a22ff31f09fa8 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 1 Jan 2016 00:12:10 +0000 Subject: Move sbin/geom/class/tests to tests/sys/geom/class and remove sbin/geom/tests This is inspired by parallel efforts being done on projects/zfsd (and makes more sense because these are functional tests of the subsystems, not the geom(8) commands --- etc/mtree/BSD.tests.dist | 50 +++--- sbin/geom/class/tests/Makefile | 19 --- sbin/geom/class/tests/Makefile.inc | 3 - sbin/geom/class/tests/concat/1_test.sh | 23 --- sbin/geom/class/tests/concat/2_test.sh | 30 ---- sbin/geom/class/tests/concat/Makefile | 10 -- sbin/geom/class/tests/concat/conf.sh | 15 -- sbin/geom/class/tests/eli/Makefile | 36 ---- sbin/geom/class/tests/eli/attach_d_test.sh | 38 ----- sbin/geom/class/tests/eli/conf.sh | 19 --- sbin/geom/class/tests/eli/configure_b_B_test.sh | 129 --------------- sbin/geom/class/tests/eli/delkey_test.sh | 140 ---------------- sbin/geom/class/tests/eli/detach_l_test.sh | 44 ----- sbin/geom/class/tests/eli/init_B_test.sh | 104 ------------ sbin/geom/class/tests/eli/init_J_test.sh | 126 -------------- sbin/geom/class/tests/eli/init_a_test.sh | 60 ------- sbin/geom/class/tests/eli/init_i_P_test.sh | 22 --- sbin/geom/class/tests/eli/init_test.sh | 65 -------- sbin/geom/class/tests/eli/integrity_copy_test.sh | 99 ----------- sbin/geom/class/tests/eli/integrity_data_test.sh | 69 -------- sbin/geom/class/tests/eli/integrity_hmac_test.sh | 69 -------- sbin/geom/class/tests/eli/kill_test.sh | 97 ----------- sbin/geom/class/tests/eli/nokey_test.sh | 65 -------- sbin/geom/class/tests/eli/onetime_a_test.sh | 54 ------ sbin/geom/class/tests/eli/onetime_d_test.sh | 34 ---- sbin/geom/class/tests/eli/onetime_test.sh | 59 ------- sbin/geom/class/tests/eli/readonly_test.sh | 94 ----------- sbin/geom/class/tests/eli/resize_test.sh | 148 ----------------- sbin/geom/class/tests/eli/setkey_test.sh | 156 ----------------- sbin/geom/class/tests/gate/1_test.sh | 61 ------- sbin/geom/class/tests/gate/2_test.sh | 48 ------ sbin/geom/class/tests/gate/3_test.sh | 48 ------ sbin/geom/class/tests/gate/Makefile | 11 -- sbin/geom/class/tests/gate/conf.sh | 10 -- sbin/geom/class/tests/geom_subr.sh | 48 ------ sbin/geom/class/tests/gpt/Makefile | 13 -- sbin/geom/class/tests/gpt/gctl.c | 166 ------------------- sbin/geom/class/tests/gpt/gctl_test.pl | 202 ----------------------- sbin/geom/class/tests/mirror/1_test.sh | 23 --- sbin/geom/class/tests/mirror/2_test.sh | 52 ------ sbin/geom/class/tests/mirror/3_test.sh | 64 ------- sbin/geom/class/tests/mirror/4_test.sh | 66 -------- sbin/geom/class/tests/mirror/5_test.sh | 64 ------- sbin/geom/class/tests/mirror/6_test.sh | 45 ----- sbin/geom/class/tests/mirror/7_test.sh | 64 ------- sbin/geom/class/tests/mirror/Makefile | 15 -- sbin/geom/class/tests/mirror/conf.sh | 15 -- sbin/geom/class/tests/nop/1_test.sh | 20 --- sbin/geom/class/tests/nop/2_test.sh | 26 --- sbin/geom/class/tests/nop/Makefile | 10 -- sbin/geom/class/tests/nop/conf.sh | 14 -- sbin/geom/class/tests/raid3/10_test.sh | 32 ---- sbin/geom/class/tests/raid3/11_test.sh | 32 ---- sbin/geom/class/tests/raid3/12_test.sh | 38 ----- sbin/geom/class/tests/raid3/1_test.sh | 28 ---- sbin/geom/class/tests/raid3/2_test.sh | 32 ---- sbin/geom/class/tests/raid3/3_test.sh | 36 ---- sbin/geom/class/tests/raid3/4_test.sh | 36 ---- sbin/geom/class/tests/raid3/5_test.sh | 36 ---- sbin/geom/class/tests/raid3/6_test.sh | 40 ----- sbin/geom/class/tests/raid3/7_test.sh | 43 ----- sbin/geom/class/tests/raid3/8_test.sh | 39 ----- sbin/geom/class/tests/raid3/9_test.sh | 42 ----- sbin/geom/class/tests/raid3/Makefile | 20 --- sbin/geom/class/tests/raid3/conf.sh | 15 -- sbin/geom/class/tests/shsec/1_test.sh | 28 ---- sbin/geom/class/tests/shsec/2_test.sh | 52 ------ sbin/geom/class/tests/shsec/Makefile | 10 -- sbin/geom/class/tests/shsec/conf.sh | 15 -- sbin/geom/class/tests/stripe/1_test.sh | 23 --- sbin/geom/class/tests/stripe/2_test.sh | 30 ---- sbin/geom/class/tests/stripe/Makefile | 10 -- sbin/geom/class/tests/stripe/conf.sh | 15 -- sbin/geom/class/tests/uzip/1_test.sh | 22 --- sbin/geom/class/tests/uzip/Makefile | 36 ---- sbin/geom/class/tests/uzip/conf.sh | 18 -- sbin/geom/class/tests/uzip/etalon/etalon.txt | 43 ----- sbin/geom/tests/Makefile | 8 - tests/sys/Makefile | 1 + tests/sys/geom/class/Makefile | 21 +++ tests/sys/geom/class/Makefile.inc | 5 + tests/sys/geom/class/concat/1_test.sh | 23 +++ tests/sys/geom/class/concat/2_test.sh | 30 ++++ tests/sys/geom/class/concat/Makefile | 10 ++ tests/sys/geom/class/concat/conf.sh | 15 ++ tests/sys/geom/class/eli/Makefile | 36 ++++ tests/sys/geom/class/eli/attach_d_test.sh | 38 +++++ tests/sys/geom/class/eli/conf.sh | 19 +++ tests/sys/geom/class/eli/configure_b_B_test.sh | 129 +++++++++++++++ tests/sys/geom/class/eli/delkey_test.sh | 140 ++++++++++++++++ tests/sys/geom/class/eli/detach_l_test.sh | 44 +++++ tests/sys/geom/class/eli/init_B_test.sh | 104 ++++++++++++ tests/sys/geom/class/eli/init_J_test.sh | 126 ++++++++++++++ tests/sys/geom/class/eli/init_a_test.sh | 60 +++++++ tests/sys/geom/class/eli/init_i_P_test.sh | 22 +++ tests/sys/geom/class/eli/init_test.sh | 65 ++++++++ tests/sys/geom/class/eli/integrity_copy_test.sh | 99 +++++++++++ tests/sys/geom/class/eli/integrity_data_test.sh | 69 ++++++++ tests/sys/geom/class/eli/integrity_hmac_test.sh | 69 ++++++++ tests/sys/geom/class/eli/kill_test.sh | 97 +++++++++++ tests/sys/geom/class/eli/nokey_test.sh | 65 ++++++++ tests/sys/geom/class/eli/onetime_a_test.sh | 54 ++++++ tests/sys/geom/class/eli/onetime_d_test.sh | 34 ++++ tests/sys/geom/class/eli/onetime_test.sh | 59 +++++++ tests/sys/geom/class/eli/readonly_test.sh | 94 +++++++++++ tests/sys/geom/class/eli/resize_test.sh | 148 +++++++++++++++++ tests/sys/geom/class/eli/setkey_test.sh | 156 +++++++++++++++++ tests/sys/geom/class/gate/1_test.sh | 61 +++++++ tests/sys/geom/class/gate/2_test.sh | 48 ++++++ tests/sys/geom/class/gate/3_test.sh | 48 ++++++ tests/sys/geom/class/gate/Makefile | 11 ++ tests/sys/geom/class/gate/conf.sh | 10 ++ tests/sys/geom/class/geom_subr.sh | 48 ++++++ tests/sys/geom/class/gpt/Makefile | 13 ++ tests/sys/geom/class/gpt/gctl.c | 166 +++++++++++++++++++ tests/sys/geom/class/gpt/gctl_test.pl | 202 +++++++++++++++++++++++ tests/sys/geom/class/mirror/1_test.sh | 23 +++ tests/sys/geom/class/mirror/2_test.sh | 52 ++++++ tests/sys/geom/class/mirror/3_test.sh | 64 +++++++ tests/sys/geom/class/mirror/4_test.sh | 66 ++++++++ tests/sys/geom/class/mirror/5_test.sh | 64 +++++++ tests/sys/geom/class/mirror/6_test.sh | 45 +++++ tests/sys/geom/class/mirror/7_test.sh | 64 +++++++ tests/sys/geom/class/mirror/Makefile | 15 ++ tests/sys/geom/class/mirror/conf.sh | 15 ++ tests/sys/geom/class/nop/1_test.sh | 20 +++ tests/sys/geom/class/nop/2_test.sh | 26 +++ tests/sys/geom/class/nop/Makefile | 10 ++ tests/sys/geom/class/nop/conf.sh | 14 ++ tests/sys/geom/class/raid3/10_test.sh | 32 ++++ tests/sys/geom/class/raid3/11_test.sh | 32 ++++ tests/sys/geom/class/raid3/12_test.sh | 38 +++++ tests/sys/geom/class/raid3/1_test.sh | 28 ++++ tests/sys/geom/class/raid3/2_test.sh | 32 ++++ tests/sys/geom/class/raid3/3_test.sh | 36 ++++ tests/sys/geom/class/raid3/4_test.sh | 36 ++++ tests/sys/geom/class/raid3/5_test.sh | 36 ++++ tests/sys/geom/class/raid3/6_test.sh | 40 +++++ tests/sys/geom/class/raid3/7_test.sh | 43 +++++ tests/sys/geom/class/raid3/8_test.sh | 39 +++++ tests/sys/geom/class/raid3/9_test.sh | 42 +++++ tests/sys/geom/class/raid3/Makefile | 20 +++ tests/sys/geom/class/raid3/conf.sh | 15 ++ tests/sys/geom/class/shsec/1_test.sh | 28 ++++ tests/sys/geom/class/shsec/2_test.sh | 52 ++++++ tests/sys/geom/class/shsec/Makefile | 10 ++ tests/sys/geom/class/shsec/conf.sh | 15 ++ tests/sys/geom/class/stripe/1_test.sh | 23 +++ tests/sys/geom/class/stripe/2_test.sh | 30 ++++ tests/sys/geom/class/stripe/Makefile | 10 ++ tests/sys/geom/class/stripe/conf.sh | 15 ++ tests/sys/geom/class/uzip/1_test.sh | 22 +++ tests/sys/geom/class/uzip/Makefile | 36 ++++ tests/sys/geom/class/uzip/conf.sh | 18 ++ tests/sys/geom/class/uzip/etalon/etalon.txt | 43 +++++ 155 files changed, 3714 insertions(+), 3715 deletions(-) delete mode 100644 sbin/geom/class/tests/Makefile delete mode 100644 sbin/geom/class/tests/Makefile.inc delete mode 100755 sbin/geom/class/tests/concat/1_test.sh delete mode 100755 sbin/geom/class/tests/concat/2_test.sh delete mode 100644 sbin/geom/class/tests/concat/Makefile delete mode 100755 sbin/geom/class/tests/concat/conf.sh delete mode 100644 sbin/geom/class/tests/eli/Makefile delete mode 100755 sbin/geom/class/tests/eli/attach_d_test.sh delete mode 100755 sbin/geom/class/tests/eli/conf.sh delete mode 100755 sbin/geom/class/tests/eli/configure_b_B_test.sh delete mode 100755 sbin/geom/class/tests/eli/delkey_test.sh delete mode 100755 sbin/geom/class/tests/eli/detach_l_test.sh delete mode 100755 sbin/geom/class/tests/eli/init_B_test.sh delete mode 100755 sbin/geom/class/tests/eli/init_J_test.sh delete mode 100755 sbin/geom/class/tests/eli/init_a_test.sh delete mode 100755 sbin/geom/class/tests/eli/init_i_P_test.sh delete mode 100755 sbin/geom/class/tests/eli/init_test.sh delete mode 100755 sbin/geom/class/tests/eli/integrity_copy_test.sh delete mode 100755 sbin/geom/class/tests/eli/integrity_data_test.sh delete mode 100755 sbin/geom/class/tests/eli/integrity_hmac_test.sh delete mode 100755 sbin/geom/class/tests/eli/kill_test.sh delete mode 100755 sbin/geom/class/tests/eli/nokey_test.sh delete mode 100755 sbin/geom/class/tests/eli/onetime_a_test.sh delete mode 100755 sbin/geom/class/tests/eli/onetime_d_test.sh delete mode 100755 sbin/geom/class/tests/eli/onetime_test.sh delete mode 100755 sbin/geom/class/tests/eli/readonly_test.sh delete mode 100755 sbin/geom/class/tests/eli/resize_test.sh delete mode 100755 sbin/geom/class/tests/eli/setkey_test.sh delete mode 100755 sbin/geom/class/tests/gate/1_test.sh delete mode 100755 sbin/geom/class/tests/gate/2_test.sh delete mode 100755 sbin/geom/class/tests/gate/3_test.sh delete mode 100644 sbin/geom/class/tests/gate/Makefile delete mode 100755 sbin/geom/class/tests/gate/conf.sh delete mode 100644 sbin/geom/class/tests/geom_subr.sh delete mode 100644 sbin/geom/class/tests/gpt/Makefile delete mode 100644 sbin/geom/class/tests/gpt/gctl.c delete mode 100755 sbin/geom/class/tests/gpt/gctl_test.pl delete mode 100755 sbin/geom/class/tests/mirror/1_test.sh delete mode 100755 sbin/geom/class/tests/mirror/2_test.sh delete mode 100755 sbin/geom/class/tests/mirror/3_test.sh delete mode 100755 sbin/geom/class/tests/mirror/4_test.sh delete mode 100755 sbin/geom/class/tests/mirror/5_test.sh delete mode 100755 sbin/geom/class/tests/mirror/6_test.sh delete mode 100755 sbin/geom/class/tests/mirror/7_test.sh delete mode 100644 sbin/geom/class/tests/mirror/Makefile delete mode 100755 sbin/geom/class/tests/mirror/conf.sh delete mode 100755 sbin/geom/class/tests/nop/1_test.sh delete mode 100755 sbin/geom/class/tests/nop/2_test.sh delete mode 100644 sbin/geom/class/tests/nop/Makefile delete mode 100755 sbin/geom/class/tests/nop/conf.sh delete mode 100755 sbin/geom/class/tests/raid3/10_test.sh delete mode 100755 sbin/geom/class/tests/raid3/11_test.sh delete mode 100755 sbin/geom/class/tests/raid3/12_test.sh delete mode 100755 sbin/geom/class/tests/raid3/1_test.sh delete mode 100755 sbin/geom/class/tests/raid3/2_test.sh delete mode 100755 sbin/geom/class/tests/raid3/3_test.sh delete mode 100755 sbin/geom/class/tests/raid3/4_test.sh delete mode 100755 sbin/geom/class/tests/raid3/5_test.sh delete mode 100755 sbin/geom/class/tests/raid3/6_test.sh delete mode 100755 sbin/geom/class/tests/raid3/7_test.sh delete mode 100755 sbin/geom/class/tests/raid3/8_test.sh delete mode 100755 sbin/geom/class/tests/raid3/9_test.sh delete mode 100644 sbin/geom/class/tests/raid3/Makefile delete mode 100755 sbin/geom/class/tests/raid3/conf.sh delete mode 100755 sbin/geom/class/tests/shsec/1_test.sh delete mode 100755 sbin/geom/class/tests/shsec/2_test.sh delete mode 100644 sbin/geom/class/tests/shsec/Makefile delete mode 100755 sbin/geom/class/tests/shsec/conf.sh delete mode 100755 sbin/geom/class/tests/stripe/1_test.sh delete mode 100755 sbin/geom/class/tests/stripe/2_test.sh delete mode 100644 sbin/geom/class/tests/stripe/Makefile delete mode 100755 sbin/geom/class/tests/stripe/conf.sh delete mode 100755 sbin/geom/class/tests/uzip/1_test.sh delete mode 100644 sbin/geom/class/tests/uzip/Makefile delete mode 100755 sbin/geom/class/tests/uzip/conf.sh delete mode 100644 sbin/geom/class/tests/uzip/etalon/etalon.txt delete mode 100644 sbin/geom/tests/Makefile create mode 100644 tests/sys/geom/class/Makefile create mode 100644 tests/sys/geom/class/Makefile.inc create mode 100755 tests/sys/geom/class/concat/1_test.sh create mode 100755 tests/sys/geom/class/concat/2_test.sh create mode 100644 tests/sys/geom/class/concat/Makefile create mode 100755 tests/sys/geom/class/concat/conf.sh create mode 100644 tests/sys/geom/class/eli/Makefile create mode 100755 tests/sys/geom/class/eli/attach_d_test.sh create mode 100755 tests/sys/geom/class/eli/conf.sh create mode 100755 tests/sys/geom/class/eli/configure_b_B_test.sh create mode 100755 tests/sys/geom/class/eli/delkey_test.sh create mode 100755 tests/sys/geom/class/eli/detach_l_test.sh create mode 100755 tests/sys/geom/class/eli/init_B_test.sh create mode 100755 tests/sys/geom/class/eli/init_J_test.sh create mode 100755 tests/sys/geom/class/eli/init_a_test.sh create mode 100755 tests/sys/geom/class/eli/init_i_P_test.sh create mode 100755 tests/sys/geom/class/eli/init_test.sh create mode 100755 tests/sys/geom/class/eli/integrity_copy_test.sh create mode 100755 tests/sys/geom/class/eli/integrity_data_test.sh create mode 100755 tests/sys/geom/class/eli/integrity_hmac_test.sh create mode 100755 tests/sys/geom/class/eli/kill_test.sh create mode 100755 tests/sys/geom/class/eli/nokey_test.sh create mode 100755 tests/sys/geom/class/eli/onetime_a_test.sh create mode 100755 tests/sys/geom/class/eli/onetime_d_test.sh create mode 100755 tests/sys/geom/class/eli/onetime_test.sh create mode 100755 tests/sys/geom/class/eli/readonly_test.sh create mode 100755 tests/sys/geom/class/eli/resize_test.sh create mode 100755 tests/sys/geom/class/eli/setkey_test.sh create mode 100755 tests/sys/geom/class/gate/1_test.sh create mode 100755 tests/sys/geom/class/gate/2_test.sh create mode 100755 tests/sys/geom/class/gate/3_test.sh create mode 100644 tests/sys/geom/class/gate/Makefile create mode 100755 tests/sys/geom/class/gate/conf.sh create mode 100644 tests/sys/geom/class/geom_subr.sh create mode 100644 tests/sys/geom/class/gpt/Makefile create mode 100644 tests/sys/geom/class/gpt/gctl.c create mode 100755 tests/sys/geom/class/gpt/gctl_test.pl create mode 100755 tests/sys/geom/class/mirror/1_test.sh create mode 100755 tests/sys/geom/class/mirror/2_test.sh create mode 100755 tests/sys/geom/class/mirror/3_test.sh create mode 100755 tests/sys/geom/class/mirror/4_test.sh create mode 100755 tests/sys/geom/class/mirror/5_test.sh create mode 100755 tests/sys/geom/class/mirror/6_test.sh create mode 100755 tests/sys/geom/class/mirror/7_test.sh create mode 100644 tests/sys/geom/class/mirror/Makefile create mode 100755 tests/sys/geom/class/mirror/conf.sh create mode 100755 tests/sys/geom/class/nop/1_test.sh create mode 100755 tests/sys/geom/class/nop/2_test.sh create mode 100644 tests/sys/geom/class/nop/Makefile create mode 100755 tests/sys/geom/class/nop/conf.sh create mode 100755 tests/sys/geom/class/raid3/10_test.sh create mode 100755 tests/sys/geom/class/raid3/11_test.sh create mode 100755 tests/sys/geom/class/raid3/12_test.sh create mode 100755 tests/sys/geom/class/raid3/1_test.sh create mode 100755 tests/sys/geom/class/raid3/2_test.sh create mode 100755 tests/sys/geom/class/raid3/3_test.sh create mode 100755 tests/sys/geom/class/raid3/4_test.sh create mode 100755 tests/sys/geom/class/raid3/5_test.sh create mode 100755 tests/sys/geom/class/raid3/6_test.sh create mode 100755 tests/sys/geom/class/raid3/7_test.sh create mode 100755 tests/sys/geom/class/raid3/8_test.sh create mode 100755 tests/sys/geom/class/raid3/9_test.sh create mode 100644 tests/sys/geom/class/raid3/Makefile create mode 100755 tests/sys/geom/class/raid3/conf.sh create mode 100755 tests/sys/geom/class/shsec/1_test.sh create mode 100755 tests/sys/geom/class/shsec/2_test.sh create mode 100644 tests/sys/geom/class/shsec/Makefile create mode 100755 tests/sys/geom/class/shsec/conf.sh create mode 100755 tests/sys/geom/class/stripe/1_test.sh create mode 100755 tests/sys/geom/class/stripe/2_test.sh create mode 100644 tests/sys/geom/class/stripe/Makefile create mode 100755 tests/sys/geom/class/stripe/conf.sh create mode 100755 tests/sys/geom/class/uzip/1_test.sh create mode 100644 tests/sys/geom/class/uzip/Makefile create mode 100755 tests/sys/geom/class/uzip/conf.sh create mode 100644 tests/sys/geom/class/uzip/etalon/etalon.txt diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 089a419..be83bc4 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -341,30 +341,6 @@ devd .. geom - class - concat - .. - eli - .. - gate - .. - gpt - .. - mirror - .. - nop - .. - raid3 - .. - shsec - .. - stripe - .. - uzip - etalon - .. - .. - .. core ConfCmp .. @@ -412,6 +388,32 @@ .. file .. + geom + class + concat + .. + eli + .. + gate + .. + gpt + .. + mirror + .. + nop + .. + raid3 + .. + shsec + .. + stripe + .. + uzip + etalon + .. + .. + .. + .. kern acct .. diff --git a/sbin/geom/class/tests/Makefile b/sbin/geom/class/tests/Makefile deleted file mode 100644 index 6213996..0000000 --- a/sbin/geom/class/tests/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ - -TESTS_SUBDIRS+= concat -TESTS_SUBDIRS+= eli -TESTS_SUBDIRS+= gate -# XXX: might not work due to geom(4) changes; more investigation's needed -#TESTS_SUBDIRS+= gpt -TESTS_SUBDIRS+= mirror -TESTS_SUBDIRS+= nop -TESTS_SUBDIRS+= raid3 -TESTS_SUBDIRS+= shsec -TESTS_SUBDIRS+= stripe -TESTS_SUBDIRS+= uzip - -BINDIR= ${TESTSBASE}/sbin/geom/class - -FILES+= geom_subr.sh - -.include diff --git a/sbin/geom/class/tests/Makefile.inc b/sbin/geom/class/tests/Makefile.inc deleted file mode 100644 index 522da0b..0000000 --- a/sbin/geom/class/tests/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -GEOM_CLASS= ${.CURDIR:T} - -TESTSDIR= ${TESTSBASE}/sbin/geom/class/${GEOM_CLASS} diff --git a/sbin/geom/class/tests/concat/1_test.sh b/sbin/geom/class/tests/concat/1_test.sh deleted file mode 100755 index ef80a61..0000000 --- a/sbin/geom/class/tests/concat/1_test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo '1..1' - -us0=$(attach_md -t malloc -s 1M) || exit 1 -us1=$(attach_md -t malloc -s 2M) || exit 1 -us2=$(attach_md -t malloc -s 3M) || exit 1 - -gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 -devwait - -# Size of created device should be 1MB + 2MB + 3MB. - -size=`diskinfo /dev/concat/${name} | awk '{print $3}'` - -if [ $size -eq 6291456 ]; then - echo "ok - Size is 6291456" -else - echo "not ok - Size is 6291456" -fi diff --git a/sbin/geom/class/tests/concat/2_test.sh b/sbin/geom/class/tests/concat/2_test.sh deleted file mode 100755 index 95636be..0000000 --- a/sbin/geom/class/tests/concat/2_test.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo '1..1' - -tsize=6 -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s 1M) || exit 1 -us1=$(attach_md -t malloc -s 2M) || exit 1 -us2=$(attach_md -t malloc -s 3M) || exit 1 - -dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 - -gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 -devwait - -dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1 -dd if=/dev/concat/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 - -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok - md5 checksum comparison" -else - echo "ok - md5 checksum comparison" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/concat/Makefile b/sbin/geom/class/tests/concat/Makefile deleted file mode 100644 index 81a4e99..0000000 --- a/sbin/geom/class/tests/concat/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh -FILESDIR= ${TESTSDIR} - -.include diff --git a/sbin/geom/class/tests/concat/conf.sh b/sbin/geom/class/tests/concat/conf.sh deleted file mode 100755 index 374ed12..0000000 --- a/sbin/geom/class/tests/concat/conf.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="$(mktemp -u concat.XXXXXX)" -class="concat" -base=`basename $0` - -gconcat_test_cleanup() -{ - [ -c /dev/$class/$name ] && gconcat destroy $name - geom_test_cleanup -} -trap gconcat_test_cleanup ABRT EXIT INT TERM - -. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/eli/Makefile b/sbin/geom/class/tests/eli/Makefile deleted file mode 100644 index 1846ed6..0000000 --- a/sbin/geom/class/tests/eli/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# $FreeBSD$ - -TAP_TESTS_SH+= attach_d_test -TAP_TESTS_SH+= configure_b_B_test -TAP_TESTS_SH+= delkey_test -TAP_TESTS_SH+= detach_l_test -TAP_TESTS_SH+= init_B_test -TAP_TESTS_SH+= init_J_test -TAP_TESTS_SH+= init_a_test -TAP_TESTS_SH+= init_i_P_test -TAP_TESTS_SH+= init_test -TAP_TESTS_SH+= integrity_copy_test -TAP_TESTS_SH+= integrity_data_test -TAP_TESTS_SH+= integrity_hmac_test -TAP_TESTS_SH+= kill_test -TAP_TESTS_SH+= nokey_test -TAP_TESTS_SH+= onetime_a_test -TAP_TESTS_SH+= onetime_d_test -TAP_TESTS_SH+= onetime_test -TAP_TESTS_SH+= readonly_test -TAP_TESTS_SH+= resize_test -TAP_TESTS_SH+= setkey_test - -TEST_METADATA.init_a_test+= timeout="1200" -TEST_METADATA.init_test+= timeout="300" -TEST_METADATA.integrity_copy_test+= timeout="1200" -TEST_METADATA.integrity_data_test+= timeout="600" -TEST_METADATA.integrity_hmac_test+= timeout="600" -TEST_METADATA.onetime_a_test+= timeout="600" -TEST_METADATA.onetime_test+= timeout="600" - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh -FILESDIR= ${TESTSDIR} - -.include diff --git a/sbin/geom/class/tests/eli/attach_d_test.sh b/sbin/geom/class/tests/eli/attach_d_test.sh deleted file mode 100755 index 5d700b3..0000000 --- a/sbin/geom/class/tests/eli/attach_d_test.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..3" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile md${no} -geli attach -d -p -k $keyfile md${no} -if [ -c /dev/md${no}.eli ]; then - echo "ok 1" -else - echo "not ok 1" -fi -# Be sure it doesn't detach on read. -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null -sleep 1 -if [ -c /dev/md${no}.eli ]; then - echo "ok 2" -else - echo "not ok 2" -fi -true > /dev/md${no}.eli -sleep 1 -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/conf.sh b/sbin/geom/class/tests/eli/conf.sh deleted file mode 100755 index 080fa61..0000000 --- a/sbin/geom/class/tests/eli/conf.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -class="eli" -base=`basename $0` - -no=0 -while [ -c /dev/md$no ]; do - : $(( no += 1 )) -done - -geli_test_cleanup() -{ - [ -c /dev/md${no}.eli ] && geli detach md${no}.eli - mdconfig -d -u $no -} -trap geli_test_cleanup ABRT EXIT INT TERM - -. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/eli/configure_b_B_test.sh b/sbin/geom/class/tests/eli/configure_b_B_test.sh deleted file mode 100755 index b6cdf4f..0000000 --- a/sbin/geom/class/tests/eli/configure_b_B_test.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..17" - -geli init -B none -P -K /dev/null md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -geli init -B none -b -P -K /dev/null md${no} -if [ $? -eq 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -geli configure -B md${no} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi - -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi - -geli configure -b md${no} -if [ $? -eq 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -geli attach -p -k /dev/null md${no} -if [ $? -eq 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi - -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi - -geli configure -B md${no} -if [ $? -eq 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi - -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null -if [ $? -ne 0 ]; then - echo "ok 12" -else - echo "not ok 12" -fi - -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 13" -else - echo "not ok 13" -fi - -geli configure -b md${no} -if [ $? -eq 0 ]; then - echo "ok 14" -else - echo "not ok 14" -fi - -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 15" -else - echo "not ok 15" -fi - -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 16" -else - echo "not ok 16" -fi - -geli detach md${no} -if [ $? -eq 0 ]; then - echo "ok 17" -else - echo "not ok 17" -fi diff --git a/sbin/geom/class/tests/eli/delkey_test.sh b/sbin/geom/class/tests/eli/delkey_test.sh deleted file mode 100755 index 67b253e..0000000 --- a/sbin/geom/class/tests/eli/delkey_test.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile1=`mktemp $base.XXXXXX` || exit 1 -keyfile2=`mktemp $base.XXXXXX` || exit 1 -keyfile3=`mktemp $base.XXXXXX` || exit 1 -keyfile4=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..14" - -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile1 md${no} -geli attach -p -k $keyfile1 md${no} -geli setkey -n 1 -P -K $keyfile2 md${no} - -# Remove key 0 for attached provider. -geli delkey -n 0 md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -geli detach md${no} - -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -# Attach with key 1. -geli attach -p -k $keyfile2 md${no} -if [ $? -eq 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -# We cannot remove last key without -f option (for attached provider). -geli delkey -n 1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -# Remove last key for attached provider. -geli delkey -f -n 1 md${no} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi - -# If there are no valid keys, but provider is attached, we can save situation. -geli setkey -n 0 -P -K $keyfile3 md${no} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi -geli detach md${no} - -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -# Attach with key 0. -geli attach -p -k $keyfile3 md${no} -if [ $? -eq 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -# Setup key 1. -geli setkey -n 1 -P -K $keyfile4 md${no} -if [ $? -eq 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi -geli detach md${no} - -# Remove key 1 for detached provider. -geli delkey -n 1 md${no} -if [ $? -eq 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi - -# We cannot use keyfile4 anymore. -geli attach -p -k $keyfile4 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi - -# We cannot remove last key without -f option (for detached provider). -geli delkey -n 0 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 12" -else - echo "not ok 12" -fi - -# Remove last key for detached provider. -geli delkey -f -n 0 md${no} -if [ $? -eq 0 ]; then - echo "ok 13" -else - echo "not ok 13" -fi - -# We cannot use keyfile3 anymore. -geli attach -p -k $keyfile3 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 14" -else - echo "not ok 14" -fi - -rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 diff --git a/sbin/geom/class/tests/eli/detach_l_test.sh b/sbin/geom/class/tests/eli/detach_l_test.sh deleted file mode 100755 index 605ae94..0000000 --- a/sbin/geom/class/tests/eli/detach_l_test.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..4" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile md${no} -geli attach -p -k $keyfile md${no} -if [ -c /dev/md${no}.eli ]; then - echo "ok 1" -else - echo "not ok 1" -fi -# Be sure it doesn't detach before 'detach -l'. -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null -sleep 1 -if [ -c /dev/md${no}.eli ]; then - echo "ok 2" -else - echo "not ok 2" -fi -geli detach -l md${no} -if [ -c /dev/md${no}.eli ]; then - echo "ok 3" -else - echo "not ok 3" -fi -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null -sleep 1 -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_B_test.sh b/sbin/geom/class/tests/eli/init_B_test.sh deleted file mode 100755 index 3ba743c..0000000 --- a/sbin/geom/class/tests/eli/init_B_test.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -backupfile=`mktemp $base.XXXXXX` || exit 1 - -echo "1..13" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -mdconfig -a -t malloc -s $sectors -u $no || exit 1 - -# -B none -rm -f /var/backups/md${no}.eli -geli init -B none -P -K $keyfile md${no} 2>/dev/null -if [ ! -f /var/backups/md${no}.eli ]; then - echo "ok 1 - -B none" -else - echo "not ok 1 - -B none" -fi - -# no -B -rm -f /var/backups/md${no}.eli -geli init -P -K $keyfile md${no} >/dev/null 2>&1 -if [ -f /var/backups/md${no}.eli ]; then - echo "ok 2 - no -B" -else - echo "not ok 2 - no -B" -fi -geli clear md${no} -geli attach -p -k $keyfile md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 3 - no -B" -else - echo "not ok 3 - no -B" -fi -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 4 - no -B" -else - echo "not ok 4 - no -B" -fi -geli restore /var/backups/md${no}.eli md${no} -if [ $? -eq 0 ]; then - echo "ok 5 - no -B" -else - echo "not ok 5 - no -B" -fi -geli attach -p -k $keyfile md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 6 - no -B" -else - echo "not ok 6 - no -B" -fi -if [ -c /dev/md${no}.eli ]; then - echo "ok 7 - no -B" -else - echo "not ok 7 - no -B" -fi -geli detach md${no} -rm -f /var/backups/md${no}.eli - -# -B file -rm -f $backupfile -geli init -B $backupfile -P -K $keyfile md${no} >/dev/null 2>&1 -if [ -f $backupfile ]; then - echo "ok 8 - -B file" -else - echo "not ok 8 - -B file" -fi -geli clear md${no} -geli attach -p -k $keyfile md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 9 - -B file" -else - echo "not ok 9 - -B file" -fi -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 10 - -B file" -else - echo "not ok 10 - -B file" -fi -geli restore $backupfile md${no} -if [ $? -eq 0 ]; then - echo "ok 11 - -B file" -else - echo "not ok 11 - -B file" -fi -geli attach -p -k $keyfile md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 12 - -B file" -else - echo "not ok 12 - -B file" -fi -if [ -c /dev/md${no}.eli ]; then - echo "ok 13 - -B file" -else - echo "not ok 13 - -B file" -fi - -rm -f $backupfile $keyfile diff --git a/sbin/geom/class/tests/eli/init_J_test.sh b/sbin/geom/class/tests/eli/init_J_test.sh deleted file mode 100755 index 266a3d5..0000000 --- a/sbin/geom/class/tests/eli/init_J_test.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile0=`mktemp $base.XXXXXX` || exit 1 -keyfile1=`mktemp $base.XXXXXX` || exit 1 -passfile0=`mktemp $base.XXXXXX` || exit 1 -passfile1=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..150" - -dd if=/dev/random of=${keyfile0} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile0} -dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile1} - -i=1 -for iter in -1 0 64; do - geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " - echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " - echo "ok ${i}"; i=$((i+1)) -done - -rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} diff --git a/sbin/geom/class/tests/eli/init_a_test.sh b/sbin/geom/class/tests/eli/init_a_test.sh deleted file mode 100755 index dbb24fe..0000000 --- a/sbin/geom/class/tests/eli/init_a_test.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 - -echo "1..1380" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp $base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done - done -done - -rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_i_P_test.sh b/sbin/geom/class/tests/eli/init_i_P_test.sh deleted file mode 100755 index 1c59a97..0000000 --- a/sbin/geom/class/tests/eli/init_i_P_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..1" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -i 64 -P -K ${keyfile} md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/init_test.sh b/sbin/geom/class/tests/eli/init_test.sh deleted file mode 100755 index 71dd6e2..0000000 --- a/sbin/geom/class/tests/eli/init_test.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 - -echo "1..460" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp $base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - if [ ${md_rnd} != ${md_edev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done -done - -rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/integrity_copy_test.sh b/sbin/geom/class/tests/eli/integrity_copy_test.sh deleted file mode 100755 index 4c8efd3..0000000 --- a/sbin/geom/class/tests/eli/integrity_copy_test.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -sector=`mktemp $base.XXXXXX` || exit 1 - -echo "1..5520" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - #mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - mdconfig -a -t malloc -s $sectors -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Copy first small sector to the second small sector. - # This should be detected as corruption. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'` - ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Copy first big sector to the second big sector. - # This should be detected as corruption. - dd if=/dev/md${no} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done - -rm -f $keyfile $sector diff --git a/sbin/geom/class/tests/eli/integrity_data_test.sh b/sbin/geom/class/tests/eli/integrity_data_test.sh deleted file mode 100755 index 7ea7c96b..0000000 --- a/sbin/geom/class/tests/eli/integrity_data_test.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -sector=`mktemp $base.XXXXXX` || exit 1 - -echo "1..2760" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Corrupt 8 bytes of data. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=/dev/random of=${sector} bs=1 count=8 seek=64 conv=notrunc >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done - -rm -f $keyfile $sector diff --git a/sbin/geom/class/tests/eli/integrity_hmac_test.sh b/sbin/geom/class/tests/eli/integrity_hmac_test.sh deleted file mode 100755 index 243eac9..0000000 --- a/sbin/geom/class/tests/eli/integrity_hmac_test.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -sector=`mktemp $base.XXXXXX` || exit 1 - -echo "1..2760" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Corrupt 8 bytes of HMAC. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=/dev/random of=${sector} bs=1 count=16 conv=notrunc >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done - -rm -f $keyfile $sector diff --git a/sbin/geom/class/tests/eli/kill_test.sh b/sbin/geom/class/tests/eli/kill_test.sh deleted file mode 100755 index ccced9f..0000000 --- a/sbin/geom/class/tests/eli/kill_test.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile1=`mktemp $base.XXXXXX` || exit 1 -keyfile2=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..9" - -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile1 md${no} -geli attach -p -k $keyfile1 md${no} -geli setkey -n 1 -P -K $keyfile2 md${no} - -# Kill attached provider. -geli kill md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -sleep 1 -# Provider should be automatically detached. -if [ ! -c /dev/md{$no}.eli ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -geli init -B none -P -K $keyfile1 md${no} -geli setkey -n 1 -p -k $keyfile1 -P -K $keyfile2 md${no} - -# Should be possible to attach with keyfile1. -geli attach -p -k $keyfile1 md${no} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi -geli detach md${no} - -# Should be possible to attach with keyfile2. -geli attach -p -k $keyfile2 md${no} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi -geli detach md${no} - -# Kill detached provider. -geli kill md${no} -if [ $? -eq 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi - -rm -f $keyfile1 $keyfile2 diff --git a/sbin/geom/class/tests/eli/nokey_test.sh b/sbin/geom/class/tests/eli/nokey_test.sh deleted file mode 100755 index f32e1a4..0000000 --- a/sbin/geom/class/tests/eli/nokey_test.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..8" - -geli init -B none -P md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K ${keyfile} md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi -geli attach -p md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi -geli attach -p -k ${keyfile} md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi -geli setkey -n 0 -P md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi -geli detach md${no} 2>/dev/null -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi -geli setkey -n 0 -p -P -K ${keyfile} md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi -geli setkey -n 0 -p -k ${keyfile} -P md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/onetime_a_test.sh b/sbin/geom/class/tests/eli/onetime_a_test.sh deleted file mode 100755 index 4e26dfb..0000000 --- a/sbin/geom/class/tests/eli/onetime_a_test.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 - -echo "1..1380" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp $base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done - done -done diff --git a/sbin/geom/class/tests/eli/onetime_d_test.sh b/sbin/geom/class/tests/eli/onetime_d_test.sh deleted file mode 100755 index 51a6abb..0000000 --- a/sbin/geom/class/tests/eli/onetime_d_test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -mdconfig -a -t malloc -s $sectors -u $no || exit 1 - -echo "1..3" - -geli onetime -d md${no} -if [ -c /dev/md${no}.eli ]; then - echo "ok 1" -else - echo "not ok 1" -fi -# Be sure it doesn't detach on read. -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null -sleep 1 -if [ -c /dev/md${no}.eli ]; then - echo "ok 2" -else - echo "not ok 2" -fi -true > /dev/md${no}.eli -sleep 1 -if [ ! -c /dev/md${no}.eli ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -mdconfig -d -u $no diff --git a/sbin/geom/class/tests/eli/onetime_test.sh b/sbin/geom/class/tests/eli/onetime_test.sh deleted file mode 100755 index 17061d0..0000000 --- a/sbin/geom/class/tests/eli/onetime_test.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 - -echo "1..460" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do - ealgo=${cipher%%:*} - keylen=${cipher##*:} - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp $base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors`b -u $no || exit 1 - - geli onetime -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - if [ ${md_rnd} != ${md_edev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done -done diff --git a/sbin/geom/class/tests/eli/readonly_test.sh b/sbin/geom/class/tests/eli/readonly_test.sh deleted file mode 100755 index 721ad62..0000000 --- a/sbin/geom/class/tests/eli/readonly_test.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -keyfile=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..11" - -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi - -geli attach -r -p -k $keyfile md${no} -if [ $? -eq 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -sh -c "true >/dev/md${no}.eli" 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi - -geli kill md${no} -if [ $? -eq 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi - -# kill should detach provider... -if [ ! -c /dev/md{$no}.eli ]; then - echo "ok 5" -else - echo "not ok 5" -fi - -# ...but not destroy the metadata. -geli attach -r -p -k $keyfile md${no} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi - -geli setkey -n 1 -P -K /dev/null md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -geli delkey -n 0 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi - -geli delkey -f -n 0 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi - -geli list md${no}.eli | egrep '^Flags: .*READ-ONLY' >/dev/null -if [ $? -eq 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi - -geli detach md${no} -if [ $? -eq 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi - -mdconfig -d -u $no -rm -f $keyfile diff --git a/sbin/geom/class/tests/eli/resize_test.sh b/sbin/geom/class/tests/eli/resize_test.sh deleted file mode 100755 index 67d6291..0000000 --- a/sbin/geom/class/tests/eli/resize_test.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -echo 1..27 - -BLK=512 -BLKS_PER_MB=2048 - -md=$(mdconfig -s40m) || exit 1 -unit=${md#md} -i=1 - -setsize() { - partszMB=$1 unitszMB=$2 - - { - echo a: $(($partszMB * $BLKS_PER_MB)) 0 4.2BSD 1024 8192 - echo c: $(($unitszMB * $BLKS_PER_MB)) 0 unused 0 0 - } | disklabel -R $md /dev/stdin -} - -# Initialise - -setsize 10 40 || echo -n "not " -echo ok $i - "Sized ${md}a to 10m" -i=$((i + 1)) - -echo secret >tmp.key -geli init -Bnone -PKtmp.key ${md}a || echo -n "not " -echo ok $i - "Initialised geli on ${md}a" -i=$((i + 1)) -geli attach -pk tmp.key ${md}a || echo -n "not " -echo ok $i - "Attached ${md}a as ${md}a.eli" -i=$((i + 1)) - -newfs -U ${md}a.eli >/dev/null || echo -n "not " -echo ok $i - "Initialised the filesystem on ${md}a.eli" -i=$((i + 1)) -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) - - -# Doing a backup, resize & restore must be forced (with -f) as geli -# verifies that the provider size in the metadata matches the consumer. - -geli backup ${md}a tmp.meta || echo -n "not " -echo ok $i - "Backed up ${md}a metadata" -i=$((i + 1)) - -geli detach ${md}a.eli || echo -n "not " -echo ok $i - "Detached ${md}a.eli" -i=$((i + 1)) - -setsize 20 40 || echo -n "not " -echo ok $i - "Sized ${md}a to 20m" -i=$((i + 1)) -geli attach -pktmp.key ${md}a && echo -n "not " -echo ok $i - "Attaching ${md}a fails after resizing the consumer" -i=$((i + 1)) - -geli restore tmp.meta ${md}a && echo -n "not " -echo ok $i - "Restoring metadata on ${md}a.eli fails without -f" -i=$((i + 1)) -geli restore -f tmp.meta ${md}a || echo -n "not " -echo ok $i - "Restoring metadata on ${md}a.eli can be forced" -i=$((i + 1)) - -geli attach -pktmp.key ${md}a || echo -n "not " -echo ok $i - "Attaching ${md}a is now possible" -i=$((i + 1)) - -growfs -y ${md}a.eli >/dev/null || echo -n "not " -echo ok $i - "Extended the filesystem on ${md}a.eli" -i=$((i + 1)) - -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) - - -# Now do the resize properly - -geli detach ${md}a.eli || echo -n "not " -echo ok $i - "Detached ${md}a.eli" -i=$((i + 1)) - -setsize 30 40 || echo -n "not " -echo ok $i - "Sized ${md}a to 30m" -i=$((i + 1)) - -geli resize -s20m ${md}a || echo -n "not " -echo ok $i - "Resizing works ok" -i=$((i + 1)) -geli resize -s20m ${md}a && echo -n "not " -echo ok $i - "Resizing doesn't work a 2nd time (no old metadata)" -i=$((i + 1)) - -geli attach -pktmp.key ${md}a || echo -n "not " -echo ok $i - "Attaching ${md}a works ok" -i=$((i + 1)) - -growfs -y ${md}a.eli >/dev/null || echo -n "not " -echo ok $i - "Extended the filesystem on ${md}a.eli" -i=$((i + 1)) - -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) - -geli detach ${md}a.eli -gpart destroy -F $md >/dev/null - - -# Verify that the man page example works, changing ada0 to $md, -# 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none -# to geli init. - -gpart create -s GPT $md || echo -n "not " -echo ok $i - "Installed a GPT on ${md}" -i=$((i + 1)) -gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " -echo ok $i - "Added a 20m partition in slot 1" -i=$((i + 1)) -geli init -B none -K tmp.key -P ${md}p1 || echo -n "not " -echo ok $i - "Initialised geli on ${md}p1" -i=$((i + 1)) -gpart resize -s 30m -i 1 $md || echo -n "not " -echo ok $i - "Resized partition ${md}p1 to 30m" -i=$((i + 1)) -geli resize -s 20m ${md}p1 || echo -n "not " -echo ok $i - "Resized geli on ${md}p1 to 30m" -i=$((i + 1)) -geli attach -k tmp.key -p ${md}p1 || echo -n "not " -echo ok $i - "Attached ${md}p1.eli" -i=$((i + 1)) - -geli detach ${md}p1.eli - -rm tmp.* diff --git a/sbin/geom/class/tests/eli/setkey_test.sh b/sbin/geom/class/tests/eli/setkey_test.sh deleted file mode 100755 index 458100c..0000000 --- a/sbin/geom/class/tests/eli/setkey_test.sh +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. $(dirname $0)/conf.sh - -base=`basename $0` -sectors=100 -rnd=`mktemp $base.XXXXXX` || exit 1 -keyfile1=`mktemp $base.XXXXXX` || exit 1 -keyfile2=`mktemp $base.XXXXXX` || exit 1 -keyfile3=`mktemp $base.XXXXXX` || exit 1 -keyfile4=`mktemp $base.XXXXXX` || exit 1 -keyfile5=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 - -echo "1..16" - -dd if=/dev/random of=${rnd} bs=512 count=${sectors} >/dev/null 2>&1 -hash1=`dd if=${rnd} bs=512 count=${sectors} 2>/dev/null | md5` -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile5} bs=512 count=16 >/dev/null 2>&1 - -geli init -B none -P -K $keyfile1 md${no} -geli attach -p -k $keyfile1 md${no} - -dd if=${rnd} of=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null -rm -f $rnd -hash2=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` - -# Change current key (0) for attached provider. -geli setkey -P -K $keyfile2 md${no} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -geli detach md${no} - -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi - -# Attach with new key. -geli attach -p -k $keyfile2 md${no} -if [ $? -eq 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi -hash3=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` - -# Change key 1 for attached provider. -geli setkey -n 1 -P -K $keyfile3 md${no} -if [ $? -eq 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi -geli detach md${no} - -# Attach with key 1. -geli attach -p -k $keyfile3 md${no} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi -hash4=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` -geli detach md${no} - -# Change current (1) key for detached provider. -geli setkey -p -k $keyfile3 -P -K $keyfile4 md${no} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi - -# We cannot use keyfile3 anymore. -geli attach -p -k $keyfile3 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi - -# Attach with key 1. -geli attach -p -k $keyfile4 md${no} -if [ $? -eq 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi -hash5=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` -geli detach md${no} - -# Change key 0 for detached provider. -geli setkey -n 0 -p -k $keyfile4 -P -K $keyfile5 md${no} -if [ $? -eq 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi - -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi - -# Attach with key 0. -geli attach -p -k $keyfile5 md${no} -if [ $? -eq 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi -hash6=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` -geli detach md${no} - -if [ ${hash1} = ${hash2} ]; then - echo "ok 12" -else - echo "not ok 12" -fi -if [ ${hash1} = ${hash3} ]; then - echo "ok 13" -else - echo "not ok 13" -fi -if [ ${hash1} = ${hash4} ]; then - echo "ok 14" -else - echo "not ok 14" -fi -if [ ${hash1} = ${hash5} ]; then - echo "ok 15" -else - echo "not ok 15" -fi -if [ ${hash1} = ${hash6} ]; then - echo "ok 16" -else - echo "not ok 16" -fi - -rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 $keyfile5 diff --git a/sbin/geom/class/tests/gate/1_test.sh b/sbin/geom/class/tests/gate/1_test.sh deleted file mode 100755 index fb6fd62..0000000 --- a/sbin/geom/class/tests/gate/1_test.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -base=`basename $0` -us=0 -while [ -c /dev/ggate${us} ]; do - : $(( us += 1 )) -done -conf=`mktemp $base.XXXXXX` || exit 1 -pidfile=ggated.pid -port=33080 - -work=$(attach_md -t malloc -s 1M) -src=$(attach_md -t malloc -s 1M) - -test_cleanup() -{ - ggatec destroy -f -u $us - pkill -F $pidfile - geom_test_cleanup -} -trap test_cleanup ABRT EXIT INT TERM - -dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync -dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync -src_checksum=$(md5 -q /dev/$src) - -echo "127.0.0.1 RW /dev/$work" > $conf - -if ! ggated -F $pidfile -p $port $conf; then - echo 'ggated failed to start' - echo 'Bail out!' - exit 1 -fi -if ! ggatec create -p $port -u $us 127.0.0.1 /dev/$work; then - echo 'ggatec create failed' - echo 'Bail out!' - exit 1 -fi - -dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 -sleep 1 - -echo '1..2' - -work_checksum=$(md5 -q /dev/$work) -if [ "$work_checksum" != "$src_checksum" ]; then - echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" - echo "not ok 2 # SKIP" -else - echo 'ok 1 - md5 checksum' - - ggate_checksum=$(md5 -q /dev/ggate${us}) - if [ "$ggate_checksum" != "$src_checksum" ]; then - echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" - else - echo 'ok 2 - md5 checksum' - fi -fi diff --git a/sbin/geom/class/tests/gate/2_test.sh b/sbin/geom/class/tests/gate/2_test.sh deleted file mode 100755 index be89acc..0000000 --- a/sbin/geom/class/tests/gate/2_test.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -base=`basename $0` -us=46 -work=`mktemp -u $base.XXXXXX` || exit 1 -src=`mktemp -u $base.XXXXXX` || exit 1 - -test_cleanup() -{ - ggatel destroy -f -u $us - rm -f $work $src - - geom_test_cleanup -} -trap test_cleanup ABRT EXIT INT TERM - -dd if=/dev/random of=$work bs=1m count=1 conv=sync -dd if=/dev/random of=$src bs=1m count=1 conv=sync - -if ! ggatel create -u $us $work; then - echo 'ggatel create failed' - echo 'Bail out!' - exit 1 -fi - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 -sleep 1 - -echo '1..2' - -src_checksum=$(md5 -q $src) -work_checksum=$(md5 -q $work) -if [ "$work_checksum" != "$src_checksum" ]; then - echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum) # TODO: bug 204616" - echo 'not ok 2 # SKIP' -else - echo 'ok 1 - md5 checksum' - - ggate_checksum=$(md5 -q /dev/ggate${us}) - if [ "$ggate_checksum" != "$src_checksum" ]; then - echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" - else - echo 'ok 2 - md5 checksum' - fi -fi diff --git a/sbin/geom/class/tests/gate/3_test.sh b/sbin/geom/class/tests/gate/3_test.sh deleted file mode 100755 index 8901aca..0000000 --- a/sbin/geom/class/tests/gate/3_test.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -base=`basename $0` -us=47 - -test_cleanup() -{ - ggatel destroy -f -u $us - - geom_test_cleanup -} -trap test_cleanup ABRT EXIT INT TERM - -work=$(attach_md -t malloc -s 1M) -src=$(attach_md -t malloc -s 1M) - -dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync -dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync -src_checksum=$(md5 -q /dev/$src) - -if ! ggatel create -u $us /dev/$work; then - echo 'ggatel create failed' - echo 'Bail out!' - exit 1 -fi - -dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=sync -sleep 1 - -echo '1..2' - -work_checksum=$(md5 -q /dev/$work) -if [ "$work_checksum" != "$src_checksum" ]; then - echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" - echo 'not ok 2 # SKIP' -else - echo 'ok 1 - md5 checksum' - - ggate_checksum=$(md5 -q /dev/ggate${us}) - if [ "$ggate_checksum" != "$src_checksum" ]; then - echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" - else - echo 'ok 2 - md5 checksum' - fi -fi diff --git a/sbin/geom/class/tests/gate/Makefile b/sbin/geom/class/tests/gate/Makefile deleted file mode 100644 index 985d98f..0000000 --- a/sbin/geom/class/tests/gate/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $FreeBSD$ - -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test -TAP_TESTS_SH+= 3_test - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh -FILESDIR= ${TESTSDIR} - -.include diff --git a/sbin/geom/class/tests/gate/conf.sh b/sbin/geom/class/tests/gate/conf.sh deleted file mode 100755 index 4eede08..0000000 --- a/sbin/geom/class/tests/gate/conf.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="$(mktemp -u gate.XXXXXX)" -class="gate" -base=`basename $0` - -kldstat -q -m g_${class} || kldload geom_${class} || exit 1 - -. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/geom_subr.sh b/sbin/geom/class/tests/geom_subr.sh deleted file mode 100644 index a039377..0000000 --- a/sbin/geom/class/tests/geom_subr.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -if [ $(id -u) -ne 0 ]; then - echo 'Tests must be run as root' - echo 'Bail out!' - exit 1 -fi -kldstat -q -m g_${class} || g${class} load || exit 1 - -devwait() -{ - while :; do - if [ -c /dev/${class}/${name} ]; then - return - fi - sleep 0.2 - done -} - -# Need to keep track of the test md devices to avoid the scenario where a test -# failing will cause the other tests to bomb out, or a test failing will leave -# a large number of md(4) devices lingering around -: ${TMPDIR=/tmp} -export TMPDIR -TEST_MDS_FILE=${TMPDIR}/test_mds - -attach_md() -{ - local test_md - - test_md=$(mdconfig -a "$@") || exit - echo $test_md >> $TEST_MDS_FILE || exit - echo $test_md -} - -geom_test_cleanup() -{ - local test_md - - if [ -f $TEST_MDS_FILE ]; then - while read test_md; do - # The "#" tells the TAP parser this is a comment - echo "# Removing test memory disk: $test_md" - mdconfig -d -u $test_md - done < $TEST_MDS_FILE - fi -} diff --git a/sbin/geom/class/tests/gpt/Makefile b/sbin/geom/class/tests/gpt/Makefile deleted file mode 100644 index be11f0a..0000000 --- a/sbin/geom/class/tests/gpt/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# $FreeBSD$ - -BINDIR= ${TESTSDIR} - -TAP_TESTS_PERL+= gctl_test - -PROGS+= gctl -MAN= - -DPADD.gctl+= ${LIBGEOM} -LDADD.gctl+= -lgeom - -.include diff --git a/sbin/geom/class/tests/gpt/gctl.c b/sbin/geom/class/tests/gpt/gctl.c deleted file mode 100644 index 136a616..0000000 --- a/sbin/geom/class/tests/gpt/gctl.c +++ /dev/null @@ -1,166 +0,0 @@ -/*- - * Copyright (c) 2005, 2006 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include - -#include - -struct retval { - struct retval *retval; - const char *param; - char *value; -}; - -struct retval *retval; -int verbose; - -static void -usage() -{ - fprintf(stdout, "usage: %s [-v] param[:len][=value] ...\n", - getprogname()); - exit(1); -} - -static int -parse(char *arg, char **param, char **value, int *len) -{ - char *e, *colon, *equal; - - if (*arg == '\0') - return (EINVAL); - - colon = strchr(arg, ':'); - equal = strchr(arg, '='); - if (colon == NULL && equal == NULL) - return (EINVAL); - if (colon == arg || equal == arg) - return (EINVAL); - if (colon != NULL && equal != NULL && equal < colon) - return (EINVAL); - - if (colon != NULL) - *colon++ = '\0'; - if (equal != NULL) - *equal++ = '\0'; - - *param = arg; - if (colon != NULL) { - /* Length specification. This parameter is RW. */ - if (*colon == '\0') - return (EINVAL); - *len = strtol(colon, &e, 0); - if (*e != '\0') - return (EINVAL); - if (*len <= 0 || *len > PATH_MAX) - return (EINVAL); - *value = malloc(*len); - if (*value == NULL) - return (ENOMEM); - memset(*value, 0, *len); - if (equal != NULL) { - if (strlen(equal) >= PATH_MAX) - return (ENOMEM); - strcpy(*value, equal); - } - } else { - /* This parameter is RO. */ - *len = -1; - if (*equal == '\0') - return (EINVAL); - *value = equal; - } - - return (0); -} - -int main(int argc, char *argv[]) -{ - struct retval *rv; - struct gctl_req *req; - char *param, *value; - const char *s; - int c, len; - - req = gctl_get_handle(); - gctl_ro_param(req, "class", -1, "GPT"); - - while ((c = getopt(argc, argv, "v")) != -1) { - switch (c) { - case 'v': - verbose = 1; - break; - case '?': - default: - usage(); - /* NOTREACHED */ - break; - } - } - - while (optind < argc) { - if (!parse(argv[optind++], ¶m, &value, &len)) { - if (len > 0) { - rv = malloc(sizeof(struct retval)); - rv->param = param; - rv->value = value; - rv->retval = retval; - retval = rv; - gctl_rw_param(req, param, len, value); - } else - gctl_ro_param(req, param, -1, value); - } - } - - if (verbose) - gctl_dump(req, stdout); - - s = gctl_issue(req); - if (s == NULL) { - printf("PASS"); - while (retval != NULL) { - rv = retval->retval; - printf(" %s=%s", retval->param, retval->value); - free(retval->value); - free(retval); - retval = rv; - } - printf("\n"); - } else - printf("FAIL %s\n", s); - - gctl_free(req); - return (0); -} diff --git a/sbin/geom/class/tests/gpt/gctl_test.pl b/sbin/geom/class/tests/gpt/gctl_test.pl deleted file mode 100755 index 0f30805..0000000 --- a/sbin/geom/class/tests/gpt/gctl_test.pl +++ /dev/null @@ -1,202 +0,0 @@ -#!/usr/bin/env perl -w -# -# Copyright (c) 2005, 2006 Marcel Moolenaar -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ - -my $srcdir = `dirname $0`; -chomp $srcdir; - -my $tmpdir = $ENV{TMPDIR} || "/tmp"; - -my $cmd = "$srcdir/gctl"; -my $out = "$cmd.out"; -my $disk = "$tmpdir/disk-$$"; -my $mntpt = "$tmpdir/mount-$$"; - -my %steps = ( - "000" => "gctl", - "001" => "gctl verb=bogus", - "010" => "gctl verb=create", - "011" => "gctl verb=create provider=bogus", - "020" => "mdcfg create pristine", - "021" => "gctl verb=create provider=%dev% entries=-1", - "022" => "gctl verb=create provider=%dev% entries=128", - "023" => "gctl verb=create provider=%dev%", - "024" => "gctl verb=modify geom=%dev%", - "025" => "conf", - "030" => "gctl verb=add", - "031" => "gctl verb=add geom=bogus", - "032" => "gctl verb=add geom=%dev%", - "033" => "gctl verb=add geom=%dev% type=bogus", - "034" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", - "035" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", - "036" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", - "037" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", - "038" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", - "039" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", - "040" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", - "041" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", - "042" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", - "043" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", - "044" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", - "045" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", - "046" => "gctl verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", - "047" => "conf", - "050" => "gctl verb=remove geom=%dev% entry=5", - "051" => "gctl verb=remove geom=%dev% entry=2", - "052" => "gctl verb=remove geom=%dev% entry=1", - "053" => "gctl verb=remove geom=%dev% entry=1", - "054" => "conf", - "060" => "gctl verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", - "061" => "mount %dev%p1", - "062" => "gctl verb=remove geom=%dev% entry=1", - "063" => "umount %dev%p1", - "064" => "gctl verb=remove geom=%dev% entry=1", - "065" => "conf", - "100" => "mdcfg destroy", - "110" => "mdcfg create corrupted", - "111" => "gctl verb=add geom=%dev%", - "120" => "mdcfg destroy", -); - -my %result = ( - "000" => "FAIL Verb missing", - "001" => "FAIL 22 verb 'bogus'", - "010" => "FAIL 87 provider", - "011" => "FAIL 22 provider 'bogus'", - "020" => "", - "021" => "FAIL 22 entries -1", - "022" => "PASS", - "023" => "FAIL 17 geom '%dev%'", - "024" => "FAIL 87 entry", - "025" => "b1856477950e5786898c8f01361196cf", - "030" => "FAIL 87 geom", - "031" => "FAIL 22 geom 'bogus'", - "032" => "FAIL 87 type", - "033" => "FAIL 22 type 'bogus'", - "034" => "FAIL 87 start", - "035" => "FAIL 22 start 1", - "036" => "FAIL 87 end", - "037" => "FAIL 22 end 12345678", - "038" => "FAIL 22 entry 129", - "039" => "PASS entry=5", - "040" => "FAIL 17 entry 5", - "041" => "FAIL 28 start/end 34/546", - "042" => "FAIL 28 start/end 162/417", - "043" => "FAIL 28 start/end 100/300", - "044" => "FAIL 28 start/end 300/500", - "045" => "PASS entry=1", - "046" => "PASS entry=2", - "047" => "50783a39eecfc62a29db24381e12b9d8", - "050" => "PASS", - "051" => "PASS", - "052" => "PASS", - "053" => "FAIL 2 entry 1", - "054" => "b1856477950e5786898c8f01361196cf", - "060" => "PASS", - "061" => "PASS", - "062" => "FAIL 16", - "063" => "PASS", - "064" => "PASS", - "065" => "b1856477950e5786898c8f01361196cf", - "100" => "", - "110" => "", - "111" => "FAIL 6 geom '%dev%'", - "120" => "", -); - -my $verbose = ""; -if (exists $ENV{'TEST_VERBOSE'}) { - $verbose = "-v"; -} - -# Make sure we have permission to use gctl... -if (`$cmd` =~ "^FAIL Permission denied") { - print "1..0 # SKIP not enough permission\n"; - unlink $cmd; - exit 0; -} - -$count = keys (%steps); -print "1..$count\n"; - -my $nr = 1; -my $dev = "n/a"; -foreach my $key (sort keys %steps) { - my ($action, $args) = split(/ /, $steps{$key}, 2); - my $res = $result{$key}; - $args = "" if (not defined $args); - $args =~ s/%dev%/$dev/g; - $res =~ s/%dev%/$dev/g; - - if ($action =~ "^gctl") { - system("$cmd $verbose $args | tee $out 2>&1"); - $st = `tail -1 $out`; - if ($st =~ "^$res") { - print "ok $nr \# gctl($key)\n"; - } else { - print "not ok $nr \# gctl($key) - $st\n"; - } - unlink $out; - } elsif ($action =~ "^mdcfg") { - if ($args =~ "^create") { - system("dd if=/dev/zero of=$disk count=1024 2>&1"); - if ($args =~ "corrupted") { - system("gpt create -p $disk"); - } - $dev = `mdconfig -a -t vnode -f $disk`; - chomp $dev; - } elsif ($args =~ "^destroy") { - $dev =~ s/md/-u /g; - system("mdconfig -d $dev"); - unlink $disk; - $dev = "n/a"; - } - print "ok $nr \# mdcfg($key)\n"; - } elsif ($action =~ "^conf") { - system("sysctl -b kern.geom.conftxt | grep -a $dev | sed -e s:$disk:DISK:g -e s:$dev:DEV:g | sort | md5 -p | tee $out 2>&1"); - $st = `tail -1 $out`; - if ($st =~ "^$res") { - print "ok $nr \# conf($key)\n"; - } else { - print "not ok $nr \# conf($key) - $st\n"; - } - unlink $out; - } elsif ($action =~ "^mount") { - system("mkdir $mntpt-$args"); - system("newfs $args"); - system("mount -t ufs /dev/$args $mntpt-$args"); - print "ok $nr \# mount($key)\n"; - } elsif ($action =~ "^umount") { - system("umount $mntpt-$args"); - system("rmdir $mntpt-$args"); - print "ok $nr \# umount($key)\n"; - } - $nr += 1; -} - -unlink $cmd; -exit 0; diff --git a/sbin/geom/class/tests/mirror/1_test.sh b/sbin/geom/class/tests/mirror/1_test.sh deleted file mode 100755 index af82a14..0000000 --- a/sbin/geom/class/tests/mirror/1_test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=$(attach_md -t malloc -s 1M) || exit 1 -us1=$(attach_md -t malloc -s 2M) || exit 1 -us2=$(attach_md -t malloc -s 3M) || exit 1 - -gmirror label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 -devwait - -# Size of created device should be 1MB - 512b. - -size=`diskinfo /dev/mirror/${name} | awk '{print $3}'` - -if [ $size -eq 1048064 ]; then - echo "ok 1" -else - echo "not ok 1" -fi diff --git a/sbin/geom/class/tests/mirror/2_test.sh b/sbin/geom/class/tests/mirror/2_test.sh deleted file mode 100755 index 5605c44..0000000 --- a/sbin/geom/class/tests/mirror/2_test.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..4" - -balance="round-robin" -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 - -gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi -dd if=/dev/${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi -dd if=/dev/${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/3_test.sh b/sbin/geom/class/tests/mirror/3_test.sh deleted file mode 100755 index b7f8525..0000000 --- a/sbin/geom/class/tests/mirror/3_test.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..5" - -balance="round-robin" -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 - -gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gmirror remove $name ${us0} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name ${us1} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -gmirror remove $name ${us2} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -# mirror/${name} should be removed. -if [ -c /dev/${name} ]; then - echo "not ok 5" -else - echo "ok 5" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/4_test.sh b/sbin/geom/class/tests/mirror/4_test.sh deleted file mode 100755 index 6efcc02..0000000 --- a/sbin/geom/class/tests/mirror/4_test.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..5" - -balance="load" -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 - -gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gmirror remove $name ${us0} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name ${us1} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -gmirror remove $name ${us2} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -gmirror destroy $name - -# mirror/${name} should be removed. -if [ -c /dev/${name} ]; then - echo "not ok 5" -else - echo "ok 5" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/5_test.sh b/sbin/geom/class/tests/mirror/5_test.sh deleted file mode 100755 index 3a176b5..0000000 --- a/sbin/geom/class/tests/mirror/5_test.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..5" - -balance="split" -ddbs=8192 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 - -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gmirror remove $name ${us0} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name ${us1} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -gmirror remove $name ${us2} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -# mirror/${name} should be removed. -if [ -c /dev/${name} ]; then - echo "not ok 5" -else - echo "ok 5" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/6_test.sh b/sbin/geom/class/tests/mirror/6_test.sh deleted file mode 100755 index 68036e9..0000000 --- a/sbin/geom/class/tests/mirror/6_test.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..2" - -balance="split" -ddbs=8192 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 - -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -dd if=/dev/zero of=/dev/${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -# Connect disk to the mirror. -gmirror insert ${name} ${us2} -# Wait for synchronization. -sleep 1 -dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/7_test.sh b/sbin/geom/class/tests/mirror/7_test.sh deleted file mode 100755 index f5bf71a..0000000 --- a/sbin/geom/class/tests/mirror/7_test.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..5" - -balance="prefer" -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 - -gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -gmirror remove $name ${us0} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -gmirror remove $name ${us1} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -gmirror remove $name ${us2} -dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -# mirror/${name} should be removed. -if [ -c /dev/${name} ]; then - echo "not ok 5" -else - echo "ok 5" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/mirror/Makefile b/sbin/geom/class/tests/mirror/Makefile deleted file mode 100644 index cf3784f..0000000 --- a/sbin/geom/class/tests/mirror/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# $FreeBSD$ - -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test -TAP_TESTS_SH+= 3_test -TAP_TESTS_SH+= 4_test -TAP_TESTS_SH+= 5_test -TAP_TESTS_SH+= 6_test -TAP_TESTS_SH+= 7_test - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh -FILESDIR= ${TESTSDIR} - -.include diff --git a/sbin/geom/class/tests/mirror/conf.sh b/sbin/geom/class/tests/mirror/conf.sh deleted file mode 100755 index d8595f1..0000000 --- a/sbin/geom/class/tests/mirror/conf.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="$(mktemp -u mirror.XXXXXX)" -class="mirror" -base=`basename $0` - -gmirror_test_cleanup() -{ - [ -c /dev/$class/$name ] && gmirror destroy $name - geom_test_cleanup -} -trap gmirror_test_cleanup ABRT EXIT INT TERM - -. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/nop/1_test.sh b/sbin/geom/class/tests/nop/1_test.sh deleted file mode 100755 index 4d6b65d..0000000 --- a/sbin/geom/class/tests/nop/1_test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us=$(attach_md -t malloc -s 1M) || exit 1 - -gnop create /dev/${us} || exit 1 - -# Size of created device should be 1MB. - -size=`diskinfo /dev/${us}.nop | awk '{print $3}'` - -if [ $size -eq 1048576 ]; then - echo "ok 1" -else - echo "not ok 1" -fi diff --git a/sbin/geom/class/tests/nop/2_test.sh b/sbin/geom/class/tests/nop/2_test.sh deleted file mode 100755 index 7422345..0000000 --- a/sbin/geom/class/tests/nop/2_test.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -echo "1..1" - -dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1 - -us=$(attach_md -t malloc -s 1M) || exit 1 - -gnop create /dev/${us} || exit 1 - -dd if=${src} of=/dev/${us}.nop bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 - -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/nop/Makefile b/sbin/geom/class/tests/nop/Makefile deleted file mode 100644 index 81a4e99..0000000 --- a/sbin/geom/class/tests/nop/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh -FILESDIR= ${TESTSDIR} - -.include diff --git a/sbin/geom/class/tests/nop/conf.sh b/sbin/geom/class/tests/nop/conf.sh deleted file mode 100755 index e38e10c..0000000 --- a/sbin/geom/class/tests/nop/conf.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -class="nop" -base=`basename $0` - -gnop_test_cleanup() -{ - [ -c /dev/${us}.nop ] && gnop destroy ${us}.nop - geom_test_cleanup -} -trap gnop_test_cleanup ABRT EXIT INT TERM - -. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/raid3/10_test.sh b/sbin/geom/class/tests/raid3/10_test.sh deleted file mode 100755 index edd827d..0000000 --- a/sbin/geom/class/tests/raid3/10_test.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label -r $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/11_test.sh b/sbin/geom/class/tests/raid3/11_test.sh deleted file mode 100755 index 0407261..0000000 --- a/sbin/geom/class/tests/raid3/11_test.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/12_test.sh b/sbin/geom/class/tests/raid3/12_test.sh deleted file mode 100755 index 10533c6..0000000 --- a/sbin/geom/class/tests/raid3/12_test.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -nblocks1=9 -nblocks2=`expr $nblocks1 - 1` -nblocks3=`expr $nblocks2 / 2` - -us0=$(attach_md -t malloc -s $nblocks1) || exit 1 -us1=$(attach_md -t malloc -s $nblocks1) || exit 1 -us2=$(attach_md -t malloc -s $nblocks1) || exit 1 - -dd if=/dev/random of=/dev/${us0} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/${us1} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/${us2} count=$nblocks1 >/dev/null 2>&1 - -graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait -# Wait for synchronization. -sleep 2 -graid3 stop $name -# Break one component. -dd if=/dev/random of=/dev/${us1} count=$nblocks2 >/dev/null 2>&1 -# Provoke retaste of the rest components. -true > /dev/${us0} -true > /dev/${us2} -sleep 1 - -dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 -ec=$? -if [ $ec -eq 0 ]; then - echo "not ok 1" -else - echo "ok 1" -fi diff --git a/sbin/geom/class/tests/raid3/1_test.sh b/sbin/geom/class/tests/raid3/1_test.sh deleted file mode 100755 index 4c0b4a2..0000000 --- a/sbin/geom/class/tests/raid3/1_test.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..2" - -us0=$(attach_md -t malloc -s 1M) || exit 1 -us1=$(attach_md -t malloc -s 2M) || exit 1 -us2=$(attach_md -t malloc -s 3M) || exit 1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 -devwait - -# Size of created device should be 2MB - 1024B. - -mediasize=`diskinfo /dev/raid3/${name} | awk '{print $3}'` -if [ $mediasize -eq 2096128 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -sectorsize=`diskinfo /dev/raid3/${name} | awk '{print $2}'` -if [ $sectorsize -eq 1024 ]; then - echo "ok 2" -else - echo "not ok 2" -fi diff --git a/sbin/geom/class/tests/raid3/2_test.sh b/sbin/geom/class/tests/raid3/2_test.sh deleted file mode 100755 index 22ebd38..0000000 --- a/sbin/geom/class/tests/raid3/2_test.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/3_test.sh b/sbin/geom/class/tests/raid3/3_test.sh deleted file mode 100755 index f068b06..0000000 --- a/sbin/geom/class/tests/raid3/3_test.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -# -# Reading without one DATA component (so with parity). -# -graid3 remove -n 1 $name -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/4_test.sh b/sbin/geom/class/tests/raid3/4_test.sh deleted file mode 100755 index 810f13d..0000000 --- a/sbin/geom/class/tests/raid3/4_test.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -# -# Writing without one DATA component. -# -graid3 remove -n 1 $name -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/5_test.sh b/sbin/geom/class/tests/raid3/5_test.sh deleted file mode 100755 index 7bc8d42..0000000 --- a/sbin/geom/class/tests/raid3/5_test.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -# -# Writing without PARITY component. -# -graid3 remove -n 2 $name -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/6_test.sh b/sbin/geom/class/tests/raid3/6_test.sh deleted file mode 100755 index 20bf192..0000000 --- a/sbin/geom/class/tests/raid3/6_test.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -# -# Rebuild of DATA component. -# -graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 -graid3 insert -n 1 $name md${us1} -sleep 1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/7_test.sh b/sbin/geom/class/tests/raid3/7_test.sh deleted file mode 100755 index 23666f8..0000000 --- a/sbin/geom/class/tests/raid3/7_test.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -# -# Rebuild of PARITY component. -# -graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 -graid3 insert -n 2 $name md${us2} -sleep 1 -# Remove DATA component, so PARITY component can be used while reading. -graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/8_test.sh b/sbin/geom/class/tests/raid3/8_test.sh deleted file mode 100755 index 2eb9b1a..0000000 --- a/sbin/geom/class/tests/raid3/8_test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -# -# Writing without DATA component and rebuild of DATA component. -# -graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 insert -n 1 $name md${us1} -sleep 1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/9_test.sh b/sbin/geom/class/tests/raid3/9_test.sh deleted file mode 100755 index 0ef010a..0000000 --- a/sbin/geom/class/tests/raid3/9_test.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -ddbs=2048 -nblocks1=1024 -nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 - -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 - -graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 -devwait - -# -# Writing without PARITY component and rebuild of PARITY component. -# -graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 -dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 insert -n 2 $name md${us2} -sleep 1 -# Remove DATA component, so PARITY component can be used while reading. -graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 - -dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/raid3/Makefile b/sbin/geom/class/tests/raid3/Makefile deleted file mode 100644 index c1c95f1..0000000 --- a/sbin/geom/class/tests/raid3/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# $FreeBSD$ - -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test -TAP_TESTS_SH+= 3_test -TAP_TESTS_SH+= 4_test -TAP_TESTS_SH+= 5_test -TAP_TESTS_SH+= 6_test -TAP_TESTS_SH+= 7_test -TAP_TESTS_SH+= 8_test -TAP_TESTS_SH+= 9_test -TAP_TESTS_SH+= 10_test -TAP_TESTS_SH+= 11_test -TAP_TESTS_SH+= 12_test - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh -FILESDIR= ${TESTSDIR} - -.include diff --git a/sbin/geom/class/tests/raid3/conf.sh b/sbin/geom/class/tests/raid3/conf.sh deleted file mode 100755 index 4f141df..0000000 --- a/sbin/geom/class/tests/raid3/conf.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="test" -class="raid3" -base=`basename $0` - -graid3_test_cleanup() -{ - [ -c /dev/$class/$name ] && graid3 stop $name - geom_test_cleanup -} -trap graid3_test_cleanup ABRT EXIT INT TERM - -. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/shsec/1_test.sh b/sbin/geom/class/tests/shsec/1_test.sh deleted file mode 100755 index ab0bb37..0000000 --- a/sbin/geom/class/tests/shsec/1_test.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..2" - -us0=$(attach_md -t malloc -s 1M) || exit 1 -us1=$(attach_md -t malloc -s 2M) || exit 1 -us2=$(attach_md -t malloc -s 3M) || exit 1 - -gshsec label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 -devwait - -# Size of created device should be 1MB - 512B. - -mediasize=`diskinfo /dev/shsec/${name} | awk '{print $3}'` -if [ $mediasize -eq 1048064 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -sectorsize=`diskinfo /dev/shsec/${name} | awk '{print $2}'` -if [ $sectorsize -eq 512 ]; then - echo "ok 2" -else - echo "not ok 2" -fi diff --git a/sbin/geom/class/tests/shsec/2_test.sh b/sbin/geom/class/tests/shsec/2_test.sh deleted file mode 100755 index 9dfe36a..0000000 --- a/sbin/geom/class/tests/shsec/2_test.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..4" - -nblocks1=1024 -nblocks2=`expr $nblocks1 + 1` -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 - -us0=$(attach_md -t malloc -s $nblocks2) || exit 1 -us1=$(attach_md -t malloc -s $nblocks2) || exit 1 -us2=$(attach_md -t malloc -s $nblocks2) || exit 1 - -gshsec label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 -devwait - -dd if=${src} of=/dev/shsec/${name} count=$nblocks1 >/dev/null 2>&1 - -dd if=/dev/shsec/${name} of=${dst} count=$nblocks1 >/dev/null 2>&1 -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -dd if=/dev/${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 -if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then - echo "not ok 2" -else - echo "ok 2" -fi - -dd if=/dev/${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 -if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then - echo "not ok 3" -else - echo "ok 3" -fi - -dd if=/dev/${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 -if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then - echo "not ok 4" -else - echo "ok 4" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/shsec/Makefile b/sbin/geom/class/tests/shsec/Makefile deleted file mode 100644 index 81a4e99..0000000 --- a/sbin/geom/class/tests/shsec/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh -FILESDIR= ${TESTSDIR} - -.include diff --git a/sbin/geom/class/tests/shsec/conf.sh b/sbin/geom/class/tests/shsec/conf.sh deleted file mode 100755 index 7800eb7..0000000 --- a/sbin/geom/class/tests/shsec/conf.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="$(mktemp -u shsec.XXXXXX)" -class="shsec" -base=`basename $0` - -shsec_test_cleanup() -{ - [ -c /dev/$class/$name ] && gshsec stop $name - geom_test_cleanup -} -trap shsec_test_cleanup ABRT EXIT INT TERM - -. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/stripe/1_test.sh b/sbin/geom/class/tests/stripe/1_test.sh deleted file mode 100755 index 7923763..0000000 --- a/sbin/geom/class/tests/stripe/1_test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -us0=$(attach_md -t malloc -s 1M) || exit 1 -us1=$(attach_md -t malloc -s 2M) || exit 1 -us2=$(attach_md -t malloc -s 3M) || exit 1 - -gstripe create -s 16384 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 -devwait - -# Size of created device should be 1MB * 3. - -size=`diskinfo /dev/stripe/${name} | awk '{print $3}'` - -if [ $size -eq 3145728 ]; then - echo "ok 1" -else - echo "not ok 1" -fi diff --git a/sbin/geom/class/tests/stripe/2_test.sh b/sbin/geom/class/tests/stripe/2_test.sh deleted file mode 100755 index f6e11f5..0000000 --- a/sbin/geom/class/tests/stripe/2_test.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -. `dirname $0`/conf.sh - -echo "1..1" - -tsize=3 -src=`mktemp $base.XXXXXX` || exit 1 -dst=`mktemp $base.XXXXXX` || exit 1 - -dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 - -us0=$(attach_md -t malloc -s 1M) || exit 1 -us1=$(attach_md -t malloc -s 2M) || exit 1 -us2=$(attach_md -t malloc -s 3M) || exit 1 - -gstripe create -s 8192 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 -devwait - -dd if=${src} of=/dev/stripe/${name} bs=1m count=$tsize >/dev/null 2>&1 -dd if=/dev/stripe/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 - -if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "not ok 1" -else - echo "ok 1" -fi - -rm -f ${src} ${dst} diff --git a/sbin/geom/class/tests/stripe/Makefile b/sbin/geom/class/tests/stripe/Makefile deleted file mode 100644 index 81a4e99..0000000 --- a/sbin/geom/class/tests/stripe/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh -FILESDIR= ${TESTSDIR} - -.include diff --git a/sbin/geom/class/tests/stripe/conf.sh b/sbin/geom/class/tests/stripe/conf.sh deleted file mode 100755 index fd0f41c..0000000 --- a/sbin/geom/class/tests/stripe/conf.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -name="$(mktemp -u stripe.XXXXXX)" -class="stripe" -base=`basename $0` - -gstripe_test_cleanup() -{ - [ -c /dev/$class/$name ] && gstripe destroy $name - geom_test_cleanup -} -trap gstripe_test_cleanup ABRT EXIT INT TERM - -. `dirname $0`/../geom_subr.sh diff --git a/sbin/geom/class/tests/uzip/1_test.sh b/sbin/geom/class/tests/uzip/1_test.sh deleted file mode 100755 index 222b6c9..0000000 --- a/sbin/geom/class/tests/uzip/1_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -testsdir=$(dirname $0) -. $testsdir/conf.sh - -echo "1..1" - -UUE=$testsdir/1.img.uzip.uue -uudecode $UUE -us0=$(attach_md -f $(basename $UUE .uue)) || exit 1 -sleep 1 - -mount -o ro /dev/${us0}.uzip "${mntpoint}" || exit 1 - -#cat "${mntpoint}/etalon.txt" -diff -I '\$FreeBSD.*\$' -u $testsdir/etalon/etalon.txt "${mntpoint}/etalon.txt" -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi diff --git a/sbin/geom/class/tests/uzip/Makefile b/sbin/geom/class/tests/uzip/Makefile deleted file mode 100644 index b4e1d7d..0000000 --- a/sbin/geom/class/tests/uzip/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# -# $FreeBSD$ -# -# Regression test for geom_uzip. -# - -IMAGE= 1.img -ZIMAGE= ${IMAGE}.uzip -UZIMAGE= ${ZIMAGE}.uue - -CLEANFILES+= ${IMAGE} ${UZIMAGE} ${ZIMAGE} - -${IMAGE}: - makefs -s 1048576 ${.TARGET} ${.CURDIR}/etalon - -${ZIMAGE}: ${IMAGE} - mkuzip -o ${.TARGET} ${.ALLSRC} - -${UZIMAGE}: ${IMAGE} ${ZIMAGE} - printf "#\n# $$" >${.TARGET} - printf "FreeBSD$$\n#\n\n" >> ${.TARGET} - uuencode ${ZIMAGE} ${ZIMAGE} >>${.TARGET} - -FILES+= conf.sh -FILESNAME_conf.sh= conf.sh - -FILES+= ${UZIMAGE} -FILESDIR= ${TESTSDIR} - -FILESGROUPS= FILES etalon -etalon+= etalon/etalon.txt -etalonDIR= ${TESTSDIR}/etalon - -TAP_TESTS_SH+= 1_test - -.include diff --git a/sbin/geom/class/tests/uzip/conf.sh b/sbin/geom/class/tests/uzip/conf.sh deleted file mode 100755 index 8a3b459..0000000 --- a/sbin/geom/class/tests/uzip/conf.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -class="uzip" -base=`basename $0` - -uzip_test_cleanup() -{ - umount $mntpoint - rmdir $mntpoint - geom_test_cleanup -} -trap uzip_test_cleanup ABRT EXIT INT TERM - -. `dirname $0`/../geom_subr.sh - -# NOTE: make sure $TMPDIR has been set by geom_subr.sh if unset [by kyua, etc] -mntpoint=$(mktemp -d tmp.XXXXXX) || exit diff --git a/sbin/geom/class/tests/uzip/etalon/etalon.txt b/sbin/geom/class/tests/uzip/etalon/etalon.txt deleted file mode 100644 index cb8acf3..0000000 --- a/sbin/geom/class/tests/uzip/etalon/etalon.txt +++ /dev/null @@ -1,43 +0,0 @@ -# -# $FreeBSD$ -# - -JABBERWOCKY - -Lewis Carroll -(from Through the Looking-Glass and What Alice Found There, 1872) - -`Twas brillig, and the slithy toves -Did gyre and gimble in the wabe: -All mimsy were the borogoves, -And the mome raths outgrabe. - -"Beware the Jabberwock, my son! -The jaws that bite, the claws that catch! -Beware the Jubjub bird, and shun -The frumious Bandersnatch!" - -He took his vorpal sword in hand: -Long time the manxome foe he sought -- -So rested he by the Tumtum tree, -And stood awhile in thought. - -And, as in uffish thought he stood, -The Jabberwock, with eyes of flame, -Came whiffling through the tulgey wood, -And burbled as it came! - -One, two! One, two! And through and through -The vorpal blade went snicker-snack! -He left it dead, and with its head -He went galumphing back. - -"And, has thou slain the Jabberwock? -Come to my arms, my beamish boy! -O frabjous day! Callooh! Callay!' -He chortled in his joy. - -`Twas brillig, and the slithy toves -Did gyre and gimble in the wabe; -All mimsy were the borogoves, -And the mome raths outgrabe. diff --git a/sbin/geom/tests/Makefile b/sbin/geom/tests/Makefile deleted file mode 100644 index f0d4d12..0000000 --- a/sbin/geom/tests/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${SRCTOP}/tests - -TESTSDIR= ${TESTSBASE}/sbin/geom -KYUAFILE= yes - -.include diff --git a/tests/sys/Makefile b/tests/sys/Makefile index 702f664..a1f1ad6 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -8,6 +8,7 @@ TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file +TESTS_SUBDIRS+= geom TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue TESTS_SUBDIRS+= mac diff --git a/tests/sys/geom/class/Makefile b/tests/sys/geom/class/Makefile new file mode 100644 index 0000000..c705616 --- /dev/null +++ b/tests/sys/geom/class/Makefile @@ -0,0 +1,21 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/geom/class + +TESTS_SUBDIRS+= concat +TESTS_SUBDIRS+= eli +TESTS_SUBDIRS+= gate +# XXX: might not work due to geom(4) changes; more investigation's needed +#TESTS_SUBDIRS+= gpt +TESTS_SUBDIRS+= mirror +TESTS_SUBDIRS+= nop +TESTS_SUBDIRS+= raid3 +TESTS_SUBDIRS+= shsec +TESTS_SUBDIRS+= stripe +TESTS_SUBDIRS+= uzip + +BINDIR= ${TESTSDIR} + +FILES+= geom_subr.sh + +.include diff --git a/tests/sys/geom/class/Makefile.inc b/tests/sys/geom/class/Makefile.inc new file mode 100644 index 0000000..17e59b0 --- /dev/null +++ b/tests/sys/geom/class/Makefile.inc @@ -0,0 +1,5 @@ +# $FreeBSD$ + +GEOM_CLASS= ${.CURDIR:T} + +TESTSDIR= ${TESTSBASE}/sys/geom/class/${GEOM_CLASS} diff --git a/tests/sys/geom/class/concat/1_test.sh b/tests/sys/geom/class/concat/1_test.sh new file mode 100755 index 0000000..ef80a61 --- /dev/null +++ b/tests/sys/geom/class/concat/1_test.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo '1..1' + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 +devwait + +# Size of created device should be 1MB + 2MB + 3MB. + +size=`diskinfo /dev/concat/${name} | awk '{print $3}'` + +if [ $size -eq 6291456 ]; then + echo "ok - Size is 6291456" +else + echo "not ok - Size is 6291456" +fi diff --git a/tests/sys/geom/class/concat/2_test.sh b/tests/sys/geom/class/concat/2_test.sh new file mode 100755 index 0000000..95636be --- /dev/null +++ b/tests/sys/geom/class/concat/2_test.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo '1..1' + +tsize=6 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 + +gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 +devwait + +dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1 +dd if=/dev/concat/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 + +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok - md5 checksum comparison" +else + echo "ok - md5 checksum comparison" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/concat/Makefile b/tests/sys/geom/class/concat/Makefile new file mode 100644 index 0000000..81a4e99 --- /dev/null +++ b/tests/sys/geom/class/concat/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/tests/sys/geom/class/concat/conf.sh b/tests/sys/geom/class/concat/conf.sh new file mode 100755 index 0000000..374ed12 --- /dev/null +++ b/tests/sys/geom/class/concat/conf.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# $FreeBSD$ + +name="$(mktemp -u concat.XXXXXX)" +class="concat" +base=`basename $0` + +gconcat_test_cleanup() +{ + [ -c /dev/$class/$name ] && gconcat destroy $name + geom_test_cleanup +} +trap gconcat_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh diff --git a/tests/sys/geom/class/eli/Makefile b/tests/sys/geom/class/eli/Makefile new file mode 100644 index 0000000..1846ed6 --- /dev/null +++ b/tests/sys/geom/class/eli/Makefile @@ -0,0 +1,36 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= attach_d_test +TAP_TESTS_SH+= configure_b_B_test +TAP_TESTS_SH+= delkey_test +TAP_TESTS_SH+= detach_l_test +TAP_TESTS_SH+= init_B_test +TAP_TESTS_SH+= init_J_test +TAP_TESTS_SH+= init_a_test +TAP_TESTS_SH+= init_i_P_test +TAP_TESTS_SH+= init_test +TAP_TESTS_SH+= integrity_copy_test +TAP_TESTS_SH+= integrity_data_test +TAP_TESTS_SH+= integrity_hmac_test +TAP_TESTS_SH+= kill_test +TAP_TESTS_SH+= nokey_test +TAP_TESTS_SH+= onetime_a_test +TAP_TESTS_SH+= onetime_d_test +TAP_TESTS_SH+= onetime_test +TAP_TESTS_SH+= readonly_test +TAP_TESTS_SH+= resize_test +TAP_TESTS_SH+= setkey_test + +TEST_METADATA.init_a_test+= timeout="1200" +TEST_METADATA.init_test+= timeout="300" +TEST_METADATA.integrity_copy_test+= timeout="1200" +TEST_METADATA.integrity_data_test+= timeout="600" +TEST_METADATA.integrity_hmac_test+= timeout="600" +TEST_METADATA.onetime_a_test+= timeout="600" +TEST_METADATA.onetime_test+= timeout="600" + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/tests/sys/geom/class/eli/attach_d_test.sh b/tests/sys/geom/class/eli/attach_d_test.sh new file mode 100755 index 0000000..5d700b3 --- /dev/null +++ b/tests/sys/geom/class/eli/attach_d_test.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..3" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile md${no} +geli attach -d -p -k $keyfile md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 1" +else + echo "not ok 1" +fi +# Be sure it doesn't detach on read. +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ -c /dev/md${no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi +true > /dev/md${no}.eli +sleep 1 +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +rm -f $keyfile diff --git a/tests/sys/geom/class/eli/conf.sh b/tests/sys/geom/class/eli/conf.sh new file mode 100755 index 0000000..080fa61 --- /dev/null +++ b/tests/sys/geom/class/eli/conf.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# $FreeBSD$ + +class="eli" +base=`basename $0` + +no=0 +while [ -c /dev/md$no ]; do + : $(( no += 1 )) +done + +geli_test_cleanup() +{ + [ -c /dev/md${no}.eli ] && geli detach md${no}.eli + mdconfig -d -u $no +} +trap geli_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh diff --git a/tests/sys/geom/class/eli/configure_b_B_test.sh b/tests/sys/geom/class/eli/configure_b_B_test.sh new file mode 100755 index 0000000..b6cdf4f --- /dev/null +++ b/tests/sys/geom/class/eli/configure_b_B_test.sh @@ -0,0 +1,129 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..17" + +geli init -B none -P -K /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +geli init -B none -b -P -K /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +geli configure -B md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi + +geli configure -b md${no} +if [ $? -eq 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +geli attach -p -k /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +geli configure -B md${no} +if [ $? -eq 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -ne 0 ]; then + echo "ok 12" +else + echo "not ok 12" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 13" +else + echo "not ok 13" +fi + +geli configure -b md${no} +if [ $? -eq 0 ]; then + echo "ok 14" +else + echo "not ok 14" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 15" +else + echo "not ok 15" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 16" +else + echo "not ok 16" +fi + +geli detach md${no} +if [ $? -eq 0 ]; then + echo "ok 17" +else + echo "not ok 17" +fi diff --git a/tests/sys/geom/class/eli/delkey_test.sh b/tests/sys/geom/class/eli/delkey_test.sh new file mode 100755 index 0000000..67b253e --- /dev/null +++ b/tests/sys/geom/class/eli/delkey_test.sh @@ -0,0 +1,140 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..14" + +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile1 md${no} +geli attach -p -k $keyfile1 md${no} +geli setkey -n 1 -P -K $keyfile2 md${no} + +# Remove key 0 for attached provider. +geli delkey -n 0 md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +geli detach md${no} + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +# Attach with key 1. +geli attach -p -k $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +# We cannot remove last key without -f option (for attached provider). +geli delkey -n 1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +# Remove last key for attached provider. +geli delkey -f -n 1 md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi + +# If there are no valid keys, but provider is attached, we can save situation. +geli setkey -n 0 -P -K $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi +geli detach md${no} + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +# Attach with key 0. +geli attach -p -k $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +# Setup key 1. +geli setkey -n 1 -P -K $keyfile4 md${no} +if [ $? -eq 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi +geli detach md${no} + +# Remove key 1 for detached provider. +geli delkey -n 1 md${no} +if [ $? -eq 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +# We cannot use keyfile4 anymore. +geli attach -p -k $keyfile4 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi + +# We cannot remove last key without -f option (for detached provider). +geli delkey -n 0 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 12" +else + echo "not ok 12" +fi + +# Remove last key for detached provider. +geli delkey -f -n 0 md${no} +if [ $? -eq 0 ]; then + echo "ok 13" +else + echo "not ok 13" +fi + +# We cannot use keyfile3 anymore. +geli attach -p -k $keyfile3 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 14" +else + echo "not ok 14" +fi + +rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 diff --git a/tests/sys/geom/class/eli/detach_l_test.sh b/tests/sys/geom/class/eli/detach_l_test.sh new file mode 100755 index 0000000..605ae94 --- /dev/null +++ b/tests/sys/geom/class/eli/detach_l_test.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..4" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile md${no} +geli attach -p -k $keyfile md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 1" +else + echo "not ok 1" +fi +# Be sure it doesn't detach before 'detach -l'. +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ -c /dev/md${no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi +geli detach -l md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 3" +else + echo "not ok 3" +fi +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +rm -f $keyfile diff --git a/tests/sys/geom/class/eli/init_B_test.sh b/tests/sys/geom/class/eli/init_B_test.sh new file mode 100755 index 0000000..3ba743c --- /dev/null +++ b/tests/sys/geom/class/eli/init_B_test.sh @@ -0,0 +1,104 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +backupfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..13" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +mdconfig -a -t malloc -s $sectors -u $no || exit 1 + +# -B none +rm -f /var/backups/md${no}.eli +geli init -B none -P -K $keyfile md${no} 2>/dev/null +if [ ! -f /var/backups/md${no}.eli ]; then + echo "ok 1 - -B none" +else + echo "not ok 1 - -B none" +fi + +# no -B +rm -f /var/backups/md${no}.eli +geli init -P -K $keyfile md${no} >/dev/null 2>&1 +if [ -f /var/backups/md${no}.eli ]; then + echo "ok 2 - no -B" +else + echo "not ok 2 - no -B" +fi +geli clear md${no} +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3 - no -B" +else + echo "not ok 3 - no -B" +fi +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 4 - no -B" +else + echo "not ok 4 - no -B" +fi +geli restore /var/backups/md${no}.eli md${no} +if [ $? -eq 0 ]; then + echo "ok 5 - no -B" +else + echo "not ok 5 - no -B" +fi +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 6 - no -B" +else + echo "not ok 6 - no -B" +fi +if [ -c /dev/md${no}.eli ]; then + echo "ok 7 - no -B" +else + echo "not ok 7 - no -B" +fi +geli detach md${no} +rm -f /var/backups/md${no}.eli + +# -B file +rm -f $backupfile +geli init -B $backupfile -P -K $keyfile md${no} >/dev/null 2>&1 +if [ -f $backupfile ]; then + echo "ok 8 - -B file" +else + echo "not ok 8 - -B file" +fi +geli clear md${no} +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 9 - -B file" +else + echo "not ok 9 - -B file" +fi +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 10 - -B file" +else + echo "not ok 10 - -B file" +fi +geli restore $backupfile md${no} +if [ $? -eq 0 ]; then + echo "ok 11 - -B file" +else + echo "not ok 11 - -B file" +fi +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 12 - -B file" +else + echo "not ok 12 - -B file" +fi +if [ -c /dev/md${no}.eli ]; then + echo "ok 13 - -B file" +else + echo "not ok 13 - -B file" +fi + +rm -f $backupfile $keyfile diff --git a/tests/sys/geom/class/eli/init_J_test.sh b/tests/sys/geom/class/eli/init_J_test.sh new file mode 100755 index 0000000..266a3d5 --- /dev/null +++ b/tests/sys/geom/class/eli/init_J_test.sh @@ -0,0 +1,126 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile0=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +passfile0=`mktemp $base.XXXXXX` || exit 1 +passfile1=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..150" + +dd if=/dev/random of=${keyfile0} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile0} +dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile1} + +i=1 +for iter in -1 0 64; do + geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) +done + +rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} diff --git a/tests/sys/geom/class/eli/init_a_test.sh b/tests/sys/geom/class/eli/init_a_test.sh new file mode 100755 index 0000000..dbb24fe --- /dev/null +++ b/tests/sys/geom/class/eli/init_a_test.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..1380" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done + done +done + +rm -f $keyfile diff --git a/tests/sys/geom/class/eli/init_i_P_test.sh b/tests/sys/geom/class/eli/init_i_P_test.sh new file mode 100755 index 0000000..1c59a97 --- /dev/null +++ b/tests/sys/geom/class/eli/init_i_P_test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..1" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -i 64 -P -K ${keyfile} md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +rm -f $keyfile diff --git a/tests/sys/geom/class/eli/init_test.sh b/tests/sys/geom/class/eli/init_test.sh new file mode 100755 index 0000000..71dd6e2 --- /dev/null +++ b/tests/sys/geom/class/eli/init_test.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..460" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + if [ ${md_rnd} != ${md_edev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done +done + +rm -f $keyfile diff --git a/tests/sys/geom/class/eli/integrity_copy_test.sh b/tests/sys/geom/class/eli/integrity_copy_test.sh new file mode 100755 index 0000000..4c8efd3 --- /dev/null +++ b/tests/sys/geom/class/eli/integrity_copy_test.sh @@ -0,0 +1,99 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 + +echo "1..5520" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + #mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + mdconfig -a -t malloc -s $sectors -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Copy first small sector to the second small sector. + # This should be detected as corruption. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'` + ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Copy first big sector to the second big sector. + # This should be detected as corruption. + dd if=/dev/md${no} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no + done + done +done + +rm -f $keyfile $sector diff --git a/tests/sys/geom/class/eli/integrity_data_test.sh b/tests/sys/geom/class/eli/integrity_data_test.sh new file mode 100755 index 0000000..7ea7c96b --- /dev/null +++ b/tests/sys/geom/class/eli/integrity_data_test.sh @@ -0,0 +1,69 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 + +echo "1..2760" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Corrupt 8 bytes of data. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=/dev/random of=${sector} bs=1 count=8 seek=64 conv=notrunc >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no + done + done +done + +rm -f $keyfile $sector diff --git a/tests/sys/geom/class/eli/integrity_hmac_test.sh b/tests/sys/geom/class/eli/integrity_hmac_test.sh new file mode 100755 index 0000000..243eac9 --- /dev/null +++ b/tests/sys/geom/class/eli/integrity_hmac_test.sh @@ -0,0 +1,69 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 + +echo "1..2760" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Corrupt 8 bytes of HMAC. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=/dev/random of=${sector} bs=1 count=16 conv=notrunc >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no + done + done +done + +rm -f $keyfile $sector diff --git a/tests/sys/geom/class/eli/kill_test.sh b/tests/sys/geom/class/eli/kill_test.sh new file mode 100755 index 0000000..ccced9f --- /dev/null +++ b/tests/sys/geom/class/eli/kill_test.sh @@ -0,0 +1,97 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..9" + +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile1 md${no} +geli attach -p -k $keyfile1 md${no} +geli setkey -n 1 -P -K $keyfile2 md${no} + +# Kill attached provider. +geli kill md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +sleep 1 +# Provider should be automatically detached. +if [ ! -c /dev/md{$no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +geli init -B none -P -K $keyfile1 md${no} +geli setkey -n 1 -p -k $keyfile1 -P -K $keyfile2 md${no} + +# Should be possible to attach with keyfile1. +geli attach -p -k $keyfile1 md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi +geli detach md${no} + +# Should be possible to attach with keyfile2. +geli attach -p -k $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi +geli detach md${no} + +# Kill detached provider. +geli kill md${no} +if [ $? -eq 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +rm -f $keyfile1 $keyfile2 diff --git a/tests/sys/geom/class/eli/nokey_test.sh b/tests/sys/geom/class/eli/nokey_test.sh new file mode 100755 index 0000000..f32e1a4 --- /dev/null +++ b/tests/sys/geom/class/eli/nokey_test.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..8" + +geli init -B none -P md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K ${keyfile} md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi +geli attach -p md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi +geli attach -p -k ${keyfile} md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi +geli setkey -n 0 -P md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi +geli detach md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi +geli setkey -n 0 -p -P -K ${keyfile} md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi +geli setkey -n 0 -p -k ${keyfile} -P md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +rm -f $keyfile diff --git a/tests/sys/geom/class/eli/onetime_a_test.sh b/tests/sys/geom/class/eli/onetime_a_test.sh new file mode 100755 index 0000000..4e26dfb --- /dev/null +++ b/tests/sys/geom/class/eli/onetime_a_test.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 + +echo "1..1380" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done + done +done diff --git a/tests/sys/geom/class/eli/onetime_d_test.sh b/tests/sys/geom/class/eli/onetime_d_test.sh new file mode 100755 index 0000000..51a6abb --- /dev/null +++ b/tests/sys/geom/class/eli/onetime_d_test.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +mdconfig -a -t malloc -s $sectors -u $no || exit 1 + +echo "1..3" + +geli onetime -d md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 1" +else + echo "not ok 1" +fi +# Be sure it doesn't detach on read. +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ -c /dev/md${no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi +true > /dev/md${no}.eli +sleep 1 +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +mdconfig -d -u $no diff --git a/tests/sys/geom/class/eli/onetime_test.sh b/tests/sys/geom/class/eli/onetime_test.sh new file mode 100755 index 0000000..17061d0 --- /dev/null +++ b/tests/sys/geom/class/eli/onetime_test.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 + +echo "1..460" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors`b -u $no || exit 1 + + geli onetime -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + if [ ${md_rnd} != ${md_edev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done +done diff --git a/tests/sys/geom/class/eli/readonly_test.sh b/tests/sys/geom/class/eli/readonly_test.sh new file mode 100755 index 0000000..721ad62 --- /dev/null +++ b/tests/sys/geom/class/eli/readonly_test.sh @@ -0,0 +1,94 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..11" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +geli attach -r -p -k $keyfile md${no} +if [ $? -eq 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +sh -c "true >/dev/md${no}.eli" 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +geli kill md${no} +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +# kill should detach provider... +if [ ! -c /dev/md{$no}.eli ]; then + echo "ok 5" +else + echo "not ok 5" +fi + +# ...but not destroy the metadata. +geli attach -r -p -k $keyfile md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi + +geli setkey -n 1 -P -K /dev/null md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +geli delkey -n 0 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +geli delkey -f -n 0 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +geli list md${no}.eli | egrep '^Flags: .*READ-ONLY' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +geli detach md${no} +if [ $? -eq 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi + +mdconfig -d -u $no +rm -f $keyfile diff --git a/tests/sys/geom/class/eli/resize_test.sh b/tests/sys/geom/class/eli/resize_test.sh new file mode 100755 index 0000000..67d6291 --- /dev/null +++ b/tests/sys/geom/class/eli/resize_test.sh @@ -0,0 +1,148 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +echo 1..27 + +BLK=512 +BLKS_PER_MB=2048 + +md=$(mdconfig -s40m) || exit 1 +unit=${md#md} +i=1 + +setsize() { + partszMB=$1 unitszMB=$2 + + { + echo a: $(($partszMB * $BLKS_PER_MB)) 0 4.2BSD 1024 8192 + echo c: $(($unitszMB * $BLKS_PER_MB)) 0 unused 0 0 + } | disklabel -R $md /dev/stdin +} + +# Initialise + +setsize 10 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 10m" +i=$((i + 1)) + +echo secret >tmp.key +geli init -Bnone -PKtmp.key ${md}a || echo -n "not " +echo ok $i - "Initialised geli on ${md}a" +i=$((i + 1)) +geli attach -pk tmp.key ${md}a || echo -n "not " +echo ok $i - "Attached ${md}a as ${md}a.eli" +i=$((i + 1)) + +newfs -U ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Initialised the filesystem on ${md}a.eli" +i=$((i + 1)) +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + + +# Doing a backup, resize & restore must be forced (with -f) as geli +# verifies that the provider size in the metadata matches the consumer. + +geli backup ${md}a tmp.meta || echo -n "not " +echo ok $i - "Backed up ${md}a metadata" +i=$((i + 1)) + +geli detach ${md}a.eli || echo -n "not " +echo ok $i - "Detached ${md}a.eli" +i=$((i + 1)) + +setsize 20 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 20m" +i=$((i + 1)) +geli attach -pktmp.key ${md}a && echo -n "not " +echo ok $i - "Attaching ${md}a fails after resizing the consumer" +i=$((i + 1)) + +geli restore tmp.meta ${md}a && echo -n "not " +echo ok $i - "Restoring metadata on ${md}a.eli fails without -f" +i=$((i + 1)) +geli restore -f tmp.meta ${md}a || echo -n "not " +echo ok $i - "Restoring metadata on ${md}a.eli can be forced" +i=$((i + 1)) + +geli attach -pktmp.key ${md}a || echo -n "not " +echo ok $i - "Attaching ${md}a is now possible" +i=$((i + 1)) + +growfs -y ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Extended the filesystem on ${md}a.eli" +i=$((i + 1)) + +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + + +# Now do the resize properly + +geli detach ${md}a.eli || echo -n "not " +echo ok $i - "Detached ${md}a.eli" +i=$((i + 1)) + +setsize 30 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 30m" +i=$((i + 1)) + +geli resize -s20m ${md}a || echo -n "not " +echo ok $i - "Resizing works ok" +i=$((i + 1)) +geli resize -s20m ${md}a && echo -n "not " +echo ok $i - "Resizing doesn't work a 2nd time (no old metadata)" +i=$((i + 1)) + +geli attach -pktmp.key ${md}a || echo -n "not " +echo ok $i - "Attaching ${md}a works ok" +i=$((i + 1)) + +growfs -y ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Extended the filesystem on ${md}a.eli" +i=$((i + 1)) + +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + +geli detach ${md}a.eli +gpart destroy -F $md >/dev/null + + +# Verify that the man page example works, changing ada0 to $md, +# 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none +# to geli init. + +gpart create -s GPT $md || echo -n "not " +echo ok $i - "Installed a GPT on ${md}" +i=$((i + 1)) +gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " +echo ok $i - "Added a 20m partition in slot 1" +i=$((i + 1)) +geli init -B none -K tmp.key -P ${md}p1 || echo -n "not " +echo ok $i - "Initialised geli on ${md}p1" +i=$((i + 1)) +gpart resize -s 30m -i 1 $md || echo -n "not " +echo ok $i - "Resized partition ${md}p1 to 30m" +i=$((i + 1)) +geli resize -s 20m ${md}p1 || echo -n "not " +echo ok $i - "Resized geli on ${md}p1 to 30m" +i=$((i + 1)) +geli attach -k tmp.key -p ${md}p1 || echo -n "not " +echo ok $i - "Attached ${md}p1.eli" +i=$((i + 1)) + +geli detach ${md}p1.eli + +rm tmp.* diff --git a/tests/sys/geom/class/eli/setkey_test.sh b/tests/sys/geom/class/eli/setkey_test.sh new file mode 100755 index 0000000..458100c --- /dev/null +++ b/tests/sys/geom/class/eli/setkey_test.sh @@ -0,0 +1,156 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +rnd=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 +keyfile5=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..16" + +dd if=/dev/random of=${rnd} bs=512 count=${sectors} >/dev/null 2>&1 +hash1=`dd if=${rnd} bs=512 count=${sectors} 2>/dev/null | md5` +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile5} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile1 md${no} +geli attach -p -k $keyfile1 md${no} + +dd if=${rnd} of=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null +rm -f $rnd +hash2=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` + +# Change current key (0) for attached provider. +geli setkey -P -K $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +geli detach md${no} + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +# Attach with new key. +geli attach -p -k $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi +hash3=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` + +# Change key 1 for attached provider. +geli setkey -n 1 -P -K $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi +geli detach md${no} + +# Attach with key 1. +geli attach -p -k $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi +hash4=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` +geli detach md${no} + +# Change current (1) key for detached provider. +geli setkey -p -k $keyfile3 -P -K $keyfile4 md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi + +# We cannot use keyfile3 anymore. +geli attach -p -k $keyfile3 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +# Attach with key 1. +geli attach -p -k $keyfile4 md${no} +if [ $? -eq 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi +hash5=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` +geli detach md${no} + +# Change key 0 for detached provider. +geli setkey -n 0 -p -k $keyfile4 -P -K $keyfile5 md${no} +if [ $? -eq 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +# Attach with key 0. +geli attach -p -k $keyfile5 md${no} +if [ $? -eq 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi +hash6=`dd if=/dev/md${no}.eli bs=512 count=${sectors} 2>/dev/null | md5` +geli detach md${no} + +if [ ${hash1} = ${hash2} ]; then + echo "ok 12" +else + echo "not ok 12" +fi +if [ ${hash1} = ${hash3} ]; then + echo "ok 13" +else + echo "not ok 13" +fi +if [ ${hash1} = ${hash4} ]; then + echo "ok 14" +else + echo "not ok 14" +fi +if [ ${hash1} = ${hash5} ]; then + echo "ok 15" +else + echo "not ok 15" +fi +if [ ${hash1} = ${hash6} ]; then + echo "ok 16" +else + echo "not ok 16" +fi + +rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 $keyfile5 diff --git a/tests/sys/geom/class/gate/1_test.sh b/tests/sys/geom/class/gate/1_test.sh new file mode 100755 index 0000000..fb6fd62 --- /dev/null +++ b/tests/sys/geom/class/gate/1_test.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +base=`basename $0` +us=0 +while [ -c /dev/ggate${us} ]; do + : $(( us += 1 )) +done +conf=`mktemp $base.XXXXXX` || exit 1 +pidfile=ggated.pid +port=33080 + +work=$(attach_md -t malloc -s 1M) +src=$(attach_md -t malloc -s 1M) + +test_cleanup() +{ + ggatec destroy -f -u $us + pkill -F $pidfile + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync +dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync +src_checksum=$(md5 -q /dev/$src) + +echo "127.0.0.1 RW /dev/$work" > $conf + +if ! ggated -F $pidfile -p $port $conf; then + echo 'ggated failed to start' + echo 'Bail out!' + exit 1 +fi +if ! ggatec create -p $port -u $us 127.0.0.1 /dev/$work; then + echo 'ggatec create failed' + echo 'Bail out!' + exit 1 +fi + +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 +sleep 1 + +echo '1..2' + +work_checksum=$(md5 -q /dev/$work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" + echo "not ok 2 # SKIP" +else + echo 'ok 1 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" + else + echo 'ok 2 - md5 checksum' + fi +fi diff --git a/tests/sys/geom/class/gate/2_test.sh b/tests/sys/geom/class/gate/2_test.sh new file mode 100755 index 0000000..be89acc --- /dev/null +++ b/tests/sys/geom/class/gate/2_test.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +base=`basename $0` +us=46 +work=`mktemp -u $base.XXXXXX` || exit 1 +src=`mktemp -u $base.XXXXXX` || exit 1 + +test_cleanup() +{ + ggatel destroy -f -u $us + rm -f $work $src + + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +dd if=/dev/random of=$work bs=1m count=1 conv=sync +dd if=/dev/random of=$src bs=1m count=1 conv=sync + +if ! ggatel create -u $us $work; then + echo 'ggatel create failed' + echo 'Bail out!' + exit 1 +fi + +dd if=${src} of=/dev/ggate${us} bs=1m count=1 +sleep 1 + +echo '1..2' + +src_checksum=$(md5 -q $src) +work_checksum=$(md5 -q $work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum) # TODO: bug 204616" + echo 'not ok 2 # SKIP' +else + echo 'ok 1 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" + else + echo 'ok 2 - md5 checksum' + fi +fi diff --git a/tests/sys/geom/class/gate/3_test.sh b/tests/sys/geom/class/gate/3_test.sh new file mode 100755 index 0000000..8901aca --- /dev/null +++ b/tests/sys/geom/class/gate/3_test.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +base=`basename $0` +us=47 + +test_cleanup() +{ + ggatel destroy -f -u $us + + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +work=$(attach_md -t malloc -s 1M) +src=$(attach_md -t malloc -s 1M) + +dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync +dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync +src_checksum=$(md5 -q /dev/$src) + +if ! ggatel create -u $us /dev/$work; then + echo 'ggatel create failed' + echo 'Bail out!' + exit 1 +fi + +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=sync +sleep 1 + +echo '1..2' + +work_checksum=$(md5 -q /dev/$work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" + echo 'not ok 2 # SKIP' +else + echo 'ok 1 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" + else + echo 'ok 2 - md5 checksum' + fi +fi diff --git a/tests/sys/geom/class/gate/Makefile b/tests/sys/geom/class/gate/Makefile new file mode 100644 index 0000000..985d98f --- /dev/null +++ b/tests/sys/geom/class/gate/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test +TAP_TESTS_SH+= 3_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/tests/sys/geom/class/gate/conf.sh b/tests/sys/geom/class/gate/conf.sh new file mode 100755 index 0000000..4eede08 --- /dev/null +++ b/tests/sys/geom/class/gate/conf.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +name="$(mktemp -u gate.XXXXXX)" +class="gate" +base=`basename $0` + +kldstat -q -m g_${class} || kldload geom_${class} || exit 1 + +. `dirname $0`/../geom_subr.sh diff --git a/tests/sys/geom/class/geom_subr.sh b/tests/sys/geom/class/geom_subr.sh new file mode 100644 index 0000000..a039377 --- /dev/null +++ b/tests/sys/geom/class/geom_subr.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# $FreeBSD$ + +if [ $(id -u) -ne 0 ]; then + echo 'Tests must be run as root' + echo 'Bail out!' + exit 1 +fi +kldstat -q -m g_${class} || g${class} load || exit 1 + +devwait() +{ + while :; do + if [ -c /dev/${class}/${name} ]; then + return + fi + sleep 0.2 + done +} + +# Need to keep track of the test md devices to avoid the scenario where a test +# failing will cause the other tests to bomb out, or a test failing will leave +# a large number of md(4) devices lingering around +: ${TMPDIR=/tmp} +export TMPDIR +TEST_MDS_FILE=${TMPDIR}/test_mds + +attach_md() +{ + local test_md + + test_md=$(mdconfig -a "$@") || exit + echo $test_md >> $TEST_MDS_FILE || exit + echo $test_md +} + +geom_test_cleanup() +{ + local test_md + + if [ -f $TEST_MDS_FILE ]; then + while read test_md; do + # The "#" tells the TAP parser this is a comment + echo "# Removing test memory disk: $test_md" + mdconfig -d -u $test_md + done < $TEST_MDS_FILE + fi +} diff --git a/tests/sys/geom/class/gpt/Makefile b/tests/sys/geom/class/gpt/Makefile new file mode 100644 index 0000000..be11f0a --- /dev/null +++ b/tests/sys/geom/class/gpt/Makefile @@ -0,0 +1,13 @@ +# $FreeBSD$ + +BINDIR= ${TESTSDIR} + +TAP_TESTS_PERL+= gctl_test + +PROGS+= gctl +MAN= + +DPADD.gctl+= ${LIBGEOM} +LDADD.gctl+= -lgeom + +.include diff --git a/tests/sys/geom/class/gpt/gctl.c b/tests/sys/geom/class/gpt/gctl.c new file mode 100644 index 0000000..136a616 --- /dev/null +++ b/tests/sys/geom/class/gpt/gctl.c @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2005, 2006 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +struct retval { + struct retval *retval; + const char *param; + char *value; +}; + +struct retval *retval; +int verbose; + +static void +usage() +{ + fprintf(stdout, "usage: %s [-v] param[:len][=value] ...\n", + getprogname()); + exit(1); +} + +static int +parse(char *arg, char **param, char **value, int *len) +{ + char *e, *colon, *equal; + + if (*arg == '\0') + return (EINVAL); + + colon = strchr(arg, ':'); + equal = strchr(arg, '='); + if (colon == NULL && equal == NULL) + return (EINVAL); + if (colon == arg || equal == arg) + return (EINVAL); + if (colon != NULL && equal != NULL && equal < colon) + return (EINVAL); + + if (colon != NULL) + *colon++ = '\0'; + if (equal != NULL) + *equal++ = '\0'; + + *param = arg; + if (colon != NULL) { + /* Length specification. This parameter is RW. */ + if (*colon == '\0') + return (EINVAL); + *len = strtol(colon, &e, 0); + if (*e != '\0') + return (EINVAL); + if (*len <= 0 || *len > PATH_MAX) + return (EINVAL); + *value = malloc(*len); + if (*value == NULL) + return (ENOMEM); + memset(*value, 0, *len); + if (equal != NULL) { + if (strlen(equal) >= PATH_MAX) + return (ENOMEM); + strcpy(*value, equal); + } + } else { + /* This parameter is RO. */ + *len = -1; + if (*equal == '\0') + return (EINVAL); + *value = equal; + } + + return (0); +} + +int main(int argc, char *argv[]) +{ + struct retval *rv; + struct gctl_req *req; + char *param, *value; + const char *s; + int c, len; + + req = gctl_get_handle(); + gctl_ro_param(req, "class", -1, "GPT"); + + while ((c = getopt(argc, argv, "v")) != -1) { + switch (c) { + case 'v': + verbose = 1; + break; + case '?': + default: + usage(); + /* NOTREACHED */ + break; + } + } + + while (optind < argc) { + if (!parse(argv[optind++], ¶m, &value, &len)) { + if (len > 0) { + rv = malloc(sizeof(struct retval)); + rv->param = param; + rv->value = value; + rv->retval = retval; + retval = rv; + gctl_rw_param(req, param, len, value); + } else + gctl_ro_param(req, param, -1, value); + } + } + + if (verbose) + gctl_dump(req, stdout); + + s = gctl_issue(req); + if (s == NULL) { + printf("PASS"); + while (retval != NULL) { + rv = retval->retval; + printf(" %s=%s", retval->param, retval->value); + free(retval->value); + free(retval); + retval = rv; + } + printf("\n"); + } else + printf("FAIL %s\n", s); + + gctl_free(req); + return (0); +} diff --git a/tests/sys/geom/class/gpt/gctl_test.pl b/tests/sys/geom/class/gpt/gctl_test.pl new file mode 100755 index 0000000..0f30805 --- /dev/null +++ b/tests/sys/geom/class/gpt/gctl_test.pl @@ -0,0 +1,202 @@ +#!/usr/bin/env perl -w +# +# Copyright (c) 2005, 2006 Marcel Moolenaar +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +my $srcdir = `dirname $0`; +chomp $srcdir; + +my $tmpdir = $ENV{TMPDIR} || "/tmp"; + +my $cmd = "$srcdir/gctl"; +my $out = "$cmd.out"; +my $disk = "$tmpdir/disk-$$"; +my $mntpt = "$tmpdir/mount-$$"; + +my %steps = ( + "000" => "gctl", + "001" => "gctl verb=bogus", + "010" => "gctl verb=create", + "011" => "gctl verb=create provider=bogus", + "020" => "mdcfg create pristine", + "021" => "gctl verb=create provider=%dev% entries=-1", + "022" => "gctl verb=create provider=%dev% entries=128", + "023" => "gctl verb=create provider=%dev%", + "024" => "gctl verb=modify geom=%dev%", + "025" => "conf", + "030" => "gctl verb=add", + "031" => "gctl verb=add geom=bogus", + "032" => "gctl verb=add geom=%dev%", + "033" => "gctl verb=add geom=%dev% type=bogus", + "034" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", + "035" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", + "036" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", + "037" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", + "038" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", + "039" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", + "040" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", + "041" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", + "042" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", + "043" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", + "044" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", + "045" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", + "046" => "gctl verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", + "047" => "conf", + "050" => "gctl verb=remove geom=%dev% entry=5", + "051" => "gctl verb=remove geom=%dev% entry=2", + "052" => "gctl verb=remove geom=%dev% entry=1", + "053" => "gctl verb=remove geom=%dev% entry=1", + "054" => "conf", + "060" => "gctl verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", + "061" => "mount %dev%p1", + "062" => "gctl verb=remove geom=%dev% entry=1", + "063" => "umount %dev%p1", + "064" => "gctl verb=remove geom=%dev% entry=1", + "065" => "conf", + "100" => "mdcfg destroy", + "110" => "mdcfg create corrupted", + "111" => "gctl verb=add geom=%dev%", + "120" => "mdcfg destroy", +); + +my %result = ( + "000" => "FAIL Verb missing", + "001" => "FAIL 22 verb 'bogus'", + "010" => "FAIL 87 provider", + "011" => "FAIL 22 provider 'bogus'", + "020" => "", + "021" => "FAIL 22 entries -1", + "022" => "PASS", + "023" => "FAIL 17 geom '%dev%'", + "024" => "FAIL 87 entry", + "025" => "b1856477950e5786898c8f01361196cf", + "030" => "FAIL 87 geom", + "031" => "FAIL 22 geom 'bogus'", + "032" => "FAIL 87 type", + "033" => "FAIL 22 type 'bogus'", + "034" => "FAIL 87 start", + "035" => "FAIL 22 start 1", + "036" => "FAIL 87 end", + "037" => "FAIL 22 end 12345678", + "038" => "FAIL 22 entry 129", + "039" => "PASS entry=5", + "040" => "FAIL 17 entry 5", + "041" => "FAIL 28 start/end 34/546", + "042" => "FAIL 28 start/end 162/417", + "043" => "FAIL 28 start/end 100/300", + "044" => "FAIL 28 start/end 300/500", + "045" => "PASS entry=1", + "046" => "PASS entry=2", + "047" => "50783a39eecfc62a29db24381e12b9d8", + "050" => "PASS", + "051" => "PASS", + "052" => "PASS", + "053" => "FAIL 2 entry 1", + "054" => "b1856477950e5786898c8f01361196cf", + "060" => "PASS", + "061" => "PASS", + "062" => "FAIL 16", + "063" => "PASS", + "064" => "PASS", + "065" => "b1856477950e5786898c8f01361196cf", + "100" => "", + "110" => "", + "111" => "FAIL 6 geom '%dev%'", + "120" => "", +); + +my $verbose = ""; +if (exists $ENV{'TEST_VERBOSE'}) { + $verbose = "-v"; +} + +# Make sure we have permission to use gctl... +if (`$cmd` =~ "^FAIL Permission denied") { + print "1..0 # SKIP not enough permission\n"; + unlink $cmd; + exit 0; +} + +$count = keys (%steps); +print "1..$count\n"; + +my $nr = 1; +my $dev = "n/a"; +foreach my $key (sort keys %steps) { + my ($action, $args) = split(/ /, $steps{$key}, 2); + my $res = $result{$key}; + $args = "" if (not defined $args); + $args =~ s/%dev%/$dev/g; + $res =~ s/%dev%/$dev/g; + + if ($action =~ "^gctl") { + system("$cmd $verbose $args | tee $out 2>&1"); + $st = `tail -1 $out`; + if ($st =~ "^$res") { + print "ok $nr \# gctl($key)\n"; + } else { + print "not ok $nr \# gctl($key) - $st\n"; + } + unlink $out; + } elsif ($action =~ "^mdcfg") { + if ($args =~ "^create") { + system("dd if=/dev/zero of=$disk count=1024 2>&1"); + if ($args =~ "corrupted") { + system("gpt create -p $disk"); + } + $dev = `mdconfig -a -t vnode -f $disk`; + chomp $dev; + } elsif ($args =~ "^destroy") { + $dev =~ s/md/-u /g; + system("mdconfig -d $dev"); + unlink $disk; + $dev = "n/a"; + } + print "ok $nr \# mdcfg($key)\n"; + } elsif ($action =~ "^conf") { + system("sysctl -b kern.geom.conftxt | grep -a $dev | sed -e s:$disk:DISK:g -e s:$dev:DEV:g | sort | md5 -p | tee $out 2>&1"); + $st = `tail -1 $out`; + if ($st =~ "^$res") { + print "ok $nr \# conf($key)\n"; + } else { + print "not ok $nr \# conf($key) - $st\n"; + } + unlink $out; + } elsif ($action =~ "^mount") { + system("mkdir $mntpt-$args"); + system("newfs $args"); + system("mount -t ufs /dev/$args $mntpt-$args"); + print "ok $nr \# mount($key)\n"; + } elsif ($action =~ "^umount") { + system("umount $mntpt-$args"); + system("rmdir $mntpt-$args"); + print "ok $nr \# umount($key)\n"; + } + $nr += 1; +} + +unlink $cmd; +exit 0; diff --git a/tests/sys/geom/class/mirror/1_test.sh b/tests/sys/geom/class/mirror/1_test.sh new file mode 100755 index 0000000..af82a14 --- /dev/null +++ b/tests/sys/geom/class/mirror/1_test.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +gmirror label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 +devwait + +# Size of created device should be 1MB - 512b. + +size=`diskinfo /dev/mirror/${name} | awk '{print $3}'` + +if [ $size -eq 1048064 ]; then + echo "ok 1" +else + echo "not ok 1" +fi diff --git a/tests/sys/geom/class/mirror/2_test.sh b/tests/sys/geom/class/mirror/2_test.sh new file mode 100755 index 0000000..5605c44 --- /dev/null +++ b/tests/sys/geom/class/mirror/2_test.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..4" + +balance="round-robin" +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 + +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi +dd if=/dev/${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi +dd if=/dev/${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/mirror/3_test.sh b/tests/sys/geom/class/mirror/3_test.sh new file mode 100755 index 0000000..b7f8525 --- /dev/null +++ b/tests/sys/geom/class/mirror/3_test.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..5" + +balance="round-robin" +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 + +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gmirror remove $name ${us0} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name ${us1} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +gmirror remove $name ${us2} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +# mirror/${name} should be removed. +if [ -c /dev/${name} ]; then + echo "not ok 5" +else + echo "ok 5" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/mirror/4_test.sh b/tests/sys/geom/class/mirror/4_test.sh new file mode 100755 index 0000000..6efcc02 --- /dev/null +++ b/tests/sys/geom/class/mirror/4_test.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..5" + +balance="load" +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 + +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gmirror remove $name ${us0} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name ${us1} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +gmirror remove $name ${us2} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +gmirror destroy $name + +# mirror/${name} should be removed. +if [ -c /dev/${name} ]; then + echo "not ok 5" +else + echo "ok 5" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/mirror/5_test.sh b/tests/sys/geom/class/mirror/5_test.sh new file mode 100755 index 0000000..3a176b5 --- /dev/null +++ b/tests/sys/geom/class/mirror/5_test.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..5" + +balance="split" +ddbs=8192 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 + +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gmirror remove $name ${us0} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name ${us1} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +gmirror remove $name ${us2} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +# mirror/${name} should be removed. +if [ -c /dev/${name} ]; then + echo "not ok 5" +else + echo "ok 5" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/mirror/6_test.sh b/tests/sys/geom/class/mirror/6_test.sh new file mode 100755 index 0000000..68036e9 --- /dev/null +++ b/tests/sys/geom/class/mirror/6_test.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..2" + +balance="split" +ddbs=8192 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 + +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +# Connect disk to the mirror. +gmirror insert ${name} ${us2} +# Wait for synchronization. +sleep 1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/mirror/7_test.sh b/tests/sys/geom/class/mirror/7_test.sh new file mode 100755 index 0000000..f5bf71a --- /dev/null +++ b/tests/sys/geom/class/mirror/7_test.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..5" + +balance="prefer" +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 + +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +gmirror remove $name ${us0} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +gmirror remove $name ${us1} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +gmirror remove $name ${us2} +dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +# mirror/${name} should be removed. +if [ -c /dev/${name} ]; then + echo "not ok 5" +else + echo "ok 5" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/mirror/Makefile b/tests/sys/geom/class/mirror/Makefile new file mode 100644 index 0000000..cf3784f --- /dev/null +++ b/tests/sys/geom/class/mirror/Makefile @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test +TAP_TESTS_SH+= 3_test +TAP_TESTS_SH+= 4_test +TAP_TESTS_SH+= 5_test +TAP_TESTS_SH+= 6_test +TAP_TESTS_SH+= 7_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/tests/sys/geom/class/mirror/conf.sh b/tests/sys/geom/class/mirror/conf.sh new file mode 100755 index 0000000..d8595f1 --- /dev/null +++ b/tests/sys/geom/class/mirror/conf.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# $FreeBSD$ + +name="$(mktemp -u mirror.XXXXXX)" +class="mirror" +base=`basename $0` + +gmirror_test_cleanup() +{ + [ -c /dev/$class/$name ] && gmirror destroy $name + geom_test_cleanup +} +trap gmirror_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh diff --git a/tests/sys/geom/class/nop/1_test.sh b/tests/sys/geom/class/nop/1_test.sh new file mode 100755 index 0000000..4d6b65d --- /dev/null +++ b/tests/sys/geom/class/nop/1_test.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us=$(attach_md -t malloc -s 1M) || exit 1 + +gnop create /dev/${us} || exit 1 + +# Size of created device should be 1MB. + +size=`diskinfo /dev/${us}.nop | awk '{print $3}'` + +if [ $size -eq 1048576 ]; then + echo "ok 1" +else + echo "not ok 1" +fi diff --git a/tests/sys/geom/class/nop/2_test.sh b/tests/sys/geom/class/nop/2_test.sh new file mode 100755 index 0000000..7422345 --- /dev/null +++ b/tests/sys/geom/class/nop/2_test.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +echo "1..1" + +dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1 + +us=$(attach_md -t malloc -s 1M) || exit 1 + +gnop create /dev/${us} || exit 1 + +dd if=${src} of=/dev/${us}.nop bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 + +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/nop/Makefile b/tests/sys/geom/class/nop/Makefile new file mode 100644 index 0000000..81a4e99 --- /dev/null +++ b/tests/sys/geom/class/nop/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/tests/sys/geom/class/nop/conf.sh b/tests/sys/geom/class/nop/conf.sh new file mode 100755 index 0000000..e38e10c --- /dev/null +++ b/tests/sys/geom/class/nop/conf.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# $FreeBSD$ + +class="nop" +base=`basename $0` + +gnop_test_cleanup() +{ + [ -c /dev/${us}.nop ] && gnop destroy ${us}.nop + geom_test_cleanup +} +trap gnop_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh diff --git a/tests/sys/geom/class/raid3/10_test.sh b/tests/sys/geom/class/raid3/10_test.sh new file mode 100755 index 0000000..edd827d --- /dev/null +++ b/tests/sys/geom/class/raid3/10_test.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label -r $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/11_test.sh b/tests/sys/geom/class/raid3/11_test.sh new file mode 100755 index 0000000..0407261 --- /dev/null +++ b/tests/sys/geom/class/raid3/11_test.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/12_test.sh b/tests/sys/geom/class/raid3/12_test.sh new file mode 100755 index 0000000..10533c6 --- /dev/null +++ b/tests/sys/geom/class/raid3/12_test.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +nblocks1=9 +nblocks2=`expr $nblocks1 - 1` +nblocks3=`expr $nblocks2 / 2` + +us0=$(attach_md -t malloc -s $nblocks1) || exit 1 +us1=$(attach_md -t malloc -s $nblocks1) || exit 1 +us2=$(attach_md -t malloc -s $nblocks1) || exit 1 + +dd if=/dev/random of=/dev/${us0} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us2} count=$nblocks1 >/dev/null 2>&1 + +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait +# Wait for synchronization. +sleep 2 +graid3 stop $name +# Break one component. +dd if=/dev/random of=/dev/${us1} count=$nblocks2 >/dev/null 2>&1 +# Provoke retaste of the rest components. +true > /dev/${us0} +true > /dev/${us2} +sleep 1 + +dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 +ec=$? +if [ $ec -eq 0 ]; then + echo "not ok 1" +else + echo "ok 1" +fi diff --git a/tests/sys/geom/class/raid3/1_test.sh b/tests/sys/geom/class/raid3/1_test.sh new file mode 100755 index 0000000..4c0b4a2 --- /dev/null +++ b/tests/sys/geom/class/raid3/1_test.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..2" + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 +devwait + +# Size of created device should be 2MB - 1024B. + +mediasize=`diskinfo /dev/raid3/${name} | awk '{print $3}'` +if [ $mediasize -eq 2096128 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +sectorsize=`diskinfo /dev/raid3/${name} | awk '{print $2}'` +if [ $sectorsize -eq 1024 ]; then + echo "ok 2" +else + echo "not ok 2" +fi diff --git a/tests/sys/geom/class/raid3/2_test.sh b/tests/sys/geom/class/raid3/2_test.sh new file mode 100755 index 0000000..22ebd38 --- /dev/null +++ b/tests/sys/geom/class/raid3/2_test.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/3_test.sh b/tests/sys/geom/class/raid3/3_test.sh new file mode 100755 index 0000000..f068b06 --- /dev/null +++ b/tests/sys/geom/class/raid3/3_test.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +# +# Reading without one DATA component (so with parity). +# +graid3 remove -n 1 $name +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/4_test.sh b/tests/sys/geom/class/raid3/4_test.sh new file mode 100755 index 0000000..810f13d --- /dev/null +++ b/tests/sys/geom/class/raid3/4_test.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +# +# Writing without one DATA component. +# +graid3 remove -n 1 $name +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/5_test.sh b/tests/sys/geom/class/raid3/5_test.sh new file mode 100755 index 0000000..7bc8d42 --- /dev/null +++ b/tests/sys/geom/class/raid3/5_test.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +# +# Writing without PARITY component. +# +graid3 remove -n 2 $name +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/6_test.sh b/tests/sys/geom/class/raid3/6_test.sh new file mode 100755 index 0000000..20bf192 --- /dev/null +++ b/tests/sys/geom/class/raid3/6_test.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +# +# Rebuild of DATA component. +# +graid3 remove -n 1 $name +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +graid3 insert -n 1 $name md${us1} +sleep 1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/7_test.sh b/tests/sys/geom/class/raid3/7_test.sh new file mode 100755 index 0000000..23666f8 --- /dev/null +++ b/tests/sys/geom/class/raid3/7_test.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +# +# Rebuild of PARITY component. +# +graid3 remove -n 2 $name +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +graid3 insert -n 2 $name md${us2} +sleep 1 +# Remove DATA component, so PARITY component can be used while reading. +graid3 remove -n 1 $name +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/8_test.sh b/tests/sys/geom/class/raid3/8_test.sh new file mode 100755 index 0000000..2eb9b1a --- /dev/null +++ b/tests/sys/geom/class/raid3/8_test.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +# +# Writing without DATA component and rebuild of DATA component. +# +graid3 remove -n 1 $name +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +graid3 insert -n 1 $name md${us1} +sleep 1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/9_test.sh b/tests/sys/geom/class/raid3/9_test.sh new file mode 100755 index 0000000..0ef010a --- /dev/null +++ b/tests/sys/geom/class/raid3/9_test.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +ddbs=2048 +nblocks1=1024 +nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 + +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 + +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 +devwait + +# +# Writing without PARITY component and rebuild of PARITY component. +# +graid3 remove -n 2 $name +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +graid3 insert -n 2 $name md${us2} +sleep 1 +# Remove DATA component, so PARITY component can be used while reading. +graid3 remove -n 1 $name +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 + +dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/raid3/Makefile b/tests/sys/geom/class/raid3/Makefile new file mode 100644 index 0000000..c1c95f1 --- /dev/null +++ b/tests/sys/geom/class/raid3/Makefile @@ -0,0 +1,20 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test +TAP_TESTS_SH+= 3_test +TAP_TESTS_SH+= 4_test +TAP_TESTS_SH+= 5_test +TAP_TESTS_SH+= 6_test +TAP_TESTS_SH+= 7_test +TAP_TESTS_SH+= 8_test +TAP_TESTS_SH+= 9_test +TAP_TESTS_SH+= 10_test +TAP_TESTS_SH+= 11_test +TAP_TESTS_SH+= 12_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/tests/sys/geom/class/raid3/conf.sh b/tests/sys/geom/class/raid3/conf.sh new file mode 100755 index 0000000..4f141df --- /dev/null +++ b/tests/sys/geom/class/raid3/conf.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# $FreeBSD$ + +name="test" +class="raid3" +base=`basename $0` + +graid3_test_cleanup() +{ + [ -c /dev/$class/$name ] && graid3 stop $name + geom_test_cleanup +} +trap graid3_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh diff --git a/tests/sys/geom/class/shsec/1_test.sh b/tests/sys/geom/class/shsec/1_test.sh new file mode 100755 index 0000000..ab0bb37 --- /dev/null +++ b/tests/sys/geom/class/shsec/1_test.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..2" + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +gshsec label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 +devwait + +# Size of created device should be 1MB - 512B. + +mediasize=`diskinfo /dev/shsec/${name} | awk '{print $3}'` +if [ $mediasize -eq 1048064 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +sectorsize=`diskinfo /dev/shsec/${name} | awk '{print $2}'` +if [ $sectorsize -eq 512 ]; then + echo "ok 2" +else + echo "not ok 2" +fi diff --git a/tests/sys/geom/class/shsec/2_test.sh b/tests/sys/geom/class/shsec/2_test.sh new file mode 100755 index 0000000..9dfe36a --- /dev/null +++ b/tests/sys/geom/class/shsec/2_test.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..4" + +nblocks1=1024 +nblocks2=`expr $nblocks1 + 1` +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 + +us0=$(attach_md -t malloc -s $nblocks2) || exit 1 +us1=$(attach_md -t malloc -s $nblocks2) || exit 1 +us2=$(attach_md -t malloc -s $nblocks2) || exit 1 + +gshsec label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 +devwait + +dd if=${src} of=/dev/shsec/${name} count=$nblocks1 >/dev/null 2>&1 + +dd if=/dev/shsec/${name} of=${dst} count=$nblocks1 >/dev/null 2>&1 +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +dd if=/dev/${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 +if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then + echo "not ok 2" +else + echo "ok 2" +fi + +dd if=/dev/${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 +if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then + echo "not ok 3" +else + echo "ok 3" +fi + +dd if=/dev/${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 +if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then + echo "not ok 4" +else + echo "ok 4" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/shsec/Makefile b/tests/sys/geom/class/shsec/Makefile new file mode 100644 index 0000000..81a4e99 --- /dev/null +++ b/tests/sys/geom/class/shsec/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/tests/sys/geom/class/shsec/conf.sh b/tests/sys/geom/class/shsec/conf.sh new file mode 100755 index 0000000..7800eb7 --- /dev/null +++ b/tests/sys/geom/class/shsec/conf.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# $FreeBSD$ + +name="$(mktemp -u shsec.XXXXXX)" +class="shsec" +base=`basename $0` + +shsec_test_cleanup() +{ + [ -c /dev/$class/$name ] && gshsec stop $name + geom_test_cleanup +} +trap shsec_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh diff --git a/tests/sys/geom/class/stripe/1_test.sh b/tests/sys/geom/class/stripe/1_test.sh new file mode 100755 index 0000000..7923763 --- /dev/null +++ b/tests/sys/geom/class/stripe/1_test.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +gstripe create -s 16384 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 +devwait + +# Size of created device should be 1MB * 3. + +size=`diskinfo /dev/stripe/${name} | awk '{print $3}'` + +if [ $size -eq 3145728 ]; then + echo "ok 1" +else + echo "not ok 1" +fi diff --git a/tests/sys/geom/class/stripe/2_test.sh b/tests/sys/geom/class/stripe/2_test.sh new file mode 100755 index 0000000..f6e11f5 --- /dev/null +++ b/tests/sys/geom/class/stripe/2_test.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo "1..1" + +tsize=3 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +gstripe create -s 8192 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 +devwait + +dd if=${src} of=/dev/stripe/${name} bs=1m count=$tsize >/dev/null 2>&1 +dd if=/dev/stripe/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 + +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok 1" +else + echo "ok 1" +fi + +rm -f ${src} ${dst} diff --git a/tests/sys/geom/class/stripe/Makefile b/tests/sys/geom/class/stripe/Makefile new file mode 100644 index 0000000..81a4e99 --- /dev/null +++ b/tests/sys/geom/class/stripe/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH+= 1_test +TAP_TESTS_SH+= 2_test + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh +FILESDIR= ${TESTSDIR} + +.include diff --git a/tests/sys/geom/class/stripe/conf.sh b/tests/sys/geom/class/stripe/conf.sh new file mode 100755 index 0000000..fd0f41c --- /dev/null +++ b/tests/sys/geom/class/stripe/conf.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# $FreeBSD$ + +name="$(mktemp -u stripe.XXXXXX)" +class="stripe" +base=`basename $0` + +gstripe_test_cleanup() +{ + [ -c /dev/$class/$name ] && gstripe destroy $name + geom_test_cleanup +} +trap gstripe_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh diff --git a/tests/sys/geom/class/uzip/1_test.sh b/tests/sys/geom/class/uzip/1_test.sh new file mode 100755 index 0000000..222b6c9 --- /dev/null +++ b/tests/sys/geom/class/uzip/1_test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +testsdir=$(dirname $0) +. $testsdir/conf.sh + +echo "1..1" + +UUE=$testsdir/1.img.uzip.uue +uudecode $UUE +us0=$(attach_md -f $(basename $UUE .uue)) || exit 1 +sleep 1 + +mount -o ro /dev/${us0}.uzip "${mntpoint}" || exit 1 + +#cat "${mntpoint}/etalon.txt" +diff -I '\$FreeBSD.*\$' -u $testsdir/etalon/etalon.txt "${mntpoint}/etalon.txt" +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi diff --git a/tests/sys/geom/class/uzip/Makefile b/tests/sys/geom/class/uzip/Makefile new file mode 100644 index 0000000..b4e1d7d --- /dev/null +++ b/tests/sys/geom/class/uzip/Makefile @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Regression test for geom_uzip. +# + +IMAGE= 1.img +ZIMAGE= ${IMAGE}.uzip +UZIMAGE= ${ZIMAGE}.uue + +CLEANFILES+= ${IMAGE} ${UZIMAGE} ${ZIMAGE} + +${IMAGE}: + makefs -s 1048576 ${.TARGET} ${.CURDIR}/etalon + +${ZIMAGE}: ${IMAGE} + mkuzip -o ${.TARGET} ${.ALLSRC} + +${UZIMAGE}: ${IMAGE} ${ZIMAGE} + printf "#\n# $$" >${.TARGET} + printf "FreeBSD$$\n#\n\n" >> ${.TARGET} + uuencode ${ZIMAGE} ${ZIMAGE} >>${.TARGET} + +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh + +FILES+= ${UZIMAGE} +FILESDIR= ${TESTSDIR} + +FILESGROUPS= FILES etalon +etalon+= etalon/etalon.txt +etalonDIR= ${TESTSDIR}/etalon + +TAP_TESTS_SH+= 1_test + +.include diff --git a/tests/sys/geom/class/uzip/conf.sh b/tests/sys/geom/class/uzip/conf.sh new file mode 100755 index 0000000..8a3b459 --- /dev/null +++ b/tests/sys/geom/class/uzip/conf.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# $FreeBSD$ + +class="uzip" +base=`basename $0` + +uzip_test_cleanup() +{ + umount $mntpoint + rmdir $mntpoint + geom_test_cleanup +} +trap uzip_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh + +# NOTE: make sure $TMPDIR has been set by geom_subr.sh if unset [by kyua, etc] +mntpoint=$(mktemp -d tmp.XXXXXX) || exit diff --git a/tests/sys/geom/class/uzip/etalon/etalon.txt b/tests/sys/geom/class/uzip/etalon/etalon.txt new file mode 100644 index 0000000..cb8acf3 --- /dev/null +++ b/tests/sys/geom/class/uzip/etalon/etalon.txt @@ -0,0 +1,43 @@ +# +# $FreeBSD$ +# + +JABBERWOCKY + +Lewis Carroll +(from Through the Looking-Glass and What Alice Found There, 1872) + +`Twas brillig, and the slithy toves +Did gyre and gimble in the wabe: +All mimsy were the borogoves, +And the mome raths outgrabe. + +"Beware the Jabberwock, my son! +The jaws that bite, the claws that catch! +Beware the Jubjub bird, and shun +The frumious Bandersnatch!" + +He took his vorpal sword in hand: +Long time the manxome foe he sought -- +So rested he by the Tumtum tree, +And stood awhile in thought. + +And, as in uffish thought he stood, +The Jabberwock, with eyes of flame, +Came whiffling through the tulgey wood, +And burbled as it came! + +One, two! One, two! And through and through +The vorpal blade went snicker-snack! +He left it dead, and with its head +He went galumphing back. + +"And, has thou slain the Jabberwock? +Come to my arms, my beamish boy! +O frabjous day! Callooh! Callay!' +He chortled in his joy. + +`Twas brillig, and the slithy toves +Did gyre and gimble in the wabe; +All mimsy were the borogoves, +And the mome raths outgrabe. -- cgit v1.1 From a859d88d20a0d54589ef14cbf1b9944bc053d67a Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 1 Jan 2016 00:13:04 +0000 Subject: Add missing Makefile --- tests/sys/geom/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/sys/geom/Makefile diff --git a/tests/sys/geom/Makefile b/tests/sys/geom/Makefile new file mode 100644 index 0000000..bf8604d --- /dev/null +++ b/tests/sys/geom/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/geom + +TESTS_SUBDIRS+= class + +.include -- cgit v1.1 From ad4c61ab7de7788d6ad70fec42a692af70c00f9d Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 1 Jan 2016 00:16:54 +0000 Subject: Only try to unmount/remove mountpt if it's defined --- tests/sys/geom/class/uzip/conf.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sys/geom/class/uzip/conf.sh b/tests/sys/geom/class/uzip/conf.sh index 8a3b459..9a22841 100755 --- a/tests/sys/geom/class/uzip/conf.sh +++ b/tests/sys/geom/class/uzip/conf.sh @@ -6,8 +6,10 @@ base=`basename $0` uzip_test_cleanup() { - umount $mntpoint - rmdir $mntpoint + if [ -n "$mntpoint" ]; then + umount $mntpoint + rmdir $mntpoint + fi geom_test_cleanup } trap uzip_test_cleanup ABRT EXIT INT TERM -- cgit v1.1 From 7d60ca1b885c36064bcffb9a741f3a0eed773639 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 1 Jan 2016 01:04:53 +0000 Subject: Use `geom load` instead of `g load` (`g` doesn't exist for geom_uzip(4)..) --- tests/sys/geom/class/geom_subr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/geom/class/geom_subr.sh b/tests/sys/geom/class/geom_subr.sh index a039377..0ffb8c8 100644 --- a/tests/sys/geom/class/geom_subr.sh +++ b/tests/sys/geom/class/geom_subr.sh @@ -6,7 +6,7 @@ if [ $(id -u) -ne 0 ]; then echo 'Bail out!' exit 1 fi -kldstat -q -m g_${class} || g${class} load || exit 1 +kldstat -q -m g_${class} || geom ${class} load || exit 1 devwait() { -- cgit v1.1 From 3be41536332fc1686ed5e543848a5ad57b5359d6 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 1 Jan 2016 02:52:29 +0000 Subject: Use a more unique name for the graid device --- tests/sys/geom/class/raid3/conf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/geom/class/raid3/conf.sh b/tests/sys/geom/class/raid3/conf.sh index 4f141df..f1b270a 100755 --- a/tests/sys/geom/class/raid3/conf.sh +++ b/tests/sys/geom/class/raid3/conf.sh @@ -1,7 +1,7 @@ #!/bin/sh # $FreeBSD$ -name="test" +name="$(mktemp -u graid3.XXXXXX)" class="raid3" base=`basename $0` -- cgit v1.1