Scapytain/Usage/Tests

From aldeid
Jump to navigation Jump to search
You are here:
Tests

List Tests

This screen lists existing Tests by groups. If you haven't associated Tests to groups, they appear in the first table. For each Test, following information is displayed:

  • Reference: Reference of the Test. Link that redirects to the details of the Test.
  • Name: Name of the Test
  • Description: Description of the Test
  • Version: Last available version of the Test

Create a new Test

This screen enables to create a new Test. Following fields are available:

  • Reference: Reference of the Test
  • Name: Name of the Test
  • Group: Optional. Either classify the Test in an existing group from the dropdown list...
  • New group: ...or create a new group in this field
  • Description: Description of the Test
  • Expected result: Expected result of the Test (e.g. alert that must be triggered)
  • Test code: Payload of the Test (must be a Scapy code)
  • Comment on code: Optional. Eventual comments on the Scapy payload
  • Test depends on: Optional. Eventually attach the Test to an existing Test. In case you attach a Test, this latest will be run prior to the Test run.

View the details of a Test

From this screen, you can:

  • List versions of a test: All modifications on a test are saved on different versions. These versions appear on this screen, ordered from recent to oldest.
  • Delete a version by clicking on "delete this version". Notice that you can't delete a version implied in a campaign (database integrity check).
  • Run a test: please see this section

Edit a Test

To update an existing Test, click on the Test to modify from the Tests list screen.

Then, from the menu, click on one of these options:

  • edit test: redirects to a screen similar to the creation form.
  • edit code: only opens the code of the Test
Note
Notice that every modification will create a new version of the Test.

Delete a Test

To delete a Test, select it from the Tests list screen and click on the "delete test" link from the menu.

Note
Notice that you can't delete a Test that is implied in a Test campaign (database integrity check).

Run a Test

Configure the test

If your Test depends on variables that have been defined as Test Means, you can select the Test Mean from following dropdown list.

Run and stop a Test

Once eventually configured, click on "Run" to start the test.

To stop a test (e.g. loop functions), press the ESCAPE key.

When the test is complete, it displays a status:

  • Passed: the Test is completed and has returned True or None
  • Failed: the Test is completed and has returned False

Error while running the Test

If you have such an error (more information here):

Traceback (most recent call last):
  File "<input>", line 2, in <module>
  File "/usr/lib/pymodules/python2.6/scapy/sendrecv.py", line 316, in sr1
    a,b,c=sndrcv(s,x,*args,**kargs)
  File "/usr/lib/pymodules/python2.6/scapy/sendrecv.py", line 35, in sndrcv
    pkt = SetGen(pkt)
NameError: global name 'SetGen' is not defined

Edit /usr/lib/pymodules/python2.6/scapy/sendrecv.py and add following line at the beginning of the file:

from base_classes import SetGen