Difference: AMCTPythonSoftware (9 vs. 10)

Revision 1017 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

General Explanations

Changed:
<
<
The goal is to develop a set of routines to automatically (i.e. without human intervention) test AMC13 hardware using python language. Tests will exercise the functionality of the AMC13 card(s) and report errors/failures.
>
>
AMCT(AMCThirteen): The goal is to develop a set of routines to automatically (i.e. without human intervention) test AMC13 hardware using python language. Tests will exercise the functionality of the AMC13 card(s) and report errors/failures.
 The tool allows for a detailed testing of the AMC hardware in both supervised and non-supervised fashion and it is meant to be used as a part of the production and quality testing of the AMC13 hardware.

For python tool, typically you need to use `virtualenv` to create a separate python environment and install all dependencies. It creates a folder which contains all the necessary executables to use the packages that a Python project would need. Before starting, make sure you have 'pip' and 'virtualenv'. Use your favorite package manager to install them.

Line: 14 to 14
 

  • cd ~/amc13
Added:
>
>
  • svn co (code_link) (Note: AMCT tool is inside the dev_tool package)
 
  • make
  • source env.sh
Deleted:
<
<
  • svn co (code_link) (Note: AMCT tool is inside the dev_tool package)
 
Line: 29 to 29
 
  • pip install --upgrade pip
  • python setup.py develop
Changed:
<
<

Python 2.7 Installation to Virtualenv

>
>

Python 2.7.12 Installation to Virtualenv

 
Changed:
<
<
Inside the virtualenv you can also install python 2.7 version (it is better than 2.6) and use ipython (python 2.6 version does not support ipython). Here is the installation of python-2.7.12 version.
>
>
Inside the virtualenv you can also install python 2.7.12 version (it is better than 2.6.X version) and ipython (python 2.6 version does not support ipython). Here is the installation of python-2.7.12 version.
 
Line: 41 to 41
 
  • ./configure --prefix=/home/${USER}/.localpython
  • make
  • make install
Added:
>
>
  • export PATH=~/bin:~/python2.7/bin:~/vim/bin:$PATH
 
  • pip install ipython

Now you have python 2.7.12 and ipython in virtualenv.

Running the AMCT Tool

Added:
>
>
Before running the AMCT tool you can look at the help options:
> dev_tools]$ amct --help
Usage: amct [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --verbose
  -d, --debug
  -l, --log-level [INFO|DEBUG|WARNING|ERROR|CRITICAL]
  -c, --config PATH               Global configuration
  --version                       Show the version and exit.
  -h, --help                      Show this message and exit.

Commands:
  amctool    Utilities for testing AMC13 interactively.
  firmware   Operations for testing AMC13 firmware.
  testsuite  Run predefined test-suites against AMC13...
  AMCT tool executes all the AMC13Tool2 commands and run them using new scripting language, such as:

Added:
>
>
For example:
 
>amc.do('en 1-12 f t')
>amc.do('localL1A o 1') 

Line: 58 to 78
 >amc.do('re') #etc...
or
Changed:
<
<
  • amc.run('any AMC13Tool2_command') ##run=do (select your favorite one.)
>
>
  • amc.run('any AMC13Tool2_command') # run=do (select your favorite one.)
For example:
 
>amc.run('en 1-12 f t')
>amc.run('localL1A o 1') 

Line: 119 to 140
 >rdiff['STATUS.AMC01.COUNTERS.AMC13_AMC_EVENTS_LO'] : check diff of registers with/without trig.
Added:
>
>

Testing AMC13 Cards Using Scripted Mode

 
Added:
>
>
In this method you can run your commands inside the script that you prepared and can test the AMC13 cards. I have prepared an example which will test the event and time counter registers. This script will check the expected and observed values of the register(s) and compare the expected value with observed value. If the expected/observed values are equal test result will be OK. Here is the example of the script:
 
Added:
>
>
test1.pyamc : script to check some registers.
 
Added:
>
>
Tests are organized into testsuite. You can execute them against every AMC13 board like so:
 
Added:
>
>
  • cd dev_tools (note: dont forget to activate virtualenv)
 
Added:
>
>
amct --verbose testsuite run --name c01 -i 161/c

(SN =161 and c01: a folder that contain the test1.pyamc script)

 
Added:
>
>
--> If expected and observed values are the same then you will see below message:
INFO	13772 [08/17/2016 14:02:51]:	Testsuite c01 finished OK
 
Added:
>
>
--> If expected and observed values are different then you will see the message of the problematic register and its expected and observed values!
STATUS.SFP.SFP0.EVENTS_BUILT error, expected: 6, observed: 5
 
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback