#!/usr/bin/perl use strict; use warnings; use Getopt::Long; use JSON; use PVE::Tools; use PVE::HA::Sim::TestHardware; use PVE::HA::Sim::RTHardware; my $opt_interactive; sub show_usage { print "usage: $0 [--interactive]\n"; exit(-1); }; if (!GetOptions ("intercative" => \$opt_interactive)) { show_usage(); } my $testdir = shift || show_usage(); my $hardware; if ($opt_interactive) { $hardware = PVE::HA::Sim::RTHardware->new($testdir); } else { $hardware = PVE::HA::Sim::TestHardware->new($testdir); } $hardware->log('info', "starting simulation"); eval { $hardware->run(); }; if (my $err = $@) { $hardware->log('err', "exit simulation - $err "); } else { $hardware->log('info', "exit simulation - done"); } exit(0);