clixon/test
2021-02-04 12:04:48 +01:00
..
cicd Copyright 2021 2021-01-13 14:40:34 +01: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 Copyright 2021 2021-01-13 14:40:34 +01: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 Copyright 2021 2021-01-13 14:40:34 +01:00
jukebox.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
lib.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
long.sh unified curl test options 2020-07-03 14:13:15 +02: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 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
README.md test: sleep 0.5s; vagrant centos: ipv6 enable 2020-11-24 18:29:04 +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 * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete 2020-11-21 13:16:29 +01:00
test_api_path.sh * Added stricter check on schema-node identifier checking, such as for augments. 2020-09-29 20:53:24 +02:00
test_augment.sh * minor edits make datastore=nocache pass tests, and ensure generic copy-config works 2020-12-04 14:47:55 +01:00
test_augment_state.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_augment_trans.sh * More explanatory validation error messages for when and augments error messages. 2020-10-07 20:57:49 +02:00
test_c++.sh * Checked yang binding validity which lead to: 2020-07-25 16:09:24 +02:00
test_choice.sh [Presence container configs not displayed in 'show config set' #164 ](https://github.com/clicon/clixon/issues/164) 2020-12-28 14:52:56 +01:00
test_cli.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_cli_apipath.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_cli_auto.sh * [Delete and show config are oblivious to the leaf value #157](https://github.com/clicon/clixon/issues/157) 2020-12-16 16:03:57 +01:00
test_cli_auto_extension.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_cli_auto_genmodel.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_cli_auto_sub.sh * [Delete and show config are oblivious to the leaf value #157](https://github.com/clicon/clixon/issues/157) 2020-12-16 16:03:57 +01:00
test_cli_history.sh * Test fixes 2020-12-01 22:34:24 +01:00
test_cli_multikey.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_cli_submodes.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_cli_translate.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_client.sh * Corrected client session handling to make internal IPC socket persistent 2021-01-27 15:07:27 +01:00
test_configdir.sh * Configuration directory 2020-10-01 11:04:25 +02:00
test_copy_config.sh * Ensure all fopen check for NULL (not -1) 2020-12-07 13:33:21 +01:00
test_datastore.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_datastore_repair.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_feature.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_identity.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +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 centos test fixes 2020-06-08 18:48:18 +00:00
test_instance_id.sh * Added stricter check on schema-node identifier checking, such as for augments. 2020-09-29 20:53:24 +02:00
test_instance_id_multi.sh * Fixed instance-id multiple results 2020-04-22 14:00:40 +02:00
test_json.sh Fixed: [Behaviour of Empty LIST Input in RESTCONF JSON #166](https://github.com/clicon/clixon/issues/166) 2021-01-15 13:50:05 +01:00
test_json_null.sh remove move end transaction 2020-04-03 08:47:48 +02:00
test_leaf_default.sh * Netconf as default namespace has been disabled by default. 2020-09-02 15:44:10 +02:00
test_leafref.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_leafref_augment.sh * Netconf as default namespace has been disabled by default. 2020-09-02 15:44:10 +02:00
test_leafref_state.sh * Netconf as default namespace has been disabled by default. 2020-09-02 15:44:10 +02:00
test_minmax.sh Fixed: [min-elements attribute prevents from deleting list entries #133](https://github.com/clicon/clixon/issues/133) 2020-09-08 10:47:43 +02:00
test_nacm.sh * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete 2020-11-21 13:16:29 +01:00
test_nacm_credentials.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_nacm_datanode.sh * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete 2020-11-21 13:16:29 +01:00
test_nacm_datanode_paths.sh * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete 2020-11-21 13:16:29 +01:00
test_nacm_datanode_read.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_nacm_datanode_write.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_nacm_default.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_nacm_ext.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_nacm_module_read.sh * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete 2020-11-21 13:16:29 +01:00
test_nacm_module_write.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_nacm_protocol.sh * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete 2020-11-21 13:16:29 +01:00
test_nacm_recovery.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_netconf.sh * Corrected client session handling to make internal IPC socket persistent 2021-01-27 15:07:27 +01:00
test_netconf_filter.sh * Netconf as default namespace has been disabled by default. 2020-09-02 15:44:10 +02:00
test_netconf_notifications.sh mv stream->restconf_notif, cli-auto test change for grouping/extension bug 2021-01-28 11:27:07 +01:00
test_netconf_ssh_callhome.sh * NETCONF Call Home Call Home RFC 8071 2021-02-04 11:43:09 +01:00
test_netconf_whitespace.sh * Netconf as default namespace has been disabled by default. 2020-09-02 15:44:10 +02:00
test_openconfig.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_order.sh * Added XPATH functions position 2020-10-27 09:40:45 +01:00
test_pattern.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_perf_cli.sh * Ensure all fopen check for NULL (not -1) 2020-12-07 13:33:21 +01:00
test_perf_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
test_perf_netconf.sh * Ensure all fopen check for NULL (not -1) 2020-12-07 13:33:21 +01:00
test_perf_restconf.sh * Ensure all fopen check for NULL (not -1) 2020-12-07 13:33:21 +01:00
test_perf_startup.sh * Ensure all fopen check for NULL (not -1) 2020-12-07 13:33:21 +01:00
test_perf_state.sh Prepare for 4.9.0 release 2020-12-18 13:54:00 +01:00
test_perf_state_only.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_perf_xml.sh * Optimizations 2020-04-28 22:31:58 +02:00
test_privileges.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_restconf.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_restconf2.sh * Error-type changed from protocol to application for data-not-unique netconf/restconf errors 2020-12-01 18:58:20 +01:00
test_restconf_err.sh * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete 2020-11-21 13:16:29 +01:00
test_restconf_jukebox.sh * New clixon-config@2020-12-30.yang revision 2021-01-02 17:27:44 +01:00
test_restconf_listkey.sh * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete 2020-11-21 13:16:29 +01:00
test_restconf_netns.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_restconf_notifications.sh mv stream->restconf_notif, cli-auto test change for grouping/extension bug 2021-01-28 11:27:07 +01:00
test_restconf_patch.sh Fixed memory error in RESTCONF PATCH/PUT when accessing top-level data node. 2020-12-09 13:39:38 +01:00
test_restconf_rpc.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_restconf_startup.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_rpc.sh test rpc keyless wrong order 2020-12-02 09:53:33 +01:00
test_search_index.sh minor things for clixon.4.4 2020-03-27 11:20:35 +01:00
test_sock.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_ssl_certs.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_startup.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_submodule.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_transaction.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_transaction_restart.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_type.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_type_range.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_union.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_unique.sh * Error-type changed from protocol to application for data-not-unique netconf/restconf errors 2020-12-01 18:58:20 +01:00
test_upgrade_auto.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
test_upgrade_failsafe.sh * Netconf as default namespace has been disabled by default. 2020-09-02 15:44:10 +02:00
test_upgrade_interfaces.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_upgrade_module.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_upgrade_quit.sh * New clixon-config@2020-12-30.yang revision 2021-01-02 17:27:44 +01:00
test_upgrade_repair.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
test_upgrade_simple.sh * Added cvv_i output parameter to api_path_fmt2api_path() to see how many cvv entries were used 2020-12-29 11:14:34 +01:00
test_when_must.sh Added support for XPATH functions: 2020-09-22 22:40:42 +02:00
test_with_default.sh * Netconf as default namespace has been disabled by default. 2020-09-02 15:44:10 +02:00
test_xml.sh * Fixed: [namespace prefix nc is not supported](https://github.com/clicon/clixon/issues/143) 2020-10-17 18:04:46 +02:00
test_xml_trees.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_xml_validate.sh undef state path bypass 2020-05-04 13:35:04 +02:00
test_xpath.sh More XPath function support 2020-09-25 11:52:06 +02:00
test_xpath_canonical.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_xpath_functions.sh * More explanatory validation error messages for when and augments error messages. 2020-10-07 20:57:49 +02:00
test_yang.sh revise testing: change expectfn -> extectpart etc 2020-12-29 13:49:49 +01:00
test_yang_anydata.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_yang_bind.sh Added docker support for three restconf modes: nginx/fcgi(default); evhtp ; and none. 2020-07-07 13:26:38 +02:00
test_yang_default.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_yang_extension.sh * More YANG extension functionality, 2020-12-08 17:21:37 +01:00
test_yang_load.sh * Netconf as default namespace has been disabled by default. 2020-09-02 15:44:10 +02:00
test_yang_models.sh revert clixon-err on XML 2020-11-18 13:57:25 +01:00
test_yang_namespace.sh test and vagrant fixes 2020-11-24 10:38:58 +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.

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