summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-07-10 08:28:31 +0100
committerKatolaZ <katolaz@freaknet.org>2017-07-10 08:28:31 +0100
commitd0afee5defa7c342a97e4f444f715eb70f0779a3 (patch)
tree9c342a0bbd9ecc21424675ce04c508f4d9941fb0
parentc63c8c8778cb497bba1b3d77e8810d2dd45d2e24 (diff)
few tests with YAML
-rw-r--r--sandpit/test_yaml.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/sandpit/test_yaml.go b/sandpit/test_yaml.go
index ebe8758..bd90e01 100644
--- a/sandpit/test_yaml.go
+++ b/sandpit/test_yaml.go
@@ -34,12 +34,23 @@ s_msg:
- s_tag: BUILD
s_args:
- suites/jessie
- - suites/ascii
+ - suites/ascii
- s_tag: REMOVE
s_args:
- file1
+ - s_tag: CUSTOM
+ s_args: [first, second, third]
`
+var other_msg = `
+s_msg: [
+ {s_tag: "BUILD", s_args: [suites/jessie, suites/ascii]},
+ {s_tag: "REMOVE", s_args: [file1]},
+ {s_tag: "CUSTOM", s_args: [first, second, third]}
+ ]
+`
+
+
var cfg_str = `
s_cfg:
- s_tag: BUILD
@@ -53,6 +64,11 @@ s_cfg:
- s_tag: REMOVE
s_commands:
- s_cmd: file:///bin/rm
+ - s_tag: CUSTOM
+ s_commands: [
+ {s_cmd: "file:///home/user/script/sh", s_hash: "1234567890abcdef"},
+ {s_cmd: "http://my.server.net/submit.php", s_hash: "0987654321abce"}
+ ]
`
func main() {
@@ -63,7 +79,7 @@ func main() {
//log.Printf("%s\n", test_str)
- err := yaml.Unmarshal([]byte(msg_str), &c)
+ err := yaml.Unmarshal([]byte(other_msg), &c)
if err != nil {
log.Fatal("error: ", err)
}