Rugg Examples

Basic scenarios examples:

Create a 5Mb zone, and blank it

zone 5Mb, blank

Creates a 5Mb zone, blanks it, fills it with text, ensures it is not blank

zone 5Mb, blank, fill text, ensure not blank

Create a 5Mb zone, divide it into two parts, and fill the whole zone with random text. The subzones should not be the same.

zone 5Mb, subdivide 2 : fill text, ensure different

Same as above, but the subzones are filled with the SAME data, and checking that the zones are actually the same.

zone 5Mb, subdivide 2 : fill same text, ensure same

The same scenario, but with filling the zones in parallel threads (with the same data)

zone 5Mb, subdivide 2 | fill same text, ensure same

Divide a 5Mb zone into 10 subzones, blanking in parallel, then filling them in parallel, then ensuring that they are all the same

zone 5Mb, subdivide 10 | blank | ensure blank | fill same text, ensure same

What would it look like in Python ?

On a side note, here is the equivalent Python code for the following Rugg scenario:

 10..100Mb : zone : 1..10 :  divide : fill text : same !

and the approximative Python translation :

 for size in range(10,100 + (100-10) / 10, (100-10) / 10 ):
     zone = Zone(MB(size))
     for n in range(2,11):
         subzones = zone.subdivide(n)
         for subzone in subzones:

This kind of code can get way more complicated when using the parallel execution operator (|), as threads have to be created and managed by the program.