Tuesday, September 25, 2012

Auto FTP transfer in shell script

Credit to Sim Wei Chieh

How to create shell script to auto ftp transfer

Objective:
- Create a new folder each time perform ftp transfer to target server with a set of files through wildcard.

Here is the code for autoftp.sh:

Time=$(date +"%F_%HH%MM%SS")
ftp -n <        open
        user
        binary
        prompt
        cd /home//
        mkdir timeoutput_top_error_log_$Time
        cd timeoutput_top_error_log_$Time
        lcd /root
        mput setoffilenames*
        bye
EOF



Monday, September 24, 2012

ATCA Tester (Polaris)

How to run ATCA tester from Polaris - targeting ShMC (shelf manager)


Installation:
Follow the readme.txt guide from the atcatester package.



Run atcatester for ShMC Steps:
1. Flash firmware into both CMMs in Chassis.
2. Configure Shelf Managers IP address and submask need to be 255.255.255.0 (if using 255.255.0.0, test script is not possible to able to run it, refer troubleshoot section) *Ensure server IP subnetmask is the same.
3. Disable password needed for Shelf Managers access on Active Shelf Manager
4. Verify the password is not need has been configured.
5. Goto server where atcatester installed.
6. Run atcatester test cases as below (example): (highlighted in red is the test case ID from atcatester)
    - esoatcatester -u root -v -c shmctest 128.0.1.78 308


Troubleshoot:
This is what happen when IP subnetmask is 255.255.0.0
$ esoatcatester -u root -v -c shmctest 128.0.1.78 309
* Log into atca_tester_logs/2012_03_27_12_25_50
* Initializing session (128.0.1.78:623)...
* Transport error: Request timed out (NetFn:0x06 Cmd:0x38 Resp:0x20 - GetChannelAuthCapabilities)

List of ShMC test cases:
$ esoatcatester list shmctest
--- Basic ATCA & IPMI requirements test package ---
--- LEDs requirements test package ---
--- Sensors test package ---
--- Shelf Manager and Shelf test package ---
        300 - Address Table presence and Get Address Info command (ShMC Test)
        301 - Get/Set Shelf Address Info commands (Interactive)(ShMC Test)
        302 - SEL Device (ShMC Test)
        303 - SDR Repository (ShMC Test)
        304 - SDR Repository storage (ShMC Test)
        305 - Temperature Thresholds Crossing (single board,correct order) (ShMC Test)
        306 - Temperature Thresholds Crossing (single board,incorrect order) (ShMC Test)
        307 - Temperature Thresholds Crossing (multi-board) (ShMC Test)
        308 - Temperature Thresholds Crossing (power down/extract board) (Interactive)(ShMC Test)
        312 - Board communication lost/recovered (Interactive)(ShMC Test)
        313 - Board extracted/replaced when communication lost/recovered (Interactive)(ShMC Test)
        315 - Shelf Manager IPMB Address (Interactive)(ShMC Test)
        322 - Temperature Thresholds Crossing (communication lost) (Interactive)(ShMC Test)
        323 - Temperature Thresholds Crossing (multiple power levels) (ShMC Test)
        324 - FRU Inventory Device Lock/Write commands (Interactive)(ShMC Test)
        325 - Insufficient power budget (Interactive)(ShMC Test)
        326 - Shelf Manager Controlled Activation (Interactive)(ShMC Test)
        327 - Shelf Manager Controlled Deactivation (Interactive)(ShMC Test)
--- IPMB related test package ---
        400 - IPMB reliability (w/o an ATCA board) (ShMC Test)
        404 - IPMB hang detection and recovery (IPMB errors on bus) (Interactive)(ShMC Test)
--- RMCP interface requirements test package ---
--- MMC and Carrier IPMC test package ---
--- Description test package ---
        701 - Active Shelf Manager Description (ShMC Test)
---  HPM Tests (IPMC)  ---
---  HPM Tests (MMC)  ---

Below are the help from ATCA tester (to know what others test atcatester can executed on):
Usage: esoatcatester [OPTIONS]... test (ipmc[/frus][:testseq][_sensors])+
       esoatcatester [OPTIONS]... carriertest (ipmc[:testseq][_sensors])+
       esoatcatester [OPTIONS]... mmctest mmc@ipmc[:testseq][_sensors]
       esoatcatester [OPTIONS]... shmctest [testseq]
       esoatcatester [OPTIONS]... shelftest [testseq]
       esoatcatester [OPTIONS]... nettest [testseq]
       esoatcatester [OPTIONS]... list [mode] [testseq]

   hostname: Shelf Manager hostname or IP address.

   testseq: A comma separated list of test numbers
       or test ranges (without any blank character),
       optionnaly followed by a 'not' clause
       (e.g. 1-7,10not2,4-5 is equivalent to tests 1,3,6,7,10).
       Note that 'not10' means all tests except test #10.
       testseq is altered by -i and -I options.
       If no testseq is specified, all possible tests are
       selected according to the given command.

   COMMANDS:

   test (ipmc[/frus][:testseq][_sensors])+
       execute IPMC and FRU test(s).

       ipmc is the IPMB address (in hexadecimal e.g. 0x82
       or 82 mean 0x82) of the IPMC to test.

       frus is a comma separated list of FRUs or FRUs ranges on which
       FRU tests are executed. Non-FRU (IPMC) tests are executed only
       if frus contains '0'. If no frus is specified then '0'
       is added to frus. If frus is equal to 255, then tests
       are executed on all FRUs present on the IPMC.
       Note that frus is subject to the same rules as testseq.

       Instead of ipmc/frus syntax, it is possible to select the FRU to test
       with a character string containing a site type among [board,
       shmc, pem, shelffru, fan, fanfilter, alarm] followed by a
       site number (in decimal e.g. board1, shmc2, fan3, etc...).

       sensors is a comma separated list of sensors numbers
       (in hexadecimal e.g. 0x10 or 10 mean 0x10) or sensors ranges
       on which sensors tests are executed.

   hpmtest ipmc[:testseq]
       execute HPM (IPMC) test(s).

       ipmc is the IPMB address (in hexadecimal e.g. 0x82
       or 82 mean 0x82) of the IPMC to test.

   hpmmmctest mmc@ipmc[:testseq]
       execute HPM (MMC) test(s).

       mmc is the IPMB-L address of the MMC to test.
       ipmc is the IPMB address of the Carrier hosting the Module.

   carriertest (ipmc[:testseq][_sensors])+
       execute Carrier IPMC, IPMC and FRU test(s).

       ipmc is the IPMB address (in hexadecimal e.g. 0x82
       or 82 mean 0x82) of the Carrier IPMC to test.

       Instead of ipmc syntax, it is possible to select the Carrier IPMC
       to test with a character string containing 'board'
       followed by a site number (in decimal e.g. board1, board14, etc...).

       sensors is a comma separated list of sensors numbers
       (in hexadecimal e.g. 0x10 or 10 mean 0x10) or sensors ranges
       on which sensors tests are executed.

   mmctest mmc@ipmc[:testseq]
       execute MMC test(s).

       mmc is the IPMB-L address of the MMC to test.
       ipmc is the IPMB address of the Carrier hosting the Module.

       Instead of mmc syntax, it is possible to select the MMC
       to test with a character string containing 'amcsite'
       followed by a site number (in decimal e.g. amcsite3)

       Instead of ipmc syntax, it is possible to select the Carrier hosting
       the Module to test with a character string containing 'board'
       followed by a site number (in decimal e.g. board1, board14, etc...).

       Using this syntax, "amcsite6@board3" will select MMC located
       on AMC Module plugged in AMC site #6 of Carrier Board in slot #3.

   shmctest [testseq]
       execute Shelf Manager test(s).

   shelftest [testseq]
       execute Shelf test(s).

   nettest [testseq]
       execute Network test(s).

   list [mode] [testseq]
       list all available test scripts.
       mode is a test filter among [test, carriertest, mmctest, shmctest, shelftest, nettest].
       If no mode is specified, list all tests according to given options.
       testseq is an optional test list that will act as a filter as well.
       Note that only -i, -I, -c and -C  options are meaningful for this command
       (see below for options).

   OPTIONS:

      -p, --port=PORT             connect to port PORT (Default is 623)
      -a, --authentication=METHOD use authentication METHOD (Default is 0)
                                  (0=None, 1=MD2, 2=MD5, 4=Straight)
      -u, --user=USER             use USER as login (Default is "")
      -w, --passwd=PASSWD         use PASSWD to login (Default is "")
      -b, --autodeact             set this flag to indicate that ShMC
                                  auto deactivates FRU in M5 (Default is not set)
      -v, --verbose               enable verbose mode
      -q, --quiet                 if set, no messages are displayed on stdout during
                                  the test session. However, logs are still available.
      -Q, --almostquiet           like --quiet except that only log directory is displayed on stdout.
                                  Note that if -Q is set, -q has no effect.
      -f, --restorefrus           if set, FRUs initial hotswap state is restored
                                  at the end of the test session.
      -o, --nopresence            Do not check MMC/IPMC/FRU presence before starting the tests.
      -k, --check=CHECK           check commands responses (Hexadecimal number representing 4 bits)
                                  (Bit 0: check PICMG defined commands exact response length)
                                  (Bit 1: check IPMI  defined commands exact response length)
                                  (Bit 2: check PICMG defined commands reserved bits and fields)
                                  (Bit 3: check IPMI  defined commands reserved bits and fields)
                                  (Default is 7: Bit 0,1,2 = 1 and Bit 3 = 0)
      -l, --log=DIR               test log files directory will be created
                                  in subdir DIR (Default is "atca_tester_logs")
                                  of the log files root path - see ATCA_TESTER_LOGS_PATH
                                  environment variable description below.
      -n, --runs=#RUNS            number of test runs to execute (Default is 1)
      -s, --stop=LEVEL            stop on error depending on LEVEL (Default is 0)
                                  (0=don't stop, 1=stop on error, 2=stop on error or warning,
                                   3=stop on error, warning or info)
      -r, --random                shuffle test sequence before each run
      -i, --interactive           if set, select only interactive tests
                                  (Mutually exclusive with -I).
      -I, --nointeractive         if set, select only non interactive tests
                                  (Mutually exclusive with -i).
      -c, --nologcolor            if set, strip colors from log file.
      -C, --nocolor               if set, strip colors from log file and from stdout.
          --version               print version and exit.
      -x, --xmlfile=FILE          use XML FILE for Description test.
      -h, --help                  print this page.

  TIMEOUT OPTION:

 -t, --timeout   Timeout in seconds for the responses to come from the DUT.

  MINISCOPE OPTION:

      -H, --minihost              IP address or Host name of your PC where miniscope is running.
      -P, --miniport    Port of your PC at which miniscope is running.

   ENVIRONMENT VARIABLES:

      ATCA_TESTER_LOGS_PATH
             Log files root path. If not defined, defaults to current working
             directory. Subdir defined by --log option described above will
             be appended to it.


How to run Passmark Software (CPU benchmarks)

How to run Passmark Software (CPU benchmarks)

Installation
1. Acquire CPU benchmarks software (burnintest) in gz form.
burnintest_2.1.tar.gz

2. Extract the gz file.

Licence key setup
Register test tool licence key:

1. Goto burnintest folder and execute "./burnintest.sh" to identify your Linux system is running on 32-bits or 64-bits system.
2. Change directory to 32bit or 64bit.
3. Register license key in command prompt (console), copy your license key.dat to current directory and execute ./bit_cmd_line_x32 -k

How to configure type of testing we want to run:
1. Goto ~/burnintest/64bits folder (for example)
2. Edit file cmdline_config.txt 
3. Variables to be edited as below:
    a. DutyCycles
    b. Type of testing you needed
 
A. DutyCycles section
i. If you need to run the test for 60 mins, update as "AutoStopMinutes 60". If you need the test run for infinate time, update as "AutoStopMinutes 0"
ii. If you want the test stop after 100 cycles, update as "AutoStopCycles 100". If you need the test run for infinate cycles, update as "AutoStopCycles 0".
iii. You can define load of each test for CPU, CDDVD, Memory, serial, etc.
 
B. Type of testing you needed. (by default, CPU test, Memory test and Network test are turn ON)
i. If you want to disable CPU test, comment out with "#" from "#" section to "#".
ii. If you want to disable Memory test, comment out with "#" from "#" to "#"
iii. If you want to disable Network test, comment out with "#" from "#" to "#
iv. If you need to run Network test, default IP is loop back IP 127.0.0.1, please change to your target IP.
 
How to run Passmark in console (command prompt):
1. Goto ~/burnintest/64bits or ~/burnintest/32bits
2. Execute ./bit_cmd_line_x64 or ./bit_cmd_line_x32 after configure "cmdline_config.txt"

Other helpful link: