Tools for evaluating a CSIP Aus server implementation via a virtual client
Project description
CACTUS Client
This is a set of tools for evaluating CSIP-Aus server test procedures defined at CACTUS Test Definitions.
Development
pip install -e .[dev,test]
Quickstart
Installing
CACTUS requires Python 3.12+
Install the latest version from pypi with:
pip install cactus-client
If you're looking to update to the latest version:
pip install --upgrade cactus-client
To ensure it's installed properly
cactus --help
Working Directory Configuration
CACTUS requires two things:
- A configuration file - stored either in your home directory or elsewhere (will be created below).
- A working directory - Where all run outputs will be stored.
Portable Installation
If you're trying to keep CACTUS to a single working directory (and want all of your CACTUS operations to run out of that working directory):
- Create a new empty directory (eg
mkdir cactus-wd) cd cactus-wdcactus setup -l .
Please note - all CACTUS commands will now require you to operate out of the ./cactus-wd/ directory
cd cactus-wdcactus server
Global Installation
If you'd like your CACTUS commands to work from any directory (but still have the results all stored in the working directory):
- Create a new empty directory (eg
mkdir cactus-wd) cactus setup -g cactus-wdcactus server
Client/Server Config
Setup the server connections details (dcap refers to your DeviceCapability URI)
cactus server dcap https://your.server/dcapcactus server verify truecactus server serca path/to/serca.pemcactus server notification https://cactus.cecs.anu.edu.au/client-notifications/- Please note - this will utilise the shared, ANU hosted client-notifications service
- If you wish to self host - please see client-notifications
Setup your first client - You will be prompted to populate each field (like below)
cactus client myclient1You should see output like the following
Would you like to create a new client with id 'myclient1' [y/n]: y
What sort of client will this act as? [device/aggregator]: device
File path to PEM encoded client certificate: ./testdevice.crt
File path to PEM encoded client key: ./testdevice.key.decrypt
Auto calculate lfdi/sfdi from certificate? [y/n]: y
lfdi=0F3078CFDDAEE28DC20B95635DC116CC2A6D877F
sfdi=40773583337
Client Private Enterprise Number (PEN) (used for mrid generation): 12345
Client PIN (used for matching EndDevice.Registration): 111115
The DERSetting.setMaxW and DERCapability.rtgMaxW value to use (in Watts): 5000
.cactus.yaml has been updated with a new client.
myclient1
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ key ┃ value ┃
┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ type │ device │
│ certificate_file │ ./testdevice.crt ✓ │
│ key_file │ ./testdevice.key.decrypt ✓ │
│ lfdi │ 0F3078CFDDAEE28DC20B95635DC116CC2A6D877F │
│ sfdi │ 40773583337 │
│ max_watts │ 5000 │
│ pen │ 12345 │
│ pin │ 111115 │
│ user_agent │ null │
└──────────────────┴───────────────────────────────────────────────┘
To update individual client settings (eg to add a User-Agent header to requests) just specify the parameter to update and new value:
cactus client myclient1 user_agent "cactus client myclient1"
Discovering available tests
The command cactus tests will print out all available test cases...
Available Test Procedures
┏━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Id ┃ Category ┃ Description ┃ Required Clients ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ S-ALL-01 │ Registration │ Discovery with Out-Of-Band registration │ 1 client(s) with type(s): any │
│ S-ALL-02 │ Registration │ Discovery with In-Band Registration for Direct Clients │ 1 client(s) with type(s): device │
...
Running your first test
The following command will run the S-ALL-01 test with the client you created earlier cactus run S-ALL-01 myclient1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cactus_client-0.0.16.tar.gz.
File metadata
- Download URL: cactus_client-0.0.16.tar.gz
- Upload date:
- Size: 125.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14b6efdd8711dc6ad0e37a32dcb892af3b1b731d641a4bc5c7b5ed7c18004b31
|
|
| MD5 |
a3a4db28713abc8b7940202d43d2c98f
|
|
| BLAKE2b-256 |
24bb713c915e28c8a7324c59f578bfd0a08a70b832ac171fe1b3d22dac1505ff
|
File details
Details for the file cactus_client-0.0.16-py3-none-any.whl.
File metadata
- Download URL: cactus_client-0.0.16-py3-none-any.whl
- Upload date:
- Size: 148.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f95a5cd62c1fc542ab46c431ecaa914bbdac86b4bc571ddab9d44803b8a28cd
|
|
| MD5 |
42f891caecb520cebce96d2a3d11946c
|
|
| BLAKE2b-256 |
1884fd9032f4a6d483214b563457ce82b5351e24468ecec5cad00530c8bbe5db
|