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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use std::path::PathBuf;
use fluvio_types::defaults::CONFIG_FILE_EXTENTION;
use fluvio_types::defaults::{SERVER_CONFIG_BASE_PATH, SERVER_CONFIG_DIR};
pub fn build_server_config_file_path(file_name: &'static str) -> PathBuf {
let mut config_file_path = PathBuf::new();
config_file_path.push(SERVER_CONFIG_BASE_PATH);
config_file_path.push(SERVER_CONFIG_DIR);
config_file_path.push(file_name);
config_file_path.set_extension(CONFIG_FILE_EXTENTION);
config_file_path
}
#[cfg(test)]
pub mod test {
use super::*;
use fluvio_types::defaults::{SC_CONFIG_FILE, SPU_CONFIG_FILE};
#[test]
fn test_build_sc_server_config_file_path() {
let sc_server_file_path = build_server_config_file_path(SC_CONFIG_FILE);
let mut expected_file_path = PathBuf::new();
expected_file_path.push("/etc/fluvio/sc_server.toml");
assert_eq!(sc_server_file_path, expected_file_path);
}
#[test]
fn test_build_spu_server_config_file_path() {
let spu_server_file_path = build_server_config_file_path(SPU_CONFIG_FILE);
let mut expected_file_path = PathBuf::new();
expected_file_path.push("/etc/fluvio/spu_server.toml");
assert_eq!(spu_server_file_path, expected_file_path);
}
}