Test konfigurieren

Erstellt man über den SmartTester einen Test wird automatisch eine Vorlage der Testbeschreibung mit erstellt, diese kann wenn man den Test selektiert hat unter dem Reiter Test Description angeschaut werden.

Argumente die an den Test übergeben werden sollen, können unter dem Reiter Argumente festgelegt werden. Mit den Buttons New Argument und Delete last Argument können Eingabefelder für Argumente hinzugefügt oder entfernt werden. Die Eingegebenen Argumente werden erst aktiv nach dem man Sie mit dem Button SAVE Values abgespeichert hat. Die Argumente können dann mit folgenden Kommandos in das Script geladen werden:
Beispiel für Tickle:
set ip [lindex $argv 0]
Beispiel für Python:
import sys
ip = (sys.argv[1])
Beispiel für Batch:
set ip = %1


Die Testbeschreibung und den Code kann man unter dem Reiter Edit Code/Description bearbeiten. Damit der SmartTester die Testbeschreibung als solches erkennt muss sie muss sie mit START:description beginnen und mit END:description enden. Alles was zwischen diesen beiden Tags steht wird unter dem Reiter Test Description ausgegeben.

Beispiel für eine Testbeschreibung:

# START:description
#############################################################################################
#
#       Test case ID             : 001.SNMPv3_LoadTest (Correct SNMP Packet)
#
#       Purpose                  : This test verifies that the DUT works correctly while and
#                                  after sending a high load of SNMP packets to the DUT.
#
#
#       Requirements             : The test needs the following arguments:
#                                  Argument 0 = IXIA IP-Address (IP address with the IXIA
#                                               is accessible)
#                                  Argument 1 = IXIA Chassis (Define the used IXIA chassis here)
#                                  Argument 2 = IXIA Card (Define the used IXIA card here)
#                                  Argument 3 = IXIA Port (Define the used IXIA port here)
#                                  Argument 4 = Packets per seconds (Define the network load here)
#                                  Argument 5 = DUT Port MAC (Insert the port MAC address of the DUT here)
#                                  Argument 6 = DUT IP (Port IP of the DUT how is connected to the IXIA)
#                                  Argument 7 = Time of load (Define the time of load here)
#                                  Argument 8 = DUT IP (Management IP of the DUT sometimes
#                                               the same as in the Argument 6)" +
#                                  Argument 9 = Device which verifies the up status (Regarding
#                                               of the High load it is not possible to verify the
#                                               Sysuptime of the DUT hence there must an additional
#                                               device connected to the DUT, to verify the link status
#                                               of the Port which is connected to the DUT)
#                                  Argument 10 = Port which is connected to the DUT (The Port  
#                                                number of the additional device  which is
#                                                connected to the DUT)
#
#       Testsetup                :     ________________________________________________
#                                     |                                                |
#                                     |                                                |
#                                  [Test PC]------------------------[DUT]------------[IXIA]
#                                     |                               |
#                                     |                               |
#                                     |               [Device to verify the linkstatus]
#                                     |                               |
#                                     |_______________________________|
#
#
#       Steps                    : Insert the arguments and run the test.
#
#
#
############################################################################################# END:description

Alles was mit puts, print oder echo beim Test ausgegeben wird, wird auch auf der SmartTester Konsole ausgegeben und mitgeloggt. Folgende Ausgaben werden nicht ausgegeben da sie für den SmartTester intern verwendet werden:
  • st.testResult=Passed
  • st.testResult=Failed
  • st.graph.setKey1=
  • st.graph.setKey2=
  • st.graph.setVerticalDescription=
  • st.graph.setHorizontalDescription=
  • st.graph.setHorizontalType=Nr
  • st.graph.setHorizontalType=Time
  • st.graph.destroy
  • st.graph.setValue1=
  • st.graph.setValue2=
  • st.optionPane.result=
  • st.optionPane.action=
  • st.optionPane.input=
Nachdem der Code bzw. Die Test Beschreibung eingegeben wurde muss sie Abgespeichert werden damit sie aktive wird.

Test Status im Baum anzeigen
Mit den folgenden Kommandos kann der Test Status im Baum angezeigt werden, Grün (Passed) und Rot (Failed).

Beispiel um den Teststatus im Baum zu ändern:
Beispiel für Tickle Passed:
        puts "st.testResult=Passed"
    
Beispiel für Tickle Failed:"     puts "st.testResult=Failed"
Beispiel für Python Passed:"     print "st.testResult=Passed"
Beispiel für Python Failed:     print "st.testResult=Failed"
Beispiel für Batch Passed:     echo "st.testResult=Passed"
Beispiel für Batch Failed:     echo "st.testResult=Failed"



Eingabe während des Tests
Um während des Tests eine Eingabe anzufordern gibt es folgende möglichkeiten:
  • Ergebnis Abfrage:
    Hier wird mit „Passed“ oder „Failed“ ein Zustand abgefragt.
    Beispiel für Tickle:
        puts "st.optionPane.result=Info text"
        set result [gets stdin]
    
    Beispiel für Python:" 
        result = raw_input("st.optionPane.result=Info text\r\n")
    
    Beispiel für Batch:
        @echo off
        echo st.optionPane.result=Info text
        set /p result=

    Rückgabe Wert:
    • 0 = Passed
    • 1 = Failed
    • -1 = Canceled

  • Ergebnis Abfrage mit Bild:
    Hier wird zu der Zustand abgefragt noch ein Bild ausgegeben.
    Beispiel für Tickle:
        puts "st.optionPane.result=Info text&st.optionPane.icon=BILDID"
        set result [gets stdin]
    
    Beispiel für Python:" 
        result = raw_input("st.optionPane.result=Info text&st.optionPane.icon=BILDID\r\n")
    
    Beispiel für Batch:
        @echo off
        echo st.optionPane.result=Info text^&st.optionPane.icon=BILDID
        set /p result=

    Rückgabe Wert:
    • 0 = Passed
    • 1 = Failed
    • -1 = Canceled

  • Auf Action warten:
    Hier wird ein Option Pane angezeigt das mit OK bestätigt werden muss damit der Test fortführt.
    Beispiel für Tickle:
        puts "st.optionPane.action=Info text"
        set result [gets stdin]
    
    Beispiel für Python:" 
        result = raw_input("st.optionPane.action=Info text\r\n")
    
    Beispiel für Batch:
        @echo off
        echo st.optionPane.action=Info text
        set /p result=

    Rückgabe Wert:
    • 0 = OK
    • -1 = Canceled

  • Auf Action warten mit Bild:
    Hier wird ein Option Pane angezeigt das mit OK bestätigt werden muss damit der Test fortführt.
    Zusätzlich wird noch ein Bild ausgegeben.
    Beispiel für Tickle:
        puts "st.optionPane.action=Info text&st.optionPane.icon=BILDID"
        set result [gets stdin]
    
    Beispiel für Python:" 
        result = raw_input("st.optionPane.action=Info text&st.optionPane.icon=BILDID\r\n")
    
    Beispiel für Batch:
        @echo off
        echo st.optionPane.action=Info text^&st.optionPane.icon=BILDID
        set /p result=

    Rückgabe Wert:
    • 0 = OK
    • -1 = Canceled

  • Eingabe:
    Hier wird ein Option Pane angezeigt wo der Benutzer ein wert eingeben kann.
    Beispiel für Tickle:
        puts "st.optionPane.input=Info text"
        set result [gets stdin]
    
    Beispiel für Python:" 
        result = raw_input("st.optionPane.input=Info text\r\n")
    
    Beispiel für Batch:
        @echo off
        echo st.optionPane.input=Info text
        set /p result=

    Rückgabe Wert:
    Den eingegebenen Text im Textfeld.

  • Eingabe mit Bild:
    Hier wird ein Option Pane angezeigt wo der Benutzer ein wert eingeben kann.
    Zusätzlich wird noch ein Bild ausgegeben.
    Beispiel für Tickle:
        puts "st.optionPane.input=Info text&st.optionPane.icon=BILDID"
        set result [gets stdin]
    
    Beispiel für Python:" 
        result = raw_input("st.optionPane.input=Info text&st.optionPane.icon=BILDID\r\n")
    
    Beispiel für Batch:
        @echo off
        echo st.optionPane.input=Info text^&st.optionPane.icon=BILDID
        set /p result=

    Rückgabe Wert:
    Den eingegebenen Text im Textfeld.