mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-28 19:34:58 +01:00
4e16952ad9
1. Change config format to support multiple types of snapshotting modes. 2. Implement a hacky way to support periodic or completely manual snaphots. In manual mode, the user has to trigger replication using the wakeup mechanism after they took snapshots using their own tooling. As indicated by the comment, a more general solution would be desirable, but we want to get the release out and 'manual' mode is a feature that some people requested...
39 lines
810 B
Go
39 lines
810 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestConfigEmptyFails(t *testing.T) {
|
|
conf, err := testConfig(t, "\n")
|
|
assert.Nil(t, conf)
|
|
assert.Error(t, err)
|
|
}
|
|
|
|
func TestJobsOnlyWorks(t *testing.T) {
|
|
testValidConfig(t, `
|
|
jobs:
|
|
- name: push
|
|
type: push
|
|
# snapshot the filesystems matched by the left-hand-side of the mapping
|
|
# every 10m with zrepl_ as prefix
|
|
connect:
|
|
type: tcp
|
|
address: localhost:2342
|
|
filesystems: {
|
|
"pool1/var/db<": true,
|
|
"pool1/usr/home<": true,
|
|
"pool1/usr/home/paranoid": false, #don't backup paranoid user
|
|
"pool1/poudriere/ports<": false #don't backup the ports trees
|
|
}
|
|
snapshotting:
|
|
type: manual
|
|
pruning:
|
|
keep_sender:
|
|
- type: not_replicated
|
|
keep_receiver:
|
|
- type: last_n
|
|
count: 1
|
|
`)
|
|
} |