File: ftpsync.bats

package info (click to toggle)
archvsync 20180513%2Bnmu1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 236 kB
  • sloc: sh: 883; makefile: 80
file content (36 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bats

load helper

@test "run ftpsync" {
  run_ftpsync sync:archive:security
  [[ $status -eq 0 ]]

  ! [[ -f $BATS_TEST_OWN_LOGDIR/ftpsync-security.log ]]
  ! [[ -f $BATS_TEST_OWN_LOGDIR/rsync-ftpsync-security.log ]]
  ! [[ -f $BATS_TEST_OWN_LOGDIR/rsync-ftpsync-security.error ]]
  [[ -s $BATS_TEST_OWN_LOGDIR/ftpsync-security.log.0 ]]
  [[ -s $BATS_TEST_OWN_LOGDIR/rsync-ftpsync-security.log.0 ]]
  [[ -f $BATS_TEST_OWN_LOGDIR/rsync-ftpsync-security.error.0 ]]

  [[ -s $BATS_TEST_OWN_OUTDIR/project/trace/localhost ]]
  [[ -s $BATS_TEST_OWN_OUTDIR/project/trace/security.debian.org ]]
}

@test "run ftpsync-cron" {
  run_ftpsync_cron security
  [[ $status -eq 0 ]]

  [[ -s $BATS_TEST_OWN_LOGDIR/ftpsync-security.log.0 ]]
  [[ -s $BATS_TEST_OWN_LOGDIR/rsync-ftpsync-security.log.0 ]]
  ! [[ -f $BATS_TEST_OWN_LOGDIR/ftpsync-security.log.1 ]]
  ! [[ -f $BATS_TEST_OWN_LOGDIR/rsync-ftpsync-security.log.1 ]]

  run_ftpsync_cron security
  [[ $status -eq 0 ]]

  [[ -s $BATS_TEST_OWN_LOGDIR/ftpsync-security.log.0 ]]
  [[ -s $BATS_TEST_OWN_LOGDIR/rsync-ftpsync-security.log.0 ]]
  ! [[ -f $BATS_TEST_OWN_LOGDIR/ftpsync-security.log.1 ]]
  ! [[ -f $BATS_TEST_OWN_LOGDIR/rsync-ftpsync-security.log.1 ]]
}