clixon/test
Olof hagsand c7e7598e3b * Updated "evhtp" restconf mode
* No reliance on libevent or libevhtp, but on libssl >= 1.1 directly
    * Moved out event handling to clixon event handling
    * Moved out all ssl calls to clixon
  * New code MUST use libevhtp from https://github.com/clixon/clixon-libevhtp.git
    * This does NOT work: libevhtp from https://github.com/criticalstack/libevhtp.git
2021-03-30 16:00:03 +02:00
..
cicd test yangmodels typo 2021-02-22 20:46:19 +00:00
jenkins Added make test and travis experiment 2019-02-04 14:13:20 +01:00
travis * Handling empty netconf XML messages "]]>]]>" is changed from being accepted to return an error. 2021-01-07 16:57:47 +01:00
vagrant * Updated "evhtp" restconf mode 2021-03-30 16:00:03 +02:00
all.sh * New clixon-lib@2020-12-08.yang revision 2020-12-13 22:19:25 +01:00
certs.sh * Multi-socket feature (eg IPv4/IPv6 http/https) to restconf evhtp 2020-11-15 12:34:40 +01:00
config.sh.in clicon_err: Missed print strerr due to category error. 2021-03-30 14:26:22 +02:00
jukebox.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
lib.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
long.sh * RESTCONF configuration is unified and moved from clixon-config.yang to clixon-restconf.yang 2021-02-11 13:46:34 +01:00
Makefile.in Copyright 2021 2021-01-13 14:40:34 +01:00
mem.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
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 Copyright 2021 2021-01-13 14:40:34 +01:00
sum.sh * New clixon-lib@2020-12-08.yang revision 2020-12-13 22:19:25 +01:00
test_api.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01: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 * 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_augment_state.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_augment_trans.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_c++.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_choice.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_cli.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_cli_apipath.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_cli_auto.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_cli_auto_extension.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_cli_auto_genmodel.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_cli_auto_sub.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_cli_history.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_cli_multikey.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_cli_submodes.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_cli_translate.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_client.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_configdir.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_copy_config.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_datastore.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_datastore_repair.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_feature.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_identity.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_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 * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01: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 * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01: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: [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_leafref.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_leafref_augment.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_leafref_state.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_minmax.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.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_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 * 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_paths.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_nacm_datanode_read.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_write.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_default.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_nacm_ext.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_nacm_module_read.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_module_write.sh * Updated "evhtp" restconf mode 2021-03-30 16:00:03 +02:00
test_nacm_protocol.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_recovery.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.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_netconf_filter.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_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 * 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_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 Added: CLICON_CLI_AUTOCLI_EXCLUDE 2021-03-15 13:08:42 +01:00
test_openconfig_interfaces.sh Added: CLICON_CLI_AUTOCLI_EXCLUDE 2021-03-15 13:08:42 +01:00
test_order.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_pattern.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_perf_cli.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_perf_mem.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_perf_netconf.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_perf_restconf.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_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 * Updated "evhtp" restconf mode 2021-03-30 16:00:03 +02:00
test_perf_state_only.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_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 * Updated "evhtp" restconf mode 2021-03-30 16:00:03 +02:00
test_restconf2.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_restconf_basic_auth.sh Added: CLICON_CLI_AUTOCLI_EXCLUDE 2021-03-15 13:08:42 +01:00
test_restconf_err.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_restconf_jukebox.sh * New clixon-lib@2020-03-08.yang revision 2021-03-12 12:10:25 +01:00
test_restconf_listkey.sh * Fixed: [comma in yang list name will lead to cli setting error #186](https://github.com/clicon/clixon/issues/186) 2021-03-08 12:37:47 +01:00
test_restconf_netns.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_restconf_notifications.sh fixed fcgi notification, genmodel 2021-03-10 14:45:18 +01:00
test_restconf_patch.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_restconf_rpc.sh * Updated "evhtp" restconf mode 2021-03-30 16:00:03 +02:00
test_restconf_ssl_certs.sh * Updated "evhtp" restconf mode 2021-03-30 16:00:03 +02:00
test_restconf_startup.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_rpc.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_search_index.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_sock.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01: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 Fixed: [yang submodule show error in modules-state #190](yang submodule show error in modules-state #190) 2021-03-17 15:44:45 +01:00
test_transaction.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_transaction_restart.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_type.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_type_range.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_union.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_unique.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_upgrade_auto.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_upgrade_failsafe.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_upgrade_interfaces.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_upgrade_module.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_upgrade_quit.sh * New clixon-lib@2020-03-08.yang revision 2021-03-12 12:10:25 +01:00
test_upgrade_repair.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_upgrade_simple.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_when_must.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_with_default.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_xml.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_xml_trees.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01: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 * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_xpath_canonical.sh * Made a separate Clixon datastore XML/JSON top-level symbol 2021-03-05 14:15:15 +01:00
test_xpath_functions.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_yang.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_yang_anydata.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_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 * 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_yang_extension.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_yang_load.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_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 * 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
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