mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
feat: infix-schedule based on ietf-schedule implementation
Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
This commit is contained in:
@@ -22,3 +22,6 @@
|
||||
|
||||
- name: System Upgrade
|
||||
case: upgrade/test.py
|
||||
|
||||
- name: Schedule Reboot
|
||||
case: schedule_reboot/test.py
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
test.adoc
|
||||
@@ -0,0 +1,21 @@
|
||||
=== Schedule Reboot
|
||||
|
||||
ifdef::topdoc[:imagesdir: {topdoc}../../test/case/system/schedule_reboot]
|
||||
|
||||
==== Description
|
||||
|
||||
Verify that it is possible to schedule a system reboot using the
|
||||
infix-schedule module.
|
||||
|
||||
==== Topology
|
||||
|
||||
image::topology.svg[Schedule Reboot topology, align=center, scaledwidth=75%]
|
||||
|
||||
==== Sequence
|
||||
|
||||
. Set up topology and attach to target DUT
|
||||
. Schedule a reboot
|
||||
. Wait for reboot
|
||||
. Verify system is back up
|
||||
|
||||
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Schedule Reboot
|
||||
|
||||
Verify that it is possible to schedule a system reboot using the
|
||||
infix-schedule module.
|
||||
"""
|
||||
import infamy
|
||||
from infamy.util import wait_boot
|
||||
|
||||
with infamy.Test() as test:
|
||||
with test.step("Set up topology and attach to target DUT"):
|
||||
env = infamy.Env()
|
||||
target = env.attach("target", "mgmt", "netconf")
|
||||
|
||||
with test.step("Define a schedule and point scheduled-reboot at it"):
|
||||
target.put_config_dicts({
|
||||
"ietf-system": {
|
||||
"system": {
|
||||
"infix-schedule:schedules": {
|
||||
"schedule": [
|
||||
{
|
||||
"name": "reboot-test",
|
||||
"enabled": True,
|
||||
"recurrence": {
|
||||
"frequency": "ietf-schedule:minutely",
|
||||
"interval": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"infix-system:scheduled-reboot": {
|
||||
"schedule": "reboot-test"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
with test.step("Wait for reboot"):
|
||||
if not wait_boot(target, env):
|
||||
test.fail("System did not reboot as expected")
|
||||
|
||||
with test.step("Verify system is back up"):
|
||||
target = env.attach("target", "mgmt", "netconf")
|
||||
|
||||
test.succeed()
|
||||
@@ -0,0 +1,23 @@
|
||||
graph "1x1" {
|
||||
layout="neato";
|
||||
overlap="false";
|
||||
esep="+80";
|
||||
|
||||
node [shape=record, fontname="DejaVu Sans Mono, Book"];
|
||||
edge [color="cornflowerblue", penwidth="2", fontname="DejaVu Serif, Book"];
|
||||
|
||||
host [
|
||||
label="host | { <mgmt> mgmt }",
|
||||
pos="0,12!",
|
||||
requires="controller",
|
||||
];
|
||||
|
||||
target [
|
||||
label="{ <mgmt> mgmt } | target",
|
||||
pos="10,12!",
|
||||
|
||||
requires="infix",
|
||||
];
|
||||
|
||||
host:mgmt -- target:mgmt [requires="mgmt", color="lightgray"]
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
|
||||
<!-- Title: 1x1 Pages: 1 -->
|
||||
<svg width="424pt" height="45pt"
|
||||
viewBox="0.00 0.00 424.03 45.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 41)">
|
||||
<title>1x1</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-41 420.03,-41 420.03,4 -4,4"/>
|
||||
<!-- host -->
|
||||
<g id="node1" class="node">
|
||||
<title>host</title>
|
||||
<polygon fill="none" stroke="black" points="0,-0.5 0,-36.5 100,-36.5 100,-0.5 0,-0.5"/>
|
||||
<text text-anchor="middle" x="25" y="-14.8" font-family="DejaVu Sans Mono, Book" font-size="14.00">host</text>
|
||||
<polyline fill="none" stroke="black" points="50,-0.5 50,-36.5 "/>
|
||||
<text text-anchor="middle" x="75" y="-14.8" font-family="DejaVu Sans Mono, Book" font-size="14.00">mgmt</text>
|
||||
</g>
|
||||
<!-- target -->
|
||||
<g id="node2" class="node">
|
||||
<title>target</title>
|
||||
<polygon fill="none" stroke="black" points="300.03,-0.5 300.03,-36.5 416.03,-36.5 416.03,-0.5 300.03,-0.5"/>
|
||||
<text text-anchor="middle" x="325.03" y="-14.8" font-family="DejaVu Sans Mono, Book" font-size="14.00">mgmt</text>
|
||||
<polyline fill="none" stroke="black" points="350.03,-0.5 350.03,-36.5 "/>
|
||||
<text text-anchor="middle" x="383.03" y="-14.8" font-family="DejaVu Sans Mono, Book" font-size="14.00">target</text>
|
||||
</g>
|
||||
<!-- host--target -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>host:mgmt--target:mgmt</title>
|
||||
<path fill="none" stroke="lightgray" stroke-width="2" d="M100,-18.5C100,-18.5 300.03,-18.5 300.03,-18.5"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user