clixon/test
Olof hagsand e0ea85d6d5 Configure: changed --with-restconf= to say fcgi is NOT default
test_openconfig: Fixed upgrade of git added new dependencies (openconfig-platform)
2021-10-13 10:00:15 +02:00
..
cicd Refactored Makefile for static linking, removed netconf soap encoding 2021-10-04 20:06:11 +02:00
fuzz Moved fuzz dir to test/fuzz 2021-10-10 18:05:45 +02:00
jenkins Added make test and travis experiment 2019-02-04 14:13:20 +01:00
vagrant Merge branch 'alanyanigersiklu-yang-patch-alanfork' 2021-08-10 19:50:27 +02:00
all.sh restconf memleaks 2021-06-24 13:09:18 +02:00
config.sh.in NETCONF hello error handling, changed YANG PATCH enabling, refactored static linking 2021-10-05 12:04:53 +02:00
example_social.sh Merge branch dispatcher and broke out pagination callbacks to use it 2021-10-08 15:19:37 +02:00
jukebox.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
lib.sh Fix tests for http/1 and http/2 only respectively 2021-09-21 21:23:33 +02:00
long.sh - Better restconf debug: when restconf debug flag set in datastore, ensure the process is started with -D set 2021-04-09 09:34:05 +02:00
Makefile.in Copyright 2021 2021-01-13 14:40:34 +01:00
mem.sh * Fixed: RFC 8040 yang-data extension allows non-key lists 2021-07-19 11:15:49 +02:00
nacm.sh Modify tests so they all work with evhtp and backend config, eg that CLICON_RESTCONF_CONFIG is default true. 2020-11-18 13:57:25 +01:00
plot_perf.sh * RESTCONF configuration is unified and moved from clixon-config.yang to clixon-restconf.yang 2021-02-11 13:46:34 +01:00
README.md Added: CLICON_CLI_AUTOCLI_EXCLUDE 2021-03-15 13:08:42 +01:00
site.sh - Better restconf debug: when restconf debug flag set in datastore, ensure the process is started with -D set 2021-04-09 09:34:05 +02:00
sum.sh Fixed broken test scripts sum.sh and all.sh 2021-04-14 17:13:02 +02:00
test_api.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_api_path.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_augment.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_augment_state.sh Removed remaining and replaced pagination-mode with locked parameter 2021-10-10 11:40:47 +02:00
test_augment_trans.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_c++.sh * Netconf message-id attribute changed from optional to mandatory 2021-06-30 10:59:10 +02:00
test_choice.sh * Most tests work with HTTP/2 support using nghttp2 2021-06-08 20:53:43 +02:00
test_cli.sh * Fixed: [restconf patch method adds redundant namespaces #235](https://github.com/clicon/clixon/issues/235) 2021-06-10 13:05:03 +02:00
test_cli_apipath.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_cli_auto.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_cli_auto_extension.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_cli_auto_genmodel.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_cli_auto_sub.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_cli_history.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_cli_leafref.sh Fixed static linking for coverage and fuzzing 2021-09-27 12:26:53 +02:00
test_cli_multikey.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_cli_submodes.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_cli_translate.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_client.sh * Netconf message-id attribute changed from optional to mandatory 2021-06-30 10:59:10 +02:00
test_configdir.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_copy_config.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_datastore.sh Internal RESTCONF changes: 2021-04-30 14:49:01 +02:00
test_datastore_repair.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_debug.sh - Restconf native: Fixed ssl/non-ssl read/write behaviour for data that is different in freebsd than in linux 2021-06-25 10:48:55 +00:00
test_feature.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_identity.sh * Added linenumbers to all YANG symbols for better debug and errors 2021-08-05 15:16:29 +03:00
test_insert.sh removed unnecessary strerror() in clixon_err() calls; added 'function' keyword in all function declarations in the test scripts 2021-02-04 12:04:48 +01:00
test_install.sh - Memleaks in xpath parse error 2021-10-03 18:49:25 +02:00
test_instance_id.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_instance_id_multi.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_json.sh * Fixed: [JSON parsing error for a specific input. #236](https://github.com/clicon/clixon/issues/236) 2021-06-09 11:44:28 +02:00
test_json_list.sh * Fixed: [JSON leaf-list output single element leaf-list does not use array](https://github.com/clicon/clixon/issues/261) 2021-08-24 17:08:31 +02:00
test_json_null.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_leaf_default.sh * Fixed: YANG when was not properly implemented for LEAF default values 2021-08-05 15:16:29 +03:00
test_leafref.sh * YANG Leafref feature update 2021-08-16 17:14:27 +02:00
test_leafref_augment.sh * YANG Leafref feature update 2021-08-16 17:14:27 +02:00
test_leafref_state.sh - Rewrite of netconf get/get-config code 2021-09-21 11:24:53 +02:00
test_minmax.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm_credentials.sh * Fixed: [CLIXON is not waiting for the hello message #184](https://github.com/clicon/clixon/issues/184) 2021-03-10 14:18:16 +01:00
test_nacm_datanode.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm_datanode_paths.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm_datanode_read.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm_datanode_write.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm_default.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm_ext.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_nacm_module_read.sh * Netconf message-id attribute changed from optional to mandatory 2021-06-30 10:59:10 +02:00
test_nacm_module_write.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm_protocol.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_nacm_recovery.sh memory leak and nacm recovery test fix 2021-09-21 13:24:34 +02:00
test_netconf.sh - Cannot reproduce https://github.com/clicon/clixon/issues/245, added sanity chaeck and regression test 2021-09-09 14:01:48 +02:00
test_netconf_filter.sh Testing dependency fixes, Netconf XML declaration and filter logic fix 2021-08-10 19:32:02 +02:00
test_netconf_hello.sh NETCONF hello error handling, changed YANG PATCH enabling, refactored static linking 2021-10-05 12:04:53 +02:00
test_netconf_notifications.sh * Fixed: [CLIXON is not waiting for the hello message #184](https://github.com/clicon/clixon/issues/184) 2021-03-10 14:18:16 +01:00
test_netconf_ssh_callhome.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_netconf_whitespace.sh * Fixed: [CLIXON is not waiting for the hello message #184](https://github.com/clicon/clixon/issues/184) 2021-03-10 14:18:16 +01:00
test_openconfig.sh * Fixed: [RESTConf GET for a specific list instance retrieves data from other submodules that have same list name and key value #244](https://github.com/clicon/clixon/issues/244) 2021-07-08 16:26:39 +02:00
test_openconfig_interfaces.sh Configure: changed --with-restconf= to say fcgi is NOT default 2021-10-13 10:00:15 +02:00
test_order.sh coverage: added tests for all ints 2021-10-06 08:36:34 +02:00
test_pagination_config.sh New state plugin callback for pagination. 2021-09-21 15:02:46 +02:00
test_pagination_draft.sh Renamed paging to pagination 2021-09-21 11:28:29 +02:00
test_pagination_state.sh Dispatcher fixes: user callback arg, changing handler to NULL 2021-10-12 14:45:10 +02:00
test_pattern.sh * Fixed: Yang patterns: \n and other non-printable characters were broken 2021-08-05 15:16:29 +03:00
test_perf_cli.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_perf_json.sh * Partly Fixed: [String concatenation in YANG model leads to syntax error](https://github.com/clicon/clixon/issues/265) 2021-09-20 22:54:14 +02:00
test_perf_mem.sh - Fixed [clixon_proc can't start new process with PATH env #202](https://github.com/clicon/clixon/issues/202) 2021-04-14 17:02:24 +02:00
test_perf_netconf.sh - Native restconf: use cligen buffers instead of libevent for replies 2021-04-29 14:06:05 +02:00
test_perf_restconf.sh - Restconf native: Fixed ssl/non-ssl read/write behaviour for data that is different in freebsd than in linux 2021-06-25 10:48:55 +00:00
test_perf_startup.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_perf_state.sh * Most tests work with HTTP/2 support using nghttp2 2021-06-08 20:53:43 +02:00
test_perf_state_only.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_perf_xml.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_privileges.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_restconf.sh Fix tests for http/1 and http/2 only respectively 2021-09-21 21:23:33 +02:00
test_restconf_basic_auth.sh - Pagination: enabled LIST_PAGINATION and remobved constant 2021-09-23 13:33:26 +02:00
test_restconf_err.sh - Pagination: enabled LIST_PAGINATION and remobved constant 2021-09-23 13:33:26 +02:00
test_restconf_http_upgrade.sh Fix tests for http/1 and http/2 only respectively 2021-09-21 21:23:33 +02:00
test_restconf_internal.sh - Pagination: enabled LIST_PAGINATION and remobved constant 2021-09-23 13:33:26 +02:00
test_restconf_internal_usecases.sh - Pagination: enabled LIST_PAGINATION and remobved constant 2021-09-23 13:33:26 +02:00
test_restconf_jukebox.sh * Most tests work with HTTP/2 support using nghttp2 2021-06-08 20:53:43 +02:00
test_restconf_listkey.sh * Most tests work with HTTP/2 support using nghttp2 2021-06-08 20:53:43 +02:00
test_restconf_netns.sh Fix tests for http/1 and http/2 only respectively 2021-09-21 21:23:33 +02:00
test_restconf_nmap.sh restconf memleaks 2021-06-24 13:09:18 +02:00
test_restconf_notifications.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_restconf_op.sh - Updated code to clixon 5.2 status 2021-09-21 11:22:40 +02:00
test_restconf_plain_patch.sh - Moved yang patch code to new files restconf_methods_patch.[ch] 2021-08-15 20:43:52 +02:00
test_restconf_ssl_certs.sh - Pagination: enabled LIST_PAGINATION and remobved constant 2021-09-23 13:33:26 +02:00
test_restconf_startup.sh * Most tests work with HTTP/2 support using nghttp2 2021-06-08 20:53:43 +02:00
test_restconf_yang_patch_json.sh NETCONF hello error handling, changed YANG PATCH enabling, refactored static linking 2021-10-05 12:04:53 +02:00
test_restconf_yang_patch_xml.sh NETCONF hello error handling, changed YANG PATCH enabling, refactored static linking 2021-10-05 12:04:53 +02:00
test_rpc.sh * Netconf message-id attribute changed from optional to mandatory 2021-06-30 10:59:10 +02:00
test_search_index.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_sock.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_startup.sh * Fixed: [The config false leaf shouldn't be configed in startup stage #189](https://github.com/clicon/clixon/issues/189) 2021-03-11 09:11:14 +01:00
test_submodule.sh fix the belongs-to test 2021-07-08 16:53:45 +02:00
test_transaction.sh * Fixed: Netconf diff callback did not work with choice and same value replace 2021-08-17 16:51:08 +02:00
test_transaction_restart.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_type.sh * Partly Fixed: [String concatenation in YANG model leads to syntax error](https://github.com/clicon/clixon/issues/265) 2021-09-20 22:54:14 +02:00
test_type_range.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_union.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_unique.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_upgrade_auto.sh * Added check of old config in upgrade scenarios. 2021-04-12 21:03:20 +02:00
test_upgrade_checkold.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_upgrade_failsafe.sh - Rewrite of netconf get/get-config code 2021-09-21 11:24:53 +02:00
test_upgrade_interfaces.sh - Restconf bind: continue with other sockets if bind fails, print address on log 2021-04-13 18:00:27 +02:00
test_upgrade_module.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_upgrade_quit.sh First working prototype 2021-09-21 11:22:40 +02:00
test_upgrade_repair.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_upgrade_simple.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_when_must.sh * Fixed: [OpenConfig BGP afi-safi and when condition issues #249](https://github.com/clicon/clixon/issues/249) 2021-08-05 15:16:29 +03:00
test_with_default.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_xml.sh * Fixed: [clixon_netconf errors on client XML Declaration with valid encoding spec](https://github.com/clicon/clixon/issues/250) 2021-08-10 19:32:02 +02:00
test_xml_trees.sh Internal RESTCONF changes: 2021-04-30 14:49:01 +02:00
test_xml_validate.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_xpath.sh * Fixed: [xpath function count did not work properly #224](https://github.com/clicon/clixon/issues/224) 2021-05-20 15:16:29 +02:00
test_xpath_canonical.sh - New netconf-specific uint32 parse functions 2021-09-21 11:24:53 +02:00
test_xpath_functions.sh * Fixed: [OpenConfig BGP afi-safi and when condition issues #249](https://github.com/clicon/clixon/issues/249) 2021-08-05 15:16:29 +03:00
test_yang.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_yang_anydata.sh - Restconf native http/1 to http/2 upgrade (non-tls) 2021-06-13 12:43:19 +02:00
test_yang_bind.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_yang_default.sh Internal RESTCONF changes: 2021-04-30 14:49:01 +02:00
test_yang_deviation.sh * Added new startup-mode: running-startup: First try running db, if it is empty try startup db. 2021-05-27 13:18:01 +02:00
test_yang_extension.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_yang_load.sh * Added ordering sanity check for YANG modules and sub-modules 2021-06-24 21:56:36 +02:00
test_yang_models_ieee.sh Added: CLICON_CLI_AUTOCLI_EXCLUDE 2021-03-15 13:08:42 +01:00
test_yang_models_ietf.sh Added: CLICON_CLI_AUTOCLI_EXCLUDE 2021-03-15 13:08:42 +01:00
test_yang_namespace.sh - Link utils statically if LINKAGE=static 2021-06-18 22:50:30 +02:00
test_yang_when.sh * Fixed: [when condition error under augment in restconf #227](https://github.com/clicon/clixon/issues/227) 2021-05-25 15:25:26 +02:00
valgrind-clixon.supp Revert "Revert "* Added valgrind memory leak tests in testmem.sh for restconf"" 2019-02-20 16:25:42 +01:00

Clixon tests and CI

Overview

Tests called 'test_*.sh' and placed in this directory will be automatically run as part of the all.sh, sum.sh tests etc. The scripts need to follow some rules to work properly, please look at one or two to get the idea.

Note that configure must ensure optional yangs be installed:

  ./configure --enable-optyangs

See also the site.sh for example for skipping tests or setting some site-specific variables.

Continuous Integration

CI is done via Travis CI.

In the CI process, the system is built and configured and then the clixon test container is built and the tests in this directory is executed.

There are also manual cicd scripts here

Vagrant

Vagrant scripts are here

Getting started

You need to build and install the clixon utility programs before running the tests as some of the tests rely on them:

  cd util
  make
  sudo make install

You need to configure and start nginx for the restconf tests:

  • The example has instructions on how to edit your nginx config files
  • If you run systemd: sudo systemctl start nginx.service

You may need to install the time utility (/usr/bin/time).

Prefix variable

You can prefix a test with BE=0 if you want to run your own backend.

To run with debug flags, use the DBG=<number> environment variable.

Other variables include:

  • DEMWAIT Number of seconds to sleep after daemons have started

Run all tests

You can run an individual test by itself, or run through all tests matching 'test_*.sh' in the directory. Prints test output and stops on first error:

  all.sh

Run all tests but continue after errors and only print a summary test output identifying which tests succeeded and which failed:

  sum.sh

Memory leak test

The mem.sh runs memory checks using valgrind. Start it with no arguments to test all components (backend, restconf, cli, netconf), or specify which components to run:

  mem.sh    2>&1 | tee mylog        # All components
  mem.sh restconf backend           # Only backend and cli

Run pattern of tests

The above scripts work with the pattern variable to limit the scope of which tests run, eg:

  pattern="test_c*.sh" mem.sh

Performance plots

The script plot_perf.sh produces gnuplots for some testcases.

Site.sh

You may add your site-specific modifications in a site.sh file. Example:

  # Add your local site specific env variables (or tests) here.
  # Add test to this list that you dont want run
  SKIPLIST="test_openconfig.sh test_yangmodels.sh"
  # Parse yang openconfig models from https://github.com/openconfig/public
  OPENCONFIG=/usr/local/share/openconfig/public
  # Parse yangmodels from https://github.com/YangModels/yang
  YANGMODELS=/usr/local/share/yangmodels
  # Standard IETF RFC yang files. 
  IETFRFC=$YANGMODELS/standard/ietf/RFC

For example, in FreeBSD, add:

  wwwuser=www
  make=gmake

https

For fcgi/nginx you need to setup https in the nginx config file, independently of clixon.

If you use evhtp with configure --with-restconf=evhtp, you can prepend the tests with RCPROTO=https which will run all restconf tests with SSL https and server certs.

Ensure the server keys are in order, as follows.

If you already have server certs, ensure the RESTCONF variable in lib.sh points to them, by default the config is

  <server-cert-path>/etc/ssl/certs/clixon-server-crt.pem</server-cert-path>
  <server-key-path>/etc/ssl/private/clixon-server-key.pem</server-key-path>
  <server-ca-cert-path>/etc/ssl/certs/clixon-ca-crt.pem</server-ca-cert-path>

If you do not have them, generate self-signed certs, eg as follows:

  openssl req -x509 -nodes -newkey rsa:4096 -keyout /etc/ssl/private/clixon-server-key.pem -out /etc/ssl/certs/clixon-server-crt.pem -days 365

There are also client-cert tests, eg test_ssl_certs.sh