Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit46a5c82

Browse files
kvapkelvich
authored andcommitted
Fix syntax in Testeaux module. Add an example that uses it.
1 parentdd33aa2 commit46a5c82

File tree

2 files changed

+46
-12
lines changed

2 files changed

+46
-12
lines changed

‎testeaux/Testeaux.pm

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
packageTesteaux;
22

3-
packagecombineaux
3+
packageCombineaux
44
{
55
subcombine
66
{
77
my ($workloads,$troubles) =@_;
88

9-
my$cluster =starteaux->deploy('lxc');
9+
my$cluster =Starteaux->deploy('lxc');
1010

1111
foreachmy$workload (@$workloads)
1212
{
1313
foreachmy$trouble (@$troubles)
1414
{
1515
print("run workload$workload during trouble$trouble\n");
1616
# 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);
2323
}
2424
}
25+
26+
$cluster->destroy();
2527
}
2628
}
2729

28-
packagestresseaux
30+
packageStresseaux
2931
{
3032
substart
3133
{
@@ -42,15 +44,15 @@ package stresseaux
4244
}
4345
}
4446

45-
packagestarteaux
47+
packageStarteaux
4648
{
4749
subdeploy
4850
{
4951
my ($class,$driver,@args) =@_;
5052
my$self = {};
5153
print("deploy cluster using driver$driver\n");
5254
# fixme: implement
53-
returnbless$self,'starteaux';
55+
returnbless$self,'Starteaux';
5456
}
5557

5658
subup
@@ -62,7 +64,7 @@ package starteaux
6264

6365
subdown
6466
{
65-
my ($self,$id =@_;
67+
my ($self,$id) =@_;
6668
print("down node$id\n");
6769
# FIXME: implement
6870
}
@@ -80,6 +82,30 @@ package starteaux
8082
print("delay packets from$src to$dst by$msec msec\n");
8183
# FIXME: implement
8284
}
85+
86+
subdestroy
87+
{
88+
my ($self) =@_;
89+
print("destroy cluster$cluster\n");
90+
# FIXME: implement
91+
}
92+
}
93+
94+
packageTroubleaux
95+
{
96+
subcause
97+
{
98+
my ($cluster,$trouble) =@_;
99+
print("cause$trouble in cluster$cluster\n");
100+
# fixme: implement
101+
}
102+
103+
subfix
104+
{
105+
my ($cluster) =@_;
106+
print("fix cluster$cluster\n");
107+
# fixme: implement
108+
}
83109
}
84110

85111
1;

‎testeaux/eaux.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/perl
2+
3+
use Testeaux;
4+
5+
Combineaux::combine(
6+
['bank-transfers','pgbench-default'],
7+
['split-brain','time-shift'],
8+
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp