clixon/test
2023-07-13 14:36:01 +02:00
..
cicd
fuzz Clixon 6.1 2023-02-19 11:35:37 +01:00
jenkins
mibs
vagrant
virtualbox
all.sh
clixon.png
config.sh.in New clixon-autocli.yang version with skip and alias extensions 2023-06-10 11:46:27 +02:00
example_social.sh
jukebox.sh
lib.sh Test: updated perf tests that have been broken for some time 2023-05-23 15:24:42 +02:00
long.sh
Makefile.in
mem.sh Preparations for 6.2.0 2023-04-29 16:23:54 +02:00
nacm.sh
plot_perf.sh Test: updated perf tests that have been broken for some time 2023-05-23 15:24:42 +02:00
README.md
site.sh
sum.sh
test_api.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_api_path.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_augment.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_augment_default.sh
test_augment_state.sh
test_augment_trans.sh
test_autocli_editmode.sh
test_autocli_extension.sh
test_autocli_listkey_compress.sh
test_autocli_obsolete.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_autocli_show.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_autocli_spec.sh
test_autocli_strict_expand.sh
test_autocli_sub.sh
test_autocli_treeref.sh
test_c++.sh Creator tagging for leafs, sort-modules: remove flag setting, yang_lib2yspec patch 2023-04-13 21:11:57 +02:00
test_choice.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_choice_recursive.sh
test_cli.sh
test_cli_apipath.sh
test_cli_duplicates.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_cli_expand.sh
test_cli_history.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_cli_leafref.sh
test_cli_multikey.sh
test_cli_pipe.sh Pipe function renaming 2023-07-13 14:36:01 +02:00
test_cli_rest.sh
test_cli_submodes.sh
test_cli_translate.sh
test_cli_union.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_cli_varonly.sh
test_client.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_configdir.sh
test_confirmed_commit.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_copy_config.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_datastore.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_datastore_format.sh
test_datastore_repair.sh
test_db.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_debug.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_default_choice.sh
test_dispatcher.sh
test_feature.sh test_feature: add test for external features 2023-04-30 17:34:30 +03:00
test_feature_startup.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_helloworld.sh
test_http_data.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_identity.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_insert.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_install.sh
test_instance_id.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_instance_id_multi.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_json.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_json_list.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_json_null.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_leaf_default.sh
test_leafref.sh
test_leafref_augment.sh
test_leafref_state.sh
test_leafref_union.sh
test_leafref_uses_augment.sh
test_minmax.sh
test_nacm.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_credentials.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_datanode.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_datanode_paths.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_datanode_read.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_datanode_write.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_default.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_ext.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_module_read.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_module_write.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_protocol.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_nacm_recovery.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_netconf.sh Unified netconf input function 2023-04-20 21:28:01 +02:00
test_netconf_filter.sh
test_netconf_framing.sh
test_netconf_hello.sh Unified netconf input function 2023-04-20 21:28:01 +02:00
test_netconf_monitoring.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_netconf_monitoring_location.sh
test_netconf_monitoring_multiple.sh
test_netconf_notifications.sh
test_netconf_ssh_callhome.sh
test_netconf_whitespace.sh
test_openconfig.sh
test_openconfig_interfaces.sh Test adaption to new openconfig version 2023-02-18 12:10:58 +01:00
test_openconfig_network_instance.sh
test_order.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_pagination_config.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_pagination_draft.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_pagination_expect.exp
test_pagination_state.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_pattern.sh
test_perf_cli.sh Test: updated perf tests that have been broken for some time 2023-05-23 15:24:42 +02:00
test_perf_json.sh Test: updated perf tests that have been broken for some time 2023-05-23 15:24:42 +02:00
test_perf_mem.sh * Restructured and extended <stats> rpc to schema mountpoints 2023-05-05 17:54:10 +02:00
test_perf_netconf.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_perf_restconf.sh Test: updated perf tests that have been broken for some time 2023-05-23 15:24:42 +02:00
test_perf_restconf_ssl.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_perf_startup.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_perf_state.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_perf_state_only.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_perf_xml.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_plugin_reset.sh
test_privileges.sh
test_refine.sh
test_restconf.sh Test: more curl error codes, new version in alpine? 2023-05-25 09:05:20 +02:00
test_restconf_basic_auth.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_callhome.sh
test_restconf_continue.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_err.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_http_upgrade.sh Test: more curl error codes, new version in alpine? 2023-05-25 09:05:20 +02:00
test_restconf_internal.sh Merge pull request #418 from kernelkit/kkit 2023-02-17 09:52:42 +01:00
test_restconf_internal_usecases.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_jukebox.sh Since 6.1 RESTCONF PUTs have added clixon-lib namespace for attributes. 2023-03-27 12:57:24 +02:00
test_restconf_listkey.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_netns.sh
test_restconf_nmap.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_noalpn.sh Test: re-fix magic line 2023-04-27 20:51:31 +02:00
test_restconf_notifications.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_op.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_plain_patch.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_ssl_certs.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_startup.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_yang_patch_json.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_restconf_yang_patch_xml.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_rpc.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_search_index.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_snmp_entity.sh
test_snmp_get.sh
test_snmp_ifmib.sh
test_snmp_rowstatus.sh
test_snmp_set.sh
test_snmp_system.sh
test_snmp_union.sh Fixed: [if-feature always negative if imported from another module](https://github.com/clicon/clixon/issues/429) 2023-05-05 17:54:10 +02:00
test_sock.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_startup.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_submodule.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_transaction.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_transaction_restart.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_type.sh
test_type_range.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_union.sh
test_unique.sh
test_unique_descendant.sh
test_upgrade_auto.sh
test_upgrade_checkold.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_upgrade_failsafe.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_upgrade_interfaces.sh
test_upgrade_interfaces_rfc7895.sh
test_upgrade_module.sh
test_upgrade_quit.sh
test_upgrade_repair.sh
test_upgrade_simple.sh
test_when_mandatory.sh
test_when_must.sh
test_with_default.sh
test_xml.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_xml_trees.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_xml_validate.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_xpath.sh * Fixed: [xpath // abbreviation does not work other than on the top-level](https://github.com/clicon/clixon/issues/435) 2023-06-21 11:45:49 +02:00
test_xpath_canonical.sh test fix breaking actions. Minor doc changes 2023-04-25 16:22:25 +02:00
test_xpath_functions.sh
test_xpath_inverse.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_yang.sh
test_yang_action.sh
test_yang_anydata.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_yang_bind.sh
test_yang_default.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_yang_deviation.sh
test_yang_extension.sh
test_yang_load.sh
test_yang_models_ieee.sh
test_yang_models_ietf.sh
test_yang_namespace.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_yang_schema_mount.sh Pipe function renaming 2023-07-13 14:36:01 +02:00
test_yang_wdcc.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
test_yang_when.sh
test_yang_with_defaults.sh Test: moved unsetting of vars to endtest 2023-02-15 13:59:21 +01:00
valgrind-clixon.supp

Clixon Test and CI

Overview

This directory contains Clixon test suites. Files directly under this directory called test_*.sh are part of the regression CI tests.

There are also sub-directories for various other tests:

  • cicd - Test scripts for running on remote hosts
  • fuzz - Fuzzing with american fuzzy lop
  • vagrant - Scripts for booting local vagrant hosts, installing clixon and running clixon tests

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.

Most scripts are bash scripts using standard awk/sed etc. There is also (at least one) expect script.

Note that some IETF yangs need to be available, by default these are in /usr/local//share/yang/standard. You can change this location with configure option --with-yang-standard-dir=DIR

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

Openconfig and Yang

To download the openconfig and yang models required for the tests:

   cd /usr/local/share/openconfig
   git clone https://github.com/openconfig/public
   cd /usr/local/share/yang
   git init
   git remote add -f origin https://github.com/YangModels/yang
   git config core.sparseCheckout true
   echo "standard/" >> .git/info/sparse-checkout
   echo "experimental/" >> .git/info/sparse-checkout
   git pull origin main

Continuous Integration

CI is done via github actions.

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.

You can prefix a test with RC=0 if you want to run your own restconf process.

You can prefix a test with SN=0 if you want to run your own SNMP process (in combination with BE=0)

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

Add a detailed error print of the first test that failed, if any:

  detail=true 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

TLS and http/2

With default configure options, most tests run http/2 and TLS by default. To pin tests to override this use the HVER and RCPROTO variables. Example:

HVER=1.1 RCPROTO=http ./test_restconf_plain_patch.sh

Some tests are pinned to certain settings and overriding will not will not work.

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

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 native with configure --with-restconf=http1, 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

SNMP

Clixon snmp frontend tests require a running netsnmpd and converted YANG files from MIB.

Netsnmpd is 5.9 or later and can be started via systemd. For the tests to run, the systems IFMIB should be disabled: -I -ifTable,ifNumber,ifXTable,, etc.

One way to start snmpd on Ubuntu, known to be working for the tests is:

snmpd -c /etc/snmp/snmpd.conf -Lo -p /var/run/snmpd.pid -I -ifXTable -I -ifTable -I -system_mib -I -sysORTable -I -snmpNotifyFilterTable -I -snmpNotifyTable -I -snmpNotifyFilterProfileTable

Converted YANG files are available at https://github.com/clicon/mib-yangs or alternatively use smidump version 0.5 or later. Clixon expects them to be at /usr/local/share/mib-yangs/ by default, or configured by --with-mib-generated-yang-dir=DIR.

You also need to configure a unix socket for agent. Example of /etc/snmp/snmpd.conf:

master  agentx
agentaddress  127.0.0.1,[::1]
rwcommunity     public  localhost
agentXSocket    unix:/var/run/snmp.sock
agentxperms     777 777

Known issues

Workaround: Unicode double-quote in iana-if-type@2022-03-07.yang