2019-06-16 20:45:30 +02:00
|
|
|
package tcl
|
|
|
|
|
2019-06-17 08:47:04 +02:00
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"testing"
|
|
|
|
)
|
2019-06-16 20:45:30 +02:00
|
|
|
|
|
|
|
func TestFirst(t *testing.T) {
|
|
|
|
input := `#TMSH-VERSION: 12.1.2
|
|
|
|
|
|
|
|
cli admin-partitions {
|
|
|
|
update-partition Common
|
|
|
|
}
|
|
|
|
apm report default-report {
|
|
|
|
report-name sessionReports/sessionSummary
|
|
|
|
user /Common/admin
|
|
|
|
}
|
|
|
|
auth user admin {
|
|
|
|
description "Admin User"
|
|
|
|
encrypted-password $6$IIhG.HP4$kmWDt3Czta4rK5Ct4rYgaGSCDtqkMbAIgCUUdIDaQ/W8HTVHy7F1EZmSM.KYO9sdxDTuggaAGHj7QO/8f9rB80
|
|
|
|
partition-access {
|
|
|
|
all-partitions {
|
|
|
|
role admin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
shell bash
|
2019-06-17 08:47:04 +02:00
|
|
|
}
|
|
|
|
`
|
2019-06-16 20:45:30 +02:00
|
|
|
|
|
|
|
d, e := ParseDebug(input)
|
|
|
|
if e != nil {
|
|
|
|
t.Fatal(e)
|
|
|
|
}
|
|
|
|
|
|
|
|
t.Logf("got d: %#v\n", d)
|
|
|
|
|
|
|
|
}
|
2019-06-17 08:47:04 +02:00
|
|
|
|
|
|
|
func TestExample2(t *testing.T) {
|
|
|
|
input, err := ioutil.ReadFile("testdata/example2.conf")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
d, e := ParseDebug(string(input))
|
|
|
|
if e != nil {
|
|
|
|
t.Fatal(e)
|
|
|
|
}
|
|
|
|
|
|
|
|
t.Logf("got d: %#v\n", d)
|
|
|
|
|
|
|
|
}
|