Add a regression test framework for config(1).
The first test, SHADOW_INSTANCE, includes an example of a shadowed instance: 'child' only attaches to attribute hook, therefore the instance 'child* at parentii?' is shadowed by 'child* at hook?'. However, that configuration file is still valid, and therefore must be accepted.
This commit is contained in:
parent
2fb411a123
commit
8745ad50f1
32
regress/usr.bin/config/Makefile
Normal file
32
regress/usr.bin/config/Makefile
Normal file
@ -0,0 +1,32 @@
|
||||
# $NetBSD: Makefile,v 1.1 2005/10/02 21:27:02 cube Exp $
|
||||
|
||||
# Those configurations only have to be understood by config(1) without
|
||||
# errors.
|
||||
|
||||
SIMPLE= SHADOW_INSTANCE
|
||||
|
||||
.include <bsd.obj.mk>
|
||||
|
||||
.PHONY: regress clean cleandir
|
||||
regress: compile
|
||||
cleandir: clean
|
||||
clean:
|
||||
@if [ -e compile ]; then rmdir compile; fi
|
||||
|
||||
compile:
|
||||
@mkdir compile
|
||||
|
||||
.for __conf__ in ${SIMPLE}
|
||||
regress: ${__conf__}-regress
|
||||
clean: ${__conf__}-clean
|
||||
.endfor
|
||||
|
||||
.for __conf__ in ${SIMPLE}
|
||||
.PHONY: ${__conf__}-regress ${__conf__}-clean
|
||||
${__conf__}-regress:
|
||||
@mkdir compile/${__conf__}
|
||||
${TOOL_CONFIG} -s ${.CURDIR}/support -b ./compile/${__conf__} ${.CURDIR}/${__conf__}
|
||||
|
||||
${__conf__}-clean:
|
||||
@if [ -d compile/${__conf__} ]; then rm -Rf compile/${__conf__}; fi
|
||||
.endfor
|
15
regress/usr.bin/config/SHADOW_INSTANCE
Normal file
15
regress/usr.bin/config/SHADOW_INSTANCE
Normal file
@ -0,0 +1,15 @@
|
||||
include "arch/regress/conf/std.regress"
|
||||
|
||||
maxusers 4
|
||||
|
||||
file-system REGRESSFS
|
||||
|
||||
master0 at root
|
||||
|
||||
parenti* at master?
|
||||
parentii* at master?
|
||||
|
||||
child* at hook?
|
||||
child* at parentii?
|
||||
|
||||
config regress root on ?
|
@ -0,0 +1,41 @@
|
||||
=== INCLUDES BEGIN ===
|
||||
|
||||
%INCLUDES
|
||||
|
||||
=== INCLUDES END ===
|
||||
|
||||
=== OBJS BEGIN ===
|
||||
|
||||
%OBJS
|
||||
|
||||
=== OBJS END ===
|
||||
|
||||
=== CFILES BEGIN ===
|
||||
|
||||
%CFILES
|
||||
|
||||
=== CFILES END ===
|
||||
|
||||
=== SFILES BEGIN ===
|
||||
|
||||
%SFILES
|
||||
|
||||
=== SFILES END ===
|
||||
|
||||
=== LOAD BEGIN ===
|
||||
|
||||
%LOAD
|
||||
|
||||
=== LOAD END ===
|
||||
|
||||
=== RULES BEGIN ===
|
||||
|
||||
%RULES
|
||||
|
||||
=== RULES END ===
|
||||
|
||||
=== MAKEOPTIONSAPPEND BEGIN ===
|
||||
|
||||
%MAKEOPTIONSAPPEND
|
||||
|
||||
=== MAKEOPTIONSAPPEND END ===
|
@ -0,0 +1,2 @@
|
||||
maxpartitions 8
|
||||
maxusers 2 4 8
|
@ -0,0 +1 @@
|
||||
machine regress
|
14
regress/usr.bin/config/support/conf/files
Normal file
14
regress/usr.bin/config/support/conf/files
Normal file
@ -0,0 +1,14 @@
|
||||
deffs REGRESSFS
|
||||
|
||||
device master { }
|
||||
attach master at root
|
||||
|
||||
define hook { }
|
||||
|
||||
device parentii: hook
|
||||
attach parentii at master
|
||||
device parenti: hook
|
||||
attach parenti at master
|
||||
|
||||
device child
|
||||
attach child at hook
|
Loading…
Reference in New Issue
Block a user