]> git.proxmox.com Git - pve-manager.git/blame - test/replication_test3.pl
ui: disable new notification UI for now, will be reworked
[pve-manager.git] / test / replication_test3.pl
CommitLineData
6269a49c
DM
1#!/usr/bin/perl
2
3# Note: Try to run replication job to same node (should fail)
4
5use strict;
6use warnings;
d59f1fa8 7
6269a49c
DM
8use JSON;
9
10use lib ('.', '../..');
11
6269a49c 12use Test::MockModule;
d59f1fa8
TL
13use Test::More;
14
6269a49c 15use ReplicationTestEnv;
810c6776 16use PVE::API2::Replication;
6269a49c 17
6269a49c
DM
18$ReplicationTestEnv::mocked_nodename = 'node1';
19
20my $testjob = {
21 'type' => 'local',
22 'target' => 'node1',
23 'guest' => 900,
24};
25
26$ReplicationTestEnv::mocked_replication_jobs = {
27 job_900_to_node1 => {
28 'type' => 'local',
29 'target' => 'node1', # local node, job should be skipped
30 'guest' => 900,
31 },
32};
33
34$ReplicationTestEnv::mocked_vm_configs = {
35 900 => {
36 node => 'node1',
37 snapshots => {},
38 ide0 => 'local-lvm:vm-900-disk-1,size=4G',
39 memory => 512,
40 ide2 => 'none,media=cdrom',
41 },
42};
43
44ReplicationTestEnv::setup();
45
810c6776 46eval { PVE::API2::Replication::run_single_job('job_900_to_node1', 1000); };
6269a49c
DM
47my $err = $@;
48
49is($err, "unable to sync to local node\n", "test error message");
50
51done_testing();