test: syslog: Convert from put_config_dict to put_config_dicts

This commit is contained in:
Mattias Walström
2025-01-22 15:05:48 +01:00
parent d83c333b2d
commit 5b8b1eec57
2 changed files with 71 additions and 71 deletions
+8 -6
View File
@@ -17,11 +17,12 @@ with infamy.Test() as test:
address = target.get_mgmt_ip()
with test.step("Configure syslog on DUT to log to files '/log/bar.log' (absolute path) and 'foo' (non-absolute)."):
target.put_config_dict("ietf-syslog", {
"syslog": {
"actions": {
"file": {
"log-file": [
target.put_config_dicts({
"ietf-syslog": {
"syslog": {
"actions": {
"file": {
"log-file": [
{
"name": "file:foo",
"facility-filter": {
@@ -52,7 +53,8 @@ with infamy.Test() as test:
]
}
}
]
]
}
}
}
}
+63 -65
View File
@@ -14,30 +14,78 @@ with infamy.Test() as test:
clientssh = env.attach("client", "mgmt", "ssh")
serverssh = env.attach("server", "mgmt", "ssh")
with test.step("Configure client DUT as syslog client with server DUT as remote, and configure server DUT as syslog server"):
with test.step("Configure client DUT as syslog client with server DUT as remote, and configure server DUT as syslog server"):
_, client_link = env.ltop.xlate("client", "link")
_, server_link = env.ltop.xlate("server", "link")
client.put_config_dict("ietf-interfaces", {
"interfaces": {
"interface": [
{
client.put_config_dicts({
"ietf-interfaces": {
"interfaces": {
"interface": [{
"name": client_link,
"enabled": True,
"ipv4": {
"address": [
{
"ip": "10.0.0.2",
"prefix-length": 24,
}
{
"ip": "10.0.0.2",
"prefix-length": 24,
}
]
}
}
]
]}
},
"ietf-syslog": {
"syslog": {
"actions": {
"file": {
"log-file": [{
"name": "file:security",
"facility-filter": {
"facility-list": [
{
"facility": "auth",
"severity": "all"
},
{
"facility": "audit",
"severity": "all"
}
]
},
"infix-syslog:log-format": "rfc5424"
}]
},
"remote": {
"destination": [
{
"name": "server",
"udp": {
"address": "10.0.0.1"
},
"facility-filter": {
"facility-list": [
{
"facility": "audit",
"severity": "all"
},
{
"facility": "auth",
"severity": "all"
}]
},
"infix-syslog:log-format": "rfc5424"
}
]
}
}
}
}
})
server.put_config_dict("ietf-interfaces", {
server.put_config_dicts({
"ietf-interfaces": {
"interfaces": {
"interface": [
{
@@ -55,59 +103,8 @@ with infamy.Test() as test:
}
]
}
})
client.put_config_dict("ietf-syslog", {
"syslog": {
"actions": {
"file": {
"log-file": [
{
"name": "file:security",
"facility-filter": {
"facility-list": [
{
"facility": "auth",
"severity": "all"
},
{
"facility": "audit",
"severity": "all"
}
]
},
"infix-syslog:log-format": "rfc5424"
}
]
},
"remote": {
"destination": [
{
"name": "server",
"udp": {
"address": "10.0.0.1"
},
"facility-filter": {
"facility-list": [
{
"facility": "audit",
"severity": "all"
},
{
"facility": "auth",
"severity": "all"
}
]
},
"infix-syslog:log-format": "rfc5424"
}
]
}
}
}
})
server.put_config_dict("ietf-syslog", {
},
"ietf-syslog": {
"syslog": {
"actions": {
"file": {
@@ -143,7 +140,8 @@ with infamy.Test() as test:
}
}
}
})
}
})
with test.step("Send security:notice log message from client"):
clientssh.runsh("logger -t test -m client -p security.notice TestMessage")