clixon/test
Olof hagsand 19e21be0bc Very large commit for upcoming 4.4 release
Major New features

* New and updated search functions using xpath, api-path and instance-id
  * New search functions using api-path and instance_id:
    * C search functions: `clixon_find_instance_id()` and `clixon_find_api_path()`
  * Binary search optimization in lists for indexed leafs in all three formats.
    * This improves search performance to O(logN) which is drastical improvements for large lists.
  * You can also register explicit indexes for making binary search (not only list keys)
  * For more info, see docs at [paths](https://clixon-docs.readthedocs.io/en/latest/paths.html) and
[search](https://clixon-docs.readthedocs.io/en/latest/xml.html#searching-in-xml)

API changes on existing features (you may need to change your code)
* On failed validation of leafrefs, error message changed from: `No such leaf` to `No leaf <name> matching path <path>`.
* CLI Error message (clicon_rpc_generate_error()) changed when backend returns netconf error to be more descriptive:
  * Original: `Config error: Validate failed. Edit and try again or discard changes: Invalid argument`
  * New (example): `Netconf error: application operation-failed Identityref validation failed, undefined not derived from acl-base . Validate failed. Edit and try again or discard changes"

Minor changes

* Test framework
  * Added `-- -S <file>` command-line to main example to be able to return any state to main example.
  * Added `test/cicd` test scripts for running on a set of other hosts
* C-code restructuring
  * clixon_yang.c partitioned and moved code into clixon_yang_parse_lib.c and clixon_yang_module.c and move back some code from clixon_yang_type.c.
    * partly to reduce size, but most important to limit code that accesses internal yang structures, only clixon_yang.c does this now.
2020-02-02 15:52:30 +01:00
..
cicd Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
jenkins Added make test and travis experiment 2019-02-04 14:13:20 +01:00
travis Travis container tests 2019-02-11 16:10:43 +01:00
all.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
jukebox.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
lib.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
long.sh test script minor modifications 2019-10-20 21:11:13 +02:00
Makefile.in Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
mem.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
nacm.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
plot_perf.sh test script minor modifications 2019-10-20 21:11:13 +02:00
README.md Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
sum.sh moved initial hello request from client to backend to immediate before first actual query 2019-10-27 10:24:13 +01:00
test_api.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_api_path.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_augment.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_choice.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_cli.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_cli_apipath.sh * Created two sub-files (clixon_validate.c and clixon_api_path.c) from large lib/src/clixon_xml_map.c source file. 2020-01-01 11:12:54 +01:00
test_cli_history.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_cli_multikey.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
test_cli_submodes.sh * Bumped version to 4.3.0.PRE 2019-11-03 13:05:50 +01:00
test_copy_config.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_datastore.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_feature.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_identity.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_insert.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_install.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_instance_id.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_json.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_leafref.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_leafref_augment.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_leafref_state.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_minmax.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_nacm.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_nacm_credentials.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_nacm_default.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_nacm_ext.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_nacm_module_read.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_nacm_module_write.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_nacm_protocol.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_netconf.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_netconf_filter.sh [filter in netconf - one specific entry #100](https://github.com/clicon/clixon/issues/100) 2019-12-07 18:10:19 +01:00
test_openconfig.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_order.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_pattern.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_perf.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_perf_startup.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_perf_state.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_perf_xml.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_privileges.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_restconf.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_restconf2.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_restconf_err.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_restconf_jukebox.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_restconf_listkey.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_restconf_patch.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_restconf_startup.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_rpc.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_sock.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_startup.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_stream.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_submodule.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_transaction.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_type.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_type_range.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_union.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_unique.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_upgrade.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
test_upgrade_auto.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_upgrade_interfaces.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_upgrade_repair.sh test kill valgrind process after run 2019-12-09 21:12:39 +01:00
test_when_must.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_with_default.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_xml.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_xpath.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_xpath_canonical.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_yang.sh test env bash; freebsd config 2019-09-17 22:44:01 +02:00
test_yang_extension.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_yang_load.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_yang_models.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
test_yang_namespace.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +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

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:

  • RCWAIT 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                  # All components
  mem.sh restconf backend # Only backend and cli

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