|
| 1 | +packageTesteaux; |
| 2 | + |
| 3 | +packagecombineaux |
| 4 | +{ |
| 5 | +subcombine |
| 6 | +{ |
| 7 | +my ($workloads,$troubles) =@_; |
| 8 | + |
| 9 | +my$cluster = starteaux->deploy('lxc'); |
| 10 | + |
| 11 | +foreachmy$workload (@$workloads) |
| 12 | +{ |
| 13 | +foreachmy$trouble (@$troubles) |
| 14 | +{ |
| 15 | +print("run workload$workload during trouble$trouble\n"); |
| 16 | +# FIXME: generate proper id instead of 'hello' |
| 17 | +stresseaux::start('hello',$workload,$cluster); |
| 18 | +# FIXME: add a time gap here |
| 19 | +troubleaux::cause($cluster,$trouble); |
| 20 | +# FIXME: add a time gap here |
| 21 | +stresseaux::stop('hello'); |
| 22 | +troubleaux::fix($cluster); |
| 23 | +} |
| 24 | +} |
| 25 | +} |
| 26 | +} |
| 27 | + |
| 28 | +packagestresseaux |
| 29 | +{ |
| 30 | +substart |
| 31 | +{ |
| 32 | +my ($id,$workload,$cluster) =@_; |
| 33 | +print("start stress$id: workload$workload, cluster$cluster\n"); |
| 34 | +# fixme: implement |
| 35 | +} |
| 36 | + |
| 37 | +substop |
| 38 | +{ |
| 39 | +my$id =shift; |
| 40 | +print("stop stress$id\n"); |
| 41 | +# FIXME: implement |
| 42 | +} |
| 43 | +} |
| 44 | + |
| 45 | +packagestarteaux |
| 46 | +{ |
| 47 | +subdeploy |
| 48 | +{ |
| 49 | +my ($class,$driver,@args) =@_; |
| 50 | +my$self = {}; |
| 51 | +print("deploy cluster using driver$driver\n"); |
| 52 | +# fixme: implement |
| 53 | +returnbless$self,'starteaux'; |
| 54 | +} |
| 55 | + |
| 56 | +subup |
| 57 | +{ |
| 58 | +my ($self,$id) =@_; |
| 59 | +print("up node$id\n"); |
| 60 | +# FIXME: implement |
| 61 | +} |
| 62 | + |
| 63 | +subdown |
| 64 | +{ |
| 65 | +my ($self,$id =@_; |
| 66 | +print("down node$id\n"); |
| 67 | +# FIXME: implement |
| 68 | +} |
| 69 | + |
| 70 | +subdrop |
| 71 | +{ |
| 72 | +my ($self,$src,$dst,$ratio) =@_; |
| 73 | +print("drop$ratio packets from$src to$dst\n"); |
| 74 | +# FIXME: implement |
| 75 | +} |
| 76 | + |
| 77 | +subdelay |
| 78 | +{ |
| 79 | +my ($self,$src,$dst,$msec) =@_; |
| 80 | +print("delay packets from$src to$dst by$msec msec\n"); |
| 81 | +# FIXME: implement |
| 82 | +} |
| 83 | +} |
| 84 | + |
| 85 | +1; |