#!/usr/bin/perl

use strict;
use Test::More tests => 11;
use SysWrap;

remove_snapshot_root();
ok(0 != rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf weekly"));

remove_snapshot_root();
ok(0 == rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf hourly"));
ok(0 != rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf weekly"));

remove_snapshot_root();
ok(0 == rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf hourly"));
ok(0 == rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf hourly"));
ok(0 != rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf weekly"));

remove_snapshot_root();
ok(0 == rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf hourly"));
ok(0 == rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf hourly"));
ok(0 == rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf hourly"));
ok(0 == rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf weekly"));
ok(0 != rsnapshot("-c /home/runner/work/rsnapshot/rsnapshot//t//rotate_only_when_0_avail/conf/rotate_only_when_0_avail.conf weekly"));
