From a85e7737231e4c2197ad73405e7cff27ec993b3b Mon Sep 17 00:00:00 2001 From: claudio Date: Fri, 7 Sep 2018 08:38:35 +0000 Subject: [PATCH] Move the config regress tests into own directory making space for additional unittests and maybe more. bgpd needs more test coverage. Discussed with bluhm@ --- regress/usr.sbin/bgpd/Makefile | 39 ++----------------- regress/usr.sbin/bgpd/bgpd.conf.1.in | 4 -- regress/usr.sbin/bgpd/config/Makefile | 34 ++++++++++++++++ regress/usr.sbin/bgpd/config/bgpd.conf.1.in | 4 ++ .../usr.sbin/bgpd/{ => config}/bgpd.conf.1.ok | 0 .../usr.sbin/bgpd/{ => config}/bgpd.conf.2.in | 2 +- .../usr.sbin/bgpd/{ => config}/bgpd.conf.2.ok | 0 .../bgpd/{ => config}/bgpd.conf.example.ok | 0 .../bgpd/{ => config}/bgpd.conf.printconf | 0 9 files changed, 43 insertions(+), 40 deletions(-) delete mode 100644 regress/usr.sbin/bgpd/bgpd.conf.1.in create mode 100644 regress/usr.sbin/bgpd/config/Makefile create mode 100644 regress/usr.sbin/bgpd/config/bgpd.conf.1.in rename regress/usr.sbin/bgpd/{ => config}/bgpd.conf.1.ok (100%) rename regress/usr.sbin/bgpd/{ => config}/bgpd.conf.2.in (84%) rename regress/usr.sbin/bgpd/{ => config}/bgpd.conf.2.ok (100%) rename regress/usr.sbin/bgpd/{ => config}/bgpd.conf.example.ok (100%) rename regress/usr.sbin/bgpd/{ => config}/bgpd.conf.printconf (100%) diff --git a/regress/usr.sbin/bgpd/Makefile b/regress/usr.sbin/bgpd/Makefile index 84bc623dafc..7c49f201edf 100644 --- a/regress/usr.sbin/bgpd/Makefile +++ b/regress/usr.sbin/bgpd/Makefile @@ -1,37 +1,6 @@ -# $OpenBSD: Makefile,v 1.3 2018/09/06 15:55:30 benno Exp $ +# $OpenBSD: Makefile,v 1.4 2018/09/07 08:38:35 claudio Exp $ -BGPDTESTS=1 2 +SUBDIR += config +#SUBDIR += unittests -REGRESS_TARGETS = config - -.for n in ${BGPDTESTS} -BGPD_TARGETS+=bgpd${n} -BGPD_UPDATES+=bgpd${n}-update - -bgpd${n}: - bgpd -nv -f /dev/stdin < ${.CURDIR}/bgpd.conf.${n}.in | \ - sed 's/router-id .*/router-id 127.0.0.1/' | \ - diff -u ${.CURDIR}/bgpd.conf.${n}.ok /dev/stdin - -bgpd${n}-update: - bgpd -nv -f /dev/stdin < ${.CURDIR}/bgpd.conf.${n}.in | \ - sed 's/router-id .*/router-id 127.0.0.1/' > \ - ${.CURDIR}/bgpd.conf.${n}.ok -.endfor - -config: bgpd-example bgpd-printconf ${BGPD_TARGETS} -bgpd-update: ${BGPD_UPDATES} - -# check that the example configuration file we ship is ok -bgpd-example: - bgpd -nf ${.CURDIR}/../../../etc/examples/bgpd.conf - -# check that the output of bgpd -nvv is parseable -bgpd-printconf: - bgpd -nvf ${.CURDIR}/bgpd.conf.printconf | \ - bgpd -nf /dev/stdin - -clean: - rm -f bgpd.conf.printconf.test - -.include +.include diff --git a/regress/usr.sbin/bgpd/bgpd.conf.1.in b/regress/usr.sbin/bgpd/bgpd.conf.1.in deleted file mode 100644 index 6806b1f0523..00000000000 --- a/regress/usr.sbin/bgpd/bgpd.conf.1.in +++ /dev/null @@ -1,4 +0,0 @@ -# $OpenBSD: bgpd.conf.1.in,v 1.1 2017/10/05 08:19:24 phessler Exp $ -# Only test the bare minimum configuration - -AS 1 diff --git a/regress/usr.sbin/bgpd/config/Makefile b/regress/usr.sbin/bgpd/config/Makefile new file mode 100644 index 00000000000..adaac5344b7 --- /dev/null +++ b/regress/usr.sbin/bgpd/config/Makefile @@ -0,0 +1,34 @@ +# $OpenBSD: Makefile,v 1.1 2018/09/07 08:38:35 claudio Exp $ + +BGPDTESTS=1 2 + +REGRESS_TARGETS = config + +.for n in ${BGPDTESTS} +BGPD_TARGETS+=bgpd${n} +BGPD_UPDATES+=bgpd${n}-update + +bgpd${n}: + bgpd -nv -f /dev/stdin < ${.CURDIR}/bgpd.conf.${n}.in | \ + sed 's/router-id .*/router-id 127.0.0.1/' | \ + diff -u ${.CURDIR}/bgpd.conf.${n}.ok /dev/stdin + +bgpd${n}-update: + bgpd -nv -f /dev/stdin < ${.CURDIR}/bgpd.conf.${n}.in | \ + sed 's/router-id .*/router-id 127.0.0.1/' > \ + ${.CURDIR}/bgpd.conf.${n}.ok +.endfor + +config: bgpd-example bgpd-printconf ${BGPD_TARGETS} +bgpd-update: ${BGPD_UPDATES} + +# check that the example configuration file we ship is ok +bgpd-example: + bgpd -nf ${.CURDIR}/../../../../etc/examples/bgpd.conf + +# check that the output of bgpd -nvv is parseable +bgpd-printconf: + bgpd -nvf ${.CURDIR}/bgpd.conf.printconf | \ + bgpd -nf /dev/stdin + +.include diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.1.in b/regress/usr.sbin/bgpd/config/bgpd.conf.1.in new file mode 100644 index 00000000000..d4f0c290463 --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.1.in @@ -0,0 +1,4 @@ +# $OpenBSD: bgpd.conf.1.in,v 1.1 2018/09/07 08:38:35 claudio Exp $ +# Only test the bare minimum configuration + +AS 1 diff --git a/regress/usr.sbin/bgpd/bgpd.conf.1.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.1.ok similarity index 100% rename from regress/usr.sbin/bgpd/bgpd.conf.1.ok rename to regress/usr.sbin/bgpd/config/bgpd.conf.1.ok diff --git a/regress/usr.sbin/bgpd/bgpd.conf.2.in b/regress/usr.sbin/bgpd/config/bgpd.conf.2.in similarity index 84% rename from regress/usr.sbin/bgpd/bgpd.conf.2.in rename to regress/usr.sbin/bgpd/config/bgpd.conf.2.in index 978146816e8..c349315ec0e 100644 --- a/regress/usr.sbin/bgpd/bgpd.conf.2.in +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.2.in @@ -1,4 +1,4 @@ -# $OpenBSD: bgpd.conf.2.in,v 1.1 2017/10/05 08:19:24 phessler Exp $ +# $OpenBSD: bgpd.conf.2.in,v 1.1 2018/09/07 08:38:35 claudio Exp $ # Test various community related filter parsing AS 1 diff --git a/regress/usr.sbin/bgpd/bgpd.conf.2.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.2.ok similarity index 100% rename from regress/usr.sbin/bgpd/bgpd.conf.2.ok rename to regress/usr.sbin/bgpd/config/bgpd.conf.2.ok diff --git a/regress/usr.sbin/bgpd/bgpd.conf.example.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.example.ok similarity index 100% rename from regress/usr.sbin/bgpd/bgpd.conf.example.ok rename to regress/usr.sbin/bgpd/config/bgpd.conf.example.ok diff --git a/regress/usr.sbin/bgpd/bgpd.conf.printconf b/regress/usr.sbin/bgpd/config/bgpd.conf.printconf similarity index 100% rename from regress/usr.sbin/bgpd/bgpd.conf.printconf rename to regress/usr.sbin/bgpd/config/bgpd.conf.printconf -- 2.20.1