10. Command line interface testing

To test in: Command line interface

Purpose of the test is to check the general CLI functionality

[Updated for 4.3.2]

Pre-requisites for this test:

Run the following as root user from python dist/bin/omero to setup a new user account and group

  • omero login -s $OMERO_HOST -p $ROUTER -u root -w ome

  • omero group add web_group –perms=rwrw– | | echo “Web Group already exists?”

  • omero user add web_user Web User web_group –userpassword abc | | echo “Web User already exists?”

  • omero logout

  • omero config set omero.web.database_engine ‘sqlite3’

  • omero config set omero.web.server_list ‘’$OMERO_HOST’”, ‘$ROUTER’, “omero?’

  • omero config set omero.web.debug True

  • omero web unittest –config=$ICE_CONFIG –test=webadmin

Confirmation of the technical setup

  • bin/omero config set omero.web.database_engine sqlite3

  • $ bin/omero web unittest –test=webadmin –config=[Ice location] ice.config

  • PATH to ice.config

  • OMERO/dist/ice.config

Command line tests

  1. Move to

    • cd omero

    • bin/omero -h

  2. Config test

    • $ bin/omero config def

    • Returns = default

    • $ bin/omero config get

    • Returns =

    • $ bin/omero config set example “my first value”

    • $ bin/omero config get

    • Returns = example=my first value

  3. User Test

    • $ bin/omero import

    • testing the full set of option with bin/omero user these are:

      • add

      • list

      • password

  4. Web cmd test

    • For each test run bin/omero web with the additional command.

    • Start - the OMERO.web server

    • Run the command status and confirm the status of the web server has started.

    • Run the command config and confirm a output config template for server

    • Run the command gateway and execute the code below (See omerodoc:PythonClientBeginners <developers/Python.html> for additional information.)

      from omero.gateway import BlitzGateway
      conn = BlitzGateway("USER", "PASSWORD", host="SERVER_YOU_WANT_TO_TEST", port=4064)
      conn.connect()
      for p in conn.listProjects(
          print p.getName()
          for dataset in p.listChildren(
              print "  ", dataset.getName()
      
    • Run the command stop

    • Run the command config and confirm the status of the web server has stopped.

  5. Shell cmd test

    • Run bin/omero shell to start IPython

    • ensure IPython starts.

    • Once in execute the following commands ensuring they return the correct information.

      • import Ice

      • import omero

      • omero.model.ImageI() [This command imports an image]

      • client.sf.getAdminContext().getEventContext() [The expected output of this command is the return of the current login info]

  6. Group cmd test

    • For each test run bin/omero group with the additional command.

    • Run the command add private cmdtest

    • Run the command list and view the current groups

    • Run the command insert and ensure the user is added to the group