]> git.proxmox.com Git - pve-manager.git/blame - test/replication_test1.pl
Fix #352: Limit the length of backup logs for mails
[pve-manager.git] / test / replication_test1.pl
CommitLineData
d0920c29
DM
1#!/usr/bin/perl
2
3# Note: Test if mockup from ReplicationTestEnv works
4
5use strict;
6use warnings;
7use JSON;
8
9use lib ('.', '../..');
10
11use Data::Dumper;
12
13use ReplicationTestEnv;
14use Test::More tests => 3;
15
16$ReplicationTestEnv::mocked_nodename = 'node1';
17
18my $testjob = {
19 'type' => 'local',
20 'target' => 'node1',
21 'guest' => 900,
22};
23
24$ReplicationTestEnv::mocked_replication_jobs = {
25 job_900_to_node1 => $testjob,
26};
27
28$ReplicationTestEnv::mocked_vm_configs = {
29 900 => {
30 node => 'node1',
31 snapshots => {},
32 ide0 => 'local-lvm:vm-900-disk-1,size=4G',
33 memory => 512,
34 ide2 => 'none,media=cdrom',
35 },
36};
37
38ReplicationTestEnv::setup();
39
40ok(PVE::INotify::nodename() eq 'node1');
41
42my $list = PVE::Cluster::get_vmlist();
43is_deeply($list, { ids => {900 => { node => 'node1', type => 'qemu', version => 1}}});
44my $cfg = PVE::ReplicationConfig->new();
45is_deeply($cfg, { ids => { job_900_to_node1 => $testjob }});
46
47exit(0);