Skip to content

Commit 0e19b83

Browse files
committed
Add peer-interface testcase
Peer interfaces are a currently propsed addition to draft-ietf-netmod-intf-ext-yang-13 to support veth pairs. Signed-off-by: Florian Kauer <florian.kauer@linutronix.de>
1 parent b87303b commit 0e19b83

11 files changed

+798
-0
lines changed

LICENSES/BSD-3-Clause.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright (c) <year> <owner>.
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved.
3+
SPDX-License-Identifier: BSD-3-Clause
4+
-->
5+
6+
<?xml version="1.0" encoding="utf-8"?>
7+
<interfaces
8+
xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
9+
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type"
10+
xmlns:if-ext="urn:ietf:params:xml:ns:yang:ietf-if-extensions">
11+
<interface>
12+
<name>eth0</name>
13+
<type>ianaift:ethernetCsmacd</type>
14+
<if-ext:link-flap-suppression>
15+
<if-ext:down>50</if-ext:down>
16+
<if-ext:up>1000</if-ext:up>
17+
</if-ext:link-flap-suppression>
18+
</interface>
19+
</interfaces>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved.
3+
SPDX-License-Identifier: BSD-3-Clause
4+
-->
5+
6+
<?xml version="1.0" encoding="utf-8"?>
7+
<interfaces
8+
xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
9+
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type"
10+
xmlns:if-ext="urn:ietf:params:xml:ns:yang:ietf-if-extensions">
11+
<interface>
12+
<name>eth0</name>
13+
<type>ianaift:ethernetCsmacd</type>
14+
<if-ext:link-flap-suppression>
15+
<if-ext:down>0</if-ext:down>
16+
<if-ext:up>50</if-ext:up>
17+
</if-ext:link-flap-suppression>
18+
<oper-status>up</oper-status>
19+
<statistics>
20+
<discontinuity-time>2023-12-15T10:04:12.345+00:00</discontinuity-time>
21+
</statistics>
22+
</interface>
23+
</interfaces>

intf-ext/6-2-dampening.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved.
3+
SPDX-License-Identifier: BSD-3-Clause
4+
-->
5+
6+
<?xml version="1.0" encoding="utf-8"?>
7+
<interfaces
8+
xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
9+
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
10+
<interface>
11+
<name>eth0</name>
12+
<type>ianaift:ethernetCsmacd</type>
13+
<oper-status>down</oper-status>
14+
<dampening
15+
xmlns="urn:ietf:params:xml:ns:yang:ietf-if-extensions">
16+
<half-life>60</half-life>
17+
<reuse>750</reuse>
18+
<suppress>2000</suppress>
19+
<max-suppress-time>240</max-suppress-time>
20+
<penalty>2480</penalty>
21+
<suppressed>true</suppressed>
22+
<time-remaining>103</time-remaining>
23+
</dampening>
24+
<statistics>
25+
<discontinuity-time>2023-12-15T10:04:12.345+00:00</discontinuity-time>
26+
</statistics>
27+
</interface>
28+
</interfaces>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved.
3+
SPDX-License-Identifier: BSD-3-Clause
4+
-->
5+
6+
<?xml version="1.0" encoding="utf-8"?>
7+
<interfaces
8+
xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
9+
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
10+
<interface>
11+
<name>eth0</name>
12+
<type>ianaift:ethernetCsmacd</type>
13+
<ethernet-like
14+
xmlns="urn:ietf:params:xml:ns:yang:ietf-if-ethernet-like">
15+
<mac-address>00:00:5E:00:53:35</mac-address>
16+
</ethernet-like>
17+
</interface>
18+
</interfaces>
19+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved.
3+
SPDX-License-Identifier: BSD-3-Clause
4+
-->
5+
6+
<?xml version="1.0" encoding="utf-8"?>
7+
<interfaces
8+
xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
9+
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
10+
<interface>
11+
<name>eth0</name>
12+
<type>ianaift:ethernetCsmacd</type>
13+
<phys-address>00:00:5E:00:53:35</phys-address>
14+
<ethernet-like
15+
xmlns="urn:ietf:params:xml:ns:yang:ietf-if-ethernet-like">
16+
<mac-address>00:00:5E:00:53:35</mac-address>
17+
<bia-mac-address>00:00:5E:00:53:30</bia-mac-address>
18+
</ethernet-like>
19+
<oper-status>up</oper-status>
20+
<statistics>
21+
<discontinuity-time>2023-12-15T10:04:12.345+00:00</discontinuity-time>
22+
</statistics>
23+
</interface>
24+
</interfaces>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved.
3+
SPDX-License-Identifier: BSD-3-Clause
4+
-->
5+
6+
<?xml version="1.0" encoding="utf-8"?>
7+
<interfaces
8+
xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
9+
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
10+
<interface>
11+
<name>eth0</name>
12+
<type>ianaift:ethernetCsmacd</type>
13+
<phys-address>00:00:5E:00:53:30</phys-address>
14+
<ethernet-like
15+
xmlns="urn:ietf:params:xml:ns:yang:ietf-if-ethernet-like">
16+
<mac-address>00:00:5E:00:53:30</mac-address>
17+
<bia-mac-address>00:00:5E:00:53:30</bia-mac-address>
18+
</ethernet-like>
19+
<oper-status>up</oper-status>
20+
<statistics>
21+
<discontinuity-time>2023-12-15T10:04:12.345+00:00</discontinuity-time>
22+
</statistics>
23+
</interface>
24+
</interfaces>

intf-ext/6-4-peer-interfaces.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved.
3+
SPDX-License-Identifier: BSD-3-Clause
4+
-->
5+
6+
<?xml version="1.0" encoding="utf-8"?>
7+
<interfaces
8+
xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
9+
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type"
10+
xmlns:if-ext="urn:ietf:params:xml:ns:yang:ietf-if-extensions">
11+
<interface>
12+
<name>veth1</name>
13+
<type>ianaift:propVirtual</type>
14+
<if-ext:peer-interface>veth2</if-ext:peer-interface>
15+
<oper-status>down</oper-status>
16+
<statistics>
17+
<discontinuity-time>2023-12-15T10:04:12.345+00:00</discontinuity-time>
18+
</statistics>
19+
</interface>
20+
<interface>
21+
<name>veth2</name>
22+
<type>ianaift:propVirtual</type>
23+
<if-ext:peer-interface>veth1</if-ext:peer-interface>
24+
<oper-status>down</oper-status>
25+
<statistics>
26+
<discontinuity-time>2023-12-15T10:04:12.345+00:00</discontinuity-time>
27+
</statistics>
28+
</interface>
29+
</interfaces>
30+

0 commit comments

Comments
 (0)