diff options
author | phk <phk@FreeBSD.org> | 2003-01-31 18:31:48 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-01-31 18:31:48 +0000 |
commit | bbd6f8d1ffbdc0e2ac4ee33b9ee2e87396fb2b59 (patch) | |
tree | c7b0cb18d182dba5a3684fc4cc3bba5829ed5ab0 /tools/regression | |
parent | 9d1b9f3c00eec7affbd4cfbbdecad9d0d4c68616 (diff) | |
download | FreeBSD-src-bbd6f8d1ffbdc0e2ac4ee33b9ee2e87396fb2b59.zip FreeBSD-src-bbd6f8d1ffbdc0e2ac4ee33b9ee2e87396fb2b59.tar.gz |
Add Apple partitioning test case.
Use correct name for image data file
Diffstat (limited to 'tools/regression')
-rw-r--r-- | tools/regression/geom/Data/disk.apple.xml | 93 | ||||
-rw-r--r-- | tools/regression/geom/GLib/Makefile | 3 | ||||
-rw-r--r-- | tools/regression/geom/Test/Makefile | 2 | ||||
-rw-r--r-- | tools/regression/geom/Test/T015/Makefile | 2 | ||||
-rw-r--r-- | tools/regression/geom/Test/T015/ref.conf | 121 | ||||
-rw-r--r-- | tools/regression/geom/Test/T015/testprg.c | 67 | ||||
-rw-r--r-- | tools/regression/geom/geom_sim.h | 1 |
7 files changed, 287 insertions, 2 deletions
diff --git a/tools/regression/geom/Data/disk.apple.xml b/tools/regression/geom/Data/disk.apple.xml new file mode 100644 index 0000000..ecdd523 --- /dev/null +++ b/tools/regression/geom/Data/disk.apple.xml @@ -0,0 +1,93 @@ +<?xml version="1.0"?> +<DISKIMAGE> + <FreeBSD>$FreeBSD$</FreeBSD> + <sectorsize>512</sectorsize> + <mediasize>366530560</mediasize> + <fwsectors>0</fwsectors> + <fwheads>0</fwheads> + <fwcylinders>0</fwcylinders> + <sector> + <offset>0</offset> + <hexdata> + 45520200000aec68000100010000000000010000004000120001000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>512</offset> + <hexdata> + 504d00000000000300000060000aec084d61634f530000000000000000000000 + 000000000000000000000000000000004170706c655f48465300000000000000 + 0000000000000000000000000000000000000000000aec08000000b700000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>1024</offset> + <hexdata> + 504d000000000003000000010000003f4170706c650000000000000000000000 + 000000000000000000000000000000004170706c655f706172746974696f6e5f + 6d617000000000000000000000000000000000000000003f0000003700000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> + <sector> + <offset>1536</offset> + <hexdata> + 504d00000000000300000040000000204d6163696e746f736800000000000000 + 000000000000000000000000000000004170706c655f44726976657234330000 + 0000000000000000000000000000000000000000000000200000007f00000000 + 000023ee0000000000000000000000000000000000007c083638303030000000 + 0000000000000000000106000000000000000001000700000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + </hexdata> + </sector> +</DISKIMAGE> diff --git a/tools/regression/geom/GLib/Makefile b/tools/regression/geom/GLib/Makefile index 121ff6a..344f88a 100644 --- a/tools/regression/geom/GLib/Makefile +++ b/tools/regression/geom/GLib/Makefile @@ -1,7 +1,8 @@ # $FreeBSD$ LIB= G -SRCS= geom.c geom_aes.c geom_bsd.c geom_simdev.c geom_dump.c \ +SRCS= geom.c \ + geom_aes.c geom_apple.c geom_bsd.c geom_simdev.c geom_dump.c \ geom_event.c \ geom_io.c \ geom_kernsim.c geom_mbr.c geom_simdisk.c geom_enc.c \ diff --git a/tools/regression/geom/Test/Makefile b/tools/regression/geom/Test/Makefile index ebceb87..0ba78f0 100644 --- a/tools/regression/geom/Test/Makefile +++ b/tools/regression/geom/Test/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR+= T000 T001 T002 T003 T004 T005 T006 T007 T008 T009 -SUBDIR+= T011 T012 T013 T014 +SUBDIR+= T011 T012 T013 T014 T015 # SUBDIR+= T999 diff --git a/tools/regression/geom/Test/T015/Makefile b/tools/regression/geom/Test/T015/Makefile new file mode 100644 index 0000000..18fd955 --- /dev/null +++ b/tools/regression/geom/Test/T015/Makefile @@ -0,0 +1,2 @@ +# $FreeBSD$ +.include <bsd.prog.mk> diff --git a/tools/regression/geom/Test/T015/ref.conf b/tools/regression/geom/Test/T015/ref.conf new file mode 100644 index 0000000..5775799 --- /dev/null +++ b/tools/regression/geom/Test/T015/ref.conf @@ -0,0 +1,121 @@ +<mesh> + <FreeBSD>$FreeBSD$</FreeBSD> + <class id="0x8087020"> + <name>DEV-class</name> + <geom id="0x80bb680"> + <class ref="0x8087020"/> + <name>da0p2</name> + <rank>3</rank> + <consumer id="0x80bc640"> + <geom ref="0x80bb680"/> + <provider ref="0x80bb500"/> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom id="0x80bb600"> + <class ref="0x8087020"/> + <name>da0p1</name> + <rank>3</rank> + <consumer id="0x80bc600"> + <geom ref="0x80bb600"/> + <provider ref="0x80bb480"/> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom id="0x80bb580"> + <class ref="0x8087020"/> + <name>da0p0</name> + <rank>3</rank> + <consumer id="0x80bc500"> + <geom ref="0x80bb580"/> + <provider ref="0x80bb400"/> + <mode>r0w0e0</mode> + </consumer> + </geom> + <geom id="0x80bb280"> + <class ref="0x8087020"/> + <name>da0</name> + <rank>2</rank> + <consumer id="0x80bc540"> + <geom ref="0x80bb280"/> + <provider ref="0x80bb200"/> + <mode>r0w0e0</mode> + </consumer> + </geom> + </class> + <class id="0x8087040"> + <name>APPLE</name> + <geom id="0x80bb300"> + <class ref="0x8087040"/> + <name>da0</name> + <rank>2</rank> + <config> + <frontstuff>8192</frontstuff> + </config> + <consumer id="0x80bc5c0"> + <geom ref="0x80bb300"/> + <provider ref="0x80bb200"/> + <mode>r0w0e0</mode> + <config> + </config> + </consumer> + <provider id="0x80bb500"> + <geom ref="0x80bb300"/> + <mode>r0w0e0</mode> + <name>da0p2</name> + <mediasize>16384</mediasize> + <sectorsize>512</sectorsize> + <config> + <index>2</index> + <length>16384</length> + <seclength>32</seclength> + <offset>32768</offset> + <secoffset>64</secoffset> + </config> + </provider> + <provider id="0x80bb480"> + <geom ref="0x80bb300"/> + <mode>r0w0e0</mode> + <name>da0p1</name> + <mediasize>32256</mediasize> + <sectorsize>512</sectorsize> + <config> + <index>1</index> + <length>32256</length> + <seclength>63</seclength> + <offset>512</offset> + <secoffset>1</secoffset> + </config> + </provider> + <provider id="0x80bb400"> + <geom ref="0x80bb300"/> + <mode>r0w0e0</mode> + <name>da0p0</name> + <mediasize>366481408</mediasize> + <sectorsize>512</sectorsize> + <config> + <index>0</index> + <length>366481408</length> + <seclength>715784</seclength> + <offset>49152</offset> + <secoffset>96</secoffset> + </config> + </provider> + </geom> + </class> + <class id="0x8087000"> + <name>SIMDISK-class</name> + <geom id="0x80bb180"> + <class ref="0x8087000"/> + <name>da0</name> + <rank>1</rank> + <provider id="0x80bb200"> + <geom ref="0x80bb180"/> + <mode>r0w0e0</mode> + <name>da0</name> + <mediasize>366530560</mediasize> + <sectorsize>512</sectorsize> + </provider> + </geom> + </class> +</mesh> diff --git a/tools/regression/geom/Test/T015/testprg.c b/tools/regression/geom/Test/T015/testprg.c new file mode 100644 index 0000000..cd7f4b8 --- /dev/null +++ b/tools/regression/geom/Test/T015/testprg.c @@ -0,0 +1,67 @@ +/*- + * 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 <stdio.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <signal.h> +#include <err.h> +#include <sys/errno.h> +#include <sys/time.h> +#include <sys/sbuf.h> +#include <geom/geom.h> + +void * +thread_sim(void *ptr __unused) +{ + + rattle(); + g_simdisk_init(); + g_apple_init(); + g_dev_init(NULL); + rattle(); + + + g_simdisk_xml_load("da0", "../../Data/disk.apple.xml"); + rattle(); + conff("1"); + printf("Done\n"); + done(); + return (0); +} diff --git a/tools/regression/geom/geom_sim.h b/tools/regression/geom/geom_sim.h index 175c8d7..a28d7e7 100644 --- a/tools/regression/geom/geom_sim.h +++ b/tools/regression/geom/geom_sim.h @@ -154,6 +154,7 @@ void name##_init(void); \ } void g_aes_init(void); +void g_apple_init(void); void g_bsd_init(void); void g_mbr_init(void); void g_mbrext_init(void); |