MCPcopy
hub / github.com/tuna/tunasync / TestConfig

Function TestConfig

worker/config_test.go:15–706  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestConfig(t *testing.T) {
16 var cfgBlob = `
17[global]
18name = "test_worker"
19log_dir = "/var/log/tunasync/{{.Name}}"
20mirror_dir = "/data/mirrors"
21concurrent = 10
22interval = 240
23retry = 3
24timeout = 86400
25
26[manager]
27api_base = "https://127.0.0.1:5000"
28token = "some_token"
29
30[server]
31hostname = "worker1.example.com"
32listen_addr = "127.0.0.1"
33listen_port = 6000
34ssl_cert = "/etc/tunasync.d/worker1.cert"
35ssl_key = "/etc/tunasync.d/worker1.key"
36
37[[mirrors]]
38name = "AOSP"
39provider = "command"
40upstream = "https://aosp.google.com/"
41interval = 720
42retry = 2
43timeout = 3600
44mirror_dir = "/data/git/AOSP"
45exec_on_success = [
46 "bash -c 'echo ${TUNASYNC_JOB_EXIT_STATUS} > ${TUNASYNC_WORKING_DIR}/exit_status'"
47]
48 [mirrors.env]
49 REPO = "/usr/local/bin/aosp-repo"
50
51[[mirrors]]
52name = "debian"
53provider = "two-stage-rsync"
54stage1_profile = "debian"
55upstream = "rsync://ftp.debian.org/debian/"
56use_ipv6 = true
57memory_limit = "256MiB"
58
59[[mirrors]]
60name = "fedora"
61provider = "rsync"
62upstream = "rsync://ftp.fedoraproject.org/fedora/"
63use_ipv6 = true
64memory_limit = "128M"
65
66exclude_file = "/etc/tunasync.d/fedora-exclude.txt"
67exec_on_failure = [
68 "bash -c 'echo ${TUNASYNC_JOB_EXIT_STATUS} > ${TUNASYNC_WORKING_DIR}/exit_status'"
69]
70 `
71
72 Convey("When giving invalid file", t, func() {

Callers

nothing calls this directly

Calls 11

newMirrorProviderFunction · 0.85
RemoveMethod · 0.80
ValueMethod · 0.80
LoadConfigFunction · 0.70
NameMethod · 0.65
CloseMethod · 0.65
LogDirMethod · 0.65
LogFileMethod · 0.65
HooksMethod · 0.65
WorkingDirMethod · 0.65
TimeoutMethod · 0.65

Tested by

no test coverage detected