]>
Commit | Line | Data |
---|---|---|
88c1865e DM |
1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | use JSON; | |
6 | use lib '..'; | |
7 | ||
8 | use PVE::Tools; | |
9e5ea8f7 | 9 | use PVE::HA::Config; |
f7cb19c6 | 10 | |
88c1865e DM |
11 | use PVE::HA::Sim::TestHardware; |
12 | ||
13 | sub show_usage { | |
14 | print "usage: $0 <testdir>\n"; | |
15 | exit(-1); | |
16 | }; | |
17 | ||
88c1865e DM |
18 | my $testdir = shift || show_usage(); |
19 | my $hardware = PVE::HA::Sim::TestHardware->new($testdir); | |
20 | ||
21 | $hardware->log('info', "starting simulation"); | |
22 | ||
23 | eval { $hardware->run(); }; | |
24 | if (my $err = $@) { | |
25 | $hardware->log('err', "exit simulation - $err "); | |
26 | } else { | |
27 | $hardware->log('info', "exit simulation - done"); | |
28 | } | |
29 | ||
30 | exit(0); | |
31 | ||
32 | ||
33 |