LogoLogo
qoitech.com
  • Welcome
  • Otii PRODUCT SUITE
    • Overview
      • What’s included
    • Otii hardware
      • Otii Arc Pro
      • Otii Ace Pro
    • Otii software
      • Otii 3 Desktop App
      • Otii Toolbox
        • Otii Battery Toolbox [BT]
        • Otii Automation Toolbox [AT]
  • Otii SETUP
    • Connecting Otii hardware
      • Otii hardware overview
        • Otii Arc Pro overview
        • Otii Ace Pro overview
      • Wiring up
        • Expansion Port
        • Measuring DUT
        • Measuring a subsystem
        • External power source
        • Capture UART logs
    • Installing Otii software
      • Windows 10/11 setup
      • macOS setup
      • Ubuntu setup
      • Raspberry Pi setup
    • Getting started
      • Account & licensing
        • Activation & Licensing
        • Managing Licenses
      • User interface overview
        • Main window layout
        • Keyboard navigation
      • Support resources
  • Otii 3
    • Settings overview
    • Working with projects
      • Project storage
      • Create a new project
      • Save & open a project
      • Import an Otii 2.0 project
      • Export recordings as CSV
    • Control
      • Otii Arc/Ace setup
      • General settings
      • Channels
      • UART
      • Firmware management
      • Calibration
    • Recordings
      • Recording management
      • Recording tools
      • Recording viewers
        • Analog
        • Digital
        • Log
    • Measurements
    • Battery life estimator
    • Otii Battery Toolbox
      • Battery emulation
      • Battery profiler
        • Getting started with battery profiling
      • Battery validation
      • Battery Model Parameters
    • Otii Automation Toolbox
      • Otii TCP Server
      • Otii 3 Desktop App
      • Otii Server
      • User management
    • Additional features
      • User management
      • Show monitor
      • Notifications
    • Online account manager
  • Advanced guides
    • Python scripting
    • C# scripting
    • Jenkins integration
  • HELP & FAQ
    • FAQ
      • Otii Arc Pro
      • Otii Ace Pro
    • Revision history
  • Legal information
    • Product safety
    • Liability disclaimer
Powered by GitBook
On this page
  • User management | Desktop application
  • User management | In test script
  • User management | Python tool

Was this helpful?

Export as PDF
  1. Otii 3
  2. Otii Automation Toolbox

User management

PreviousOtii ServerNextAdditional features

Last updated 6 months ago

Was this helpful?

User management | Desktop application

Read more about logging in and reserving licenses in the Otii 3 Desktop App here:

User management | In test script

It is possible to use the TCP-API directly in the test script for user management:

#!/usr/bin/env python3
'''
If you want the script to login and reserve a license automatically
add a configuration file called credentials.json in the current folder
using the following format:

    {
        "username": "YOUR USERNAME",
        "password": "YOUR PASSWORD"
    }

Alternatively you can set the environment variables OTII_USERNAME and OTII_PASSWORD.

'''
from otii_tcp_client import otii_client

# Connect and login to Otii 3
client = otii_client.OtiiClient()
with client.connect() as otii:
    # INSERT TEST CODE HERE

The client.connect() is used to connect, login and reserve licenses. It works like this:

  • If the TCP server isn't already logged in, the credentials will be read from a credentials.json file in the current directory, or from the environment variable OTII_USERNAME and OTII_PASSWORD.

  • If there is no Automation Toolbox license reserved and there is a license available, it will automatically be reserved.

  • By default the system will only try to reserve an Automation Toolbox license. If you need to reserve another Toolbox as well add all the licenses you need to the licensesparameter:

client.connect(licenses = [ 'Automation', 'Battery' ])
  • When disconnecting from Otii all licenses that were implicitly reserved will be returned, and if the connect method logged in to the system, it will log out again.

  • If you want to manually reserve a specific license, you use an empty array for the licenses parameter:

#!/usr/bin/env python3
from otii_tcp_client import otii_client

# Connect and login to Otii 3
client = otii_client.OtiiClient()
with client.connect(licenses = []) as otii:
    # List all licenses
    licenses = otii.get_licenses()
    for license in licenses:
        print(f'{license["id"]:4d} {license["type"]:12} {license["reserved_to"]:15} {license["hostname"]}')

    # Reserve a license
    otii.reserve_license(licenses[0])

    # INSERT TEST CODE HERE

    # Return license
    otii.return_license(licenses[0])

User management | Python tool

You can do the user management from the command line using our python module. You install the module with:

python3 -m pip install otii_tcp_client

You can then use the otii_control tool for user management:

python3 -m otii_tcp_client.otii_control --help

usage: otii_control.py [-h] {login,logout,list-licenses,reserve-license,return-license} ...

Otii Control

options:
  -h, --help            show this help message and exit

commands:
  {login,logout,list-licenses,reserve-license,return-license}
    login               Log in to Qoitech server
    logout              Log out from Qoitech server
    list-licenses       List all available licenses
    reserve-license     Reserve license
    return-license      Return license

And here is an example bash script:

#!/usr/bin/env bash

python3 -m otii_tcp_client.otii_control login --username johndoe --password mypassword
python3 -m otii_tcp_client.otii_control reserve-license --id 1234
./my_test.py
python3 -m otii_tcp_client.otii_control return-license --id 1234
python3 -m otii_tcp_client.otii_control logout
User management