Add "make test" target to run pytest

This will create a virtualenv if required.

There is a bit of churn here reverting to autoconf 2.59 in generated
config.h.in and configure
This commit is contained in:
Matt Johnston 2021-10-18 14:24:32 +08:00
parent 65f6e48a06
commit 8b0d31ab20
5 changed files with 3020 additions and 4161 deletions

View File

@ -236,7 +236,7 @@ $(STATIC_LTC): $(OPTION_HEADERS)
$(STATIC_LTM): $(OPTION_HEADERS)
$(MAKE) -C libtommath
.PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean lint
.PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean lint test
ltc-clean:
$(MAKE) -C libtomcrypt clean
@ -265,6 +265,9 @@ tidy:
lint:
cd $(srcdir); ./dropbear_lint.sh
test:
make -C test
## Fuzzing targets
# list of fuzz targets

View File

@ -177,6 +177,9 @@
/* Define to 1 if you have the <mach/mach_time.h> header file. */
#undef HAVE_MACH_MACH_TIME_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset_s' function. */
#undef HAVE_MEMSET_S
@ -231,9 +234,6 @@
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@ -411,14 +411,17 @@
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Use /dev/ptmx */
#undef USE_DEV_PTMX
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
@ -437,7 +440,7 @@
/* Define to `int' if <sys/types.h> does not define. */
#undef mode_t
/* Define as a signed integer type capable of holding a process identifier. */
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */

7138
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -862,7 +862,7 @@ LIBTOM_FILES="libtomcrypt/Makefile libtommath/Makefile"
fi
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES(Makefile $LIBTOM_FILES)
AC_CONFIG_FILES(Makefile $LIBTOM_FILES test/Makefile)
AC_OUTPUT
AC_MSG_NOTICE()

19
test/Makefile.in Normal file
View File

@ -0,0 +1,19 @@
srcdir=@srcdir@
all: test
test: venv/bin/pytest fakekey
./venv/bin/pytest --hostkey=fakekey --dbclient=../dbclient --dropbear=../dropbear $(srcdir)
one: venv/bin/pytest fakekey
./venv/bin/pytest --hostkey=fakekey --dbclient=../dbclient --dropbear=../dropbear $(srcdir) -k exit
fakekey:
../dropbearkey -t ecdsa -f $@
venv/bin/pytest: $(srcdir)/requirements.txt
python3 -m venv init venv
./venv/bin/pip install --upgrade pip
./venv/bin/pip install -r $(srcdir)/requirements.txt
.PHONY: test