blob: e2909fd46b090aa9f1d9c5072598e4d434970093 [file] [log] [blame]
Lev Walkin40b8a7a2017-10-08 22:36:29 -07001ASN_PROGRAM = ldap3dump
2CFLAGS += -DASN_CONVERTER_TITLE="Lightweight Directory Access Protocol V3 decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
3begin: LDAPMessage.c maybe-wip-pause all
Lev Walkin8c85f2a2006-09-09 11:26:09 +00004
Lev Walkin40b8a7a2017-10-08 22:36:29 -07005-include Makefile.am.example
Lev Walkin8c85f2a2006-09-09 11:26:09 +00006
Lev Walkinc33a59e2006-09-18 20:04:14 +00007LDAPMessage.c: ../sample.makefile.regen ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1
Lev Walkincc7c94e2006-09-17 04:01:29 +00008 make regen-makefile
9 @touch LDAPMessage.c
10 make
11
12regen-makefile:
Lev Walkin5aef2c52007-06-29 12:46:06 +000013 TITLE="Lightweight Directory Access Protocol V3 decoder" \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070014 ASN_CMDOPTS="-fcompound-names" \
15 ASN_MODULES="../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1" \
16 ASN_PDU=LDAPMessage \
17 ASN_PROGRAM=ldap3dump \
Lev Walkin2fd86de2006-09-13 02:10:23 +000018 ../sample.makefile.regen
Lev Walkin8c85f2a2006-09-09 11:26:09 +000019
Lev Walkin40b8a7a2017-10-08 22:36:29 -070020check: ${ASN_PROGRAM} check-ber check-xer check-oer check-per
Lev Walkin1f12da42006-09-24 19:47:07 +000021 @echo ================
22 @echo All tests passed
23 @echo ================
24
25check-ber:
Lev Walkin00918812006-09-18 21:19:32 +000026 @if test -f sample-LDAPMessage-1.[db]er ; then \
Lev Walkin5efafc52017-09-05 03:43:00 -070027 for f in sample-*-*.[db]er; do \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070028 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000029 for b in 1 17 33 980 8192; do \
Lev Walkin5efafc52017-09-05 03:43:00 -070030 echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070031 ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \
32 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \
Lev Walkin46a6bd22007-06-26 08:36:39 +000033 diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \
Lev Walkinc33a59e2006-09-18 20:04:14 +000034 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000035 echo "Test junking $$f (please wait)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070036 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 5; \
37 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 6; \
Lev Walkin13afe532006-09-18 21:30:04 +000038 done; done; fi
Lev Walkin1f12da42006-09-24 19:47:07 +000039
40check-xer:
Lev Walkin00918812006-09-18 21:19:32 +000041 @if test -f sample-LDAPMessage-1.xer ; then \
Lev Walkin5efafc52017-09-05 03:43:00 -070042 for f in sample-*-*.xer; do \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070043 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000044 for b in 1 17 33 980 8192; do \
Lev Walkin5efafc52017-09-05 03:43:00 -070045 echo "Recoding $$f ($$pdu) into DER and back ($$b)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070046 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \
47 ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \
Lev Walkin46a6bd22007-06-26 08:36:39 +000048 diff $$f ./.tmp.2.$$$$ || exit 4; \
Lev Walkinc33a59e2006-09-18 20:04:14 +000049 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000050 echo "Test junking $$f (please wait)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070051 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 5; \
52 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 6; \
Lev Walkin5efafc52017-09-05 03:43:00 -070053 done; done; fi
54
55check-oer:
56 @if test -f sample-LDAPMessage-1.*oer ; then \
57 for f in sample-*-*.*oer; do \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070058 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin5efafc52017-09-05 03:43:00 -070059 for b in 1 17 33 980 8192; do \
60 echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070061 ./${ASN_PROGRAM} -p $$pdu -b $$b -ioer -oxer $$f > ./.tmp.1.$$$$ || exit 2; \
62 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -ooer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \
Lev Walkin5efafc52017-09-05 03:43:00 -070063 diff $$f ./.tmp.2.$$$$ || exit 4; \
64 rm -f ./.tmp.[12].$$$$; \
65 echo "Test junking $$f (please wait) ($$b) ..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070066 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 5; \
67 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 6; \
Lev Walkin13afe532006-09-18 21:30:04 +000068 done; done; fi
Lev Walkin1f12da42006-09-24 19:47:07 +000069
70check-per:
Lev Walkin46a6bd22007-06-26 08:36:39 +000071 @if test -f sample-LDAPMessage-1-nopad.per ; then \
Lev Walkin5efafc52017-09-05 03:43:00 -070072 for f in sample-*-[1-9]-nopad.per; do \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070073 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000074 for b in 1 17 33 980 8192; do \
Lev Walkin5efafc52017-09-05 03:43:00 -070075 echo "Recoding non-padded $$f ($$pdu) into DER into XER and back ($$b)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070076 ./${ASN_PROGRAM} -p $$pdu -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \
77 ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \
78 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \
Lev Walkin46a6bd22007-06-26 08:36:39 +000079 diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \
Lev Walkin13afe532006-09-18 21:30:04 +000080 rm -f ./.tmp.[123].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000081 echo "Test junking $$f (please wait)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070082 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 6; \
83 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 7; \
Lev Walkin13afe532006-09-18 21:30:04 +000084 done; done; fi
Lev Walkin46a6bd22007-06-26 08:36:39 +000085 @if test -f sample-LDAPMessage-1.per ; then \
86 for f in sample-*-[1-9].per; do \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070087 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000088 for b in 1 17 33 980 8192; do \
Lev Walkin5efafc52017-09-05 03:43:00 -070089 echo "Recoding $$f ($$pdu) into DER into XER and back ($$b)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070090 ./${ASN_PROGRAM} -p $$pdu -b $$b -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \
91 ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \
92 ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \
Lev Walkin46a6bd22007-06-26 08:36:39 +000093 diff $$f ./.tmp.1.$$$$ || exit 6; \
Lev Walkin13afe532006-09-18 21:30:04 +000094 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000095 echo "Test junking $$f (please wait)..."; \
Lev Walkin40b8a7a2017-10-08 22:36:29 -070096 ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 7; \
97 ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 8; \
Lev Walkin13afe532006-09-18 21:30:04 +000098 done; done; fi
Lev Walkinc744a022006-09-15 18:33:25 +000099
Lev Walkin38a5a202017-08-25 12:17:08 -0700100maybe-wip-pause:
101 @if [ -f WIP ]; then cat WIP; sleep 2; fi
102
Lev Walkin8c85f2a2006-09-09 11:26:09 +0000103distclean: clean
Lev Walkinbcda5ff2006-09-17 03:29:51 +0000104 rm -f $(ASN_MODULE_SOURCES)
105 rm -f $(ASN_MODULE_HEADERS)
Lev Walkin40b8a7a2017-10-08 22:36:29 -0700106 rm -f $(ASN_PROGRAM_SOURCES) $(ASN_PROGRAM_HEADERS)
Lev Walkinad775912017-09-26 22:55:22 -0700107 rm -f Makefile.am.example