5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2024-12-22 21:33:47 +03:00
pve-common/test/Makefile
Dominik Csapak 07f136d636 JSONSchema: add support for array parameter in api calls, cli and config
a few things were missing for it to work:
* on the cli, we have to get the option as an array if the type is an
  array
* the untainting must be done recursively, otherwise, the regex matching
  converts an array hash into the string 'ARRAY(0x123412341234)'
* JSONSchema::parse_config did not handle array formats specially, but
  we want to allow to specify them multiple time
* the biggest point: in the RESTHandler, to be compatible with the
  current gui behavior, we have to rewrite two parameter types:
  - when the api defines a '-list' format for a string type, but we get
    a list (because of the changes in http-server), we join the list
    with a comma into a string
  - when the api defines an 'array' type, but we get a scalar value,
    wrap the value in an array (because for www-form-urlencoded, you
    cannot send an array with a single value) add tests for this
    behavior, some of which we want to deprecate and remove in the
    future

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-07 13:10:50 +02:00

24 lines
405 B
Makefile

SUBDIRS = etc_network_interfaces
TESTS = lock_file.test \
calendar_event_test.test \
convert_size_test.test \
procfs_tests.test \
format_test.test \
section_config_test.test \
api_parameter_test.test \
all:
.PHONY: check install clean distclean
export PERLLIB=../src
check: $(TESTS)
for d in $(SUBDIRS); do $(MAKE) -C $$d check; done
%.test: %.pl
TZ=UTC-1 ./$<
distclean: clean
clean: