GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — clixon-controller/test at main · clicon/clixon-controller

Expand file tree

/

test

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

test

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
all.sh
all.sh
 
 
cert-devices.sh
cert-devices.sh
 
 
change-devices.sh
change-devices.sh
 
 
config.sh.in
config.sh.in
 
 
containers.sh
containers.sh
 
 
copy-keys.sh
copy-keys.sh
 
 
lib.sh
lib.sh
 
 
mem.sh
mem.sh
 
 
nacm.sh
nacm.sh
 
 
reset-controller.sh
reset-controller.sh
 
 
reset-devices.sh
reset-devices.sh
 
 
restart-devices.sh
restart-devices.sh
 
 
start-devices.sh
start-devices.sh
 
 
stop-devices.sh
stop-devices.sh
 
 
sum.sh
sum.sh
 
 
test-c-editconfig.sh
test-c-editconfig.sh
 
 
test-c-service.sh
test-c-service.sh
 
 
test-c-simulated.sh
test-c-simulated.sh
 
 
test-change-both.sh
test-change-both.sh
 
 
test-change-ctrl-push.sh
test-change-ctrl-push.sh
 
 
test-change-device-diff.sh
test-change-device-diff.sh
 
 
test-cli-edit-config.sh
test-cli-edit-config.sh
 
 
test-cli-edit-multiple.sh
test-cli-edit-multiple.sh
 
 
test-cli-order.sh
test-cli-order.sh
 
 
test-cli-show-config.sh
test-cli-show-config.sh
 
 
test-commit-closed-devices.sh
test-commit-closed-devices.sh
 
 
test-commit-lock-fail.sh
test-commit-lock-fail.sh
 
 
test-commit-no-services.sh
test-commit-no-services.sh
 
 
test-commit-validate-fail-local.sh
test-commit-validate-fail-local.sh
 
 
test-connect-local.sh
test-connect-local.sh
 
 
test-connect-timeout-error.sh
test-connect-timeout-error.sh
 
 
test-connect.sh
test-connect.sh
 
 
test-controller-privcand.sh
test-controller-privcand.sh
 
 
test-dead-connection-fast-fail.sh
test-dead-connection-fast-fail.sh
 
 
test-device-groups.sh
test-device-groups.sh
 
 
test-device-rpc.sh
test-device-rpc.sh
 
 
test-device-state.sh
test-device-state.sh
 
 
test-get-device-schema.sh
test-get-device-schema.sh
 
 
test-ignore.sh
test-ignore.sh
 
 
test-local-commit.sh
test-local-commit.sh
 
 
test-lock-devices.sh
test-lock-devices.sh
 
 
test-lock-exclusive.sh
test-lock-exclusive.sh
 
 
test-nacm-autocli.sh
test-nacm-autocli.sh
 
 
test-nacm-restconf.sh
test-nacm-restconf.sh
 
 
test-nacm.sh
test-nacm.sh
 
 
test-pull-timeout-revert.sh
test-pull-timeout-revert.sh
 
 
test-push-close.sh
test-push-close.sh
 
 
test-python-mini.sh
test-python-mini.sh
 
 
test-python-service.sh
test-python-service.sh
 
 
test-restconf.sh
test-restconf.sh
 
 
test-service-lock.sh
test-service-lock.sh
 
 
test-template.sh
test-template.sh
 
 
test-transaction.sh
test-transaction.sh
 
 
test-yang-domain.sh
test-yang-domain.sh
 
 
test-yang-lib.sh
test-yang-lib.sh
 
 
valgrind-clixon.supp
valgrind-clixon.supp
 
 

README.md

Outline

Clixon controller test directory

Docker

You can run the tests via top-level make test which sets up all in a container. This is also done by github actions regression tests.

Native

You can also run test natively, in which case you need to set up some things manually

Native prerequisites

You need to install the following:

  • cligen
    • bison
    • flex
  • clixon
  • clixon-util
  • clixon-pyapi
  • curl
  • expect
  • docker

Devices

Create site.sh, for example:

IMG=openconfig
USER=noc
HOMEDIR=/home/noc
nr=2
sleep=2

Start device containers. Default is clixon/clixon-example but you can also start clixon/openconfig:

    ./start-devices.sh

If run natively, the controller runs as root, and a root public key needs to be installed in the clixon-example containers:

    sudo ./copy-keys.sh

Bind the CONTAINERS env variable to the IP:s of the clixon-example containers, either manually or for example:

    echo "CONTAINERS=\"$(IMG=openconfig ./containers.sh)\"" >> ./site.sh
    ./sum.sh

To stop the device containers:

    ./stop-devices.sh

SSH certs

There is some support for SSH certs when testing natively. Instead of start-devices.sh and copy-keys-sh do:

    ./cert-devices.sh

and in site.sh:

   SSHID="-i <dir>/user-key"

Also, one needs to change the root identityfile, either directly in /root/.ssh or:

   <CONTROLLER_SSH_IDENTITYFILE xmlns="http://clicon.org/controller-config"><dir>/root-key</CONTROLLER_SSH_IDENTITYFILE>

Tests

  • test-change-both.sh Change config on device and check diff
  • test-change-ctrl-push.sh Change device config on controller and push to devices
  • test-change-device-diff.sh Change config on device and check diff
  • test-cli-edit-config.sh CLI set/show
  • test-cli-edit-multiple.sh CLI set/delete using glob '*'
  • test-cli-show-config.sh CLI show config tests
  • test-local-commit.sh Connect/commit/push
  • test-service.sh Non pyapi service test
  • test-yanglib.sh Test RFC8528 YANG Schema Mount state

Tests names without cli indicates a netconf test.

Support scripts. Can either be run individually, or are used by the main test- scripts

  • all.sh Verbosely run all tests, stop on error, use pattern= ./all.sh for subset
  • sum.sh Summary tests, continue on error
  • lib.sh Support script, all tests include this
  • containers.sh Get IP addresses of all started clixon-example containers
  • copy-keys.sh Copy user or root public rsa key to clixon-example containers
  • reset-controller.sh Reset controller by initiating with clixon-example devices and a sync pull
  • start-devices.sh Stop/start clixon-example container devices, initiate with x=11, y=22
  • stop-devices.sh Stop clixon-example container devices
  • reset-devices.sh Initiate clixon-example devices with config x=11, y=22
  • change-devices.sh Change device config: Remove x, change y, and add z

Modifiers

The following modifiers apply to some tests:

  • nr= Number of devices
  • nrif= Number of configured interfaces (size of datastore). 2 is min
  • BE=false Do not start backend in script, start backend externally instead, ie in a debugger (init-controller.sh only)
  • push=false Only change dont sync push (change-push.sh only)
  • sleep=<s> Sleep s seconds instead of 2 (all)
  • PREFIX=sudo Generate keys for root (device scripts only)

RESTCONF

To test with fcgi restconf:

  • Configure clixon: ./configure --with-restconf=fcgi
  • In controller test/config.sh.in: WITH_RESTCONF=fcgi HAVE_LIBNGHTTP2=false
  • Re-configure: ./config.status

To test with native restconf:

  • Configure clixon: ./configure
  • In controller test/config.sh.in: WITH_RESTCONF=native HAVE_LIBNGHTTP2=true
  • Re-configure: ./config.status
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.