1
1
package Testeaux ;
2
2
3
- package combineaux
3
+ package Combineaux
4
4
{
5
5
sub combine
6
6
{
7
7
my ($workloads , $troubles ) = @_ ;
8
8
9
- my $cluster = starteaux -> deploy(' lxc' );
9
+ my $cluster = Starteaux -> deploy(' lxc' );
10
10
11
11
foreach my $workload (@$workloads )
12
12
{
13
13
foreach my $trouble (@$troubles )
14
14
{
15
15
print (" run workload $workload during trouble $trouble \n " );
16
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 );
17
+ Stresseaux ::start(' hello' , $workload , $cluster );
18
+ sleep (1); # FIXME: will this work?
19
+ Troubleaux ::cause($cluster , $trouble );
20
+ sleep (1); # FIXME: will this work?
21
+ Stresseaux ::stop(' hello' );
22
+ Troubleaux ::fix($cluster );
23
23
}
24
24
}
25
+
26
+ $cluster -> destroy();
25
27
}
26
28
}
27
29
28
- package stresseaux
30
+ package Stresseaux
29
31
{
30
32
sub start
31
33
{
@@ -42,15 +44,15 @@ package stresseaux
42
44
}
43
45
}
44
46
45
- package starteaux
47
+ package Starteaux
46
48
{
47
49
sub deploy
48
50
{
49
51
my ($class , $driver , @args ) = @_ ;
50
52
my $self = {};
51
53
print (" deploy cluster using driver $driver \n " );
52
54
# fixme: implement
53
- return bless $self , ' starteaux ' ;
55
+ return bless $self , ' Starteaux ' ;
54
56
}
55
57
56
58
sub up
@@ -62,7 +64,7 @@ package starteaux
62
64
63
65
sub down
64
66
{
65
- my ($self , $id = @_ ;
67
+ my ($self , $id ) = @_ ;
66
68
print (" down node $id \n " );
67
69
# FIXME: implement
68
70
}
@@ -80,6 +82,30 @@ package starteaux
80
82
print (" delay packets from $src to $dst by $msec msec\n " );
81
83
# FIXME: implement
82
84
}
85
+
86
+ sub destroy
87
+ {
88
+ my ($self ) = @_ ;
89
+ print (" destroy cluster $cluster \n " );
90
+ # FIXME: implement
91
+ }
92
+ }
93
+
94
+ package Troubleaux
95
+ {
96
+ sub cause
97
+ {
98
+ my ($cluster , $trouble ) = @_ ;
99
+ print (" cause $trouble in cluster $cluster \n " );
100
+ # fixme: implement
101
+ }
102
+
103
+ sub fix
104
+ {
105
+ my ($cluster ) = @_ ;
106
+ print (" fix cluster $cluster \n " );
107
+ # fixme: implement
108
+ }
83
109
}
84
110
85
111
1;
0 commit comments