-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #462 from srl-labs/keepmgmtnet
Implement --keep-mgmt-net for destroy subcmd
- Loading branch information
Showing
13 changed files
with
178 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,6 @@ var rootCmd = &cobra.Command{ | |
if debug { | ||
log.SetLevel(log.DebugLevel) | ||
} | ||
|
||
}, | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
*** Comments *** | ||
This test suite verifies | ||
- the management bridge is not deleted when --keep-mgmt-net is present and the lab is destroyed | ||
- the management bridge is deleted by default | ||
|
||
*** Settings *** | ||
Library OperatingSystem | ||
Library String | ||
Suite Teardown Run sudo containerlab --runtime ${runtime} destroy -t ${topo} --cleanup | ||
|
||
*** Variables *** | ||
${lab-name} 7-keep-mgmt-net | ||
${topo} ${CURDIR}/07-linux-single-node.clab.yml | ||
${mgmt-bridge} 01-07-net | ||
|
||
*** Test Cases *** | ||
Deploy ${lab-name} lab | ||
Log ${CURDIR} | ||
${rc} ${output} = Run And Return Rc And Output | ||
... sudo containerlab --runtime ${runtime} deploy -t ${topo} | ||
Log ${output} | ||
Should Be Equal As Integers ${rc} 0 | ||
|
||
Destroy ${lab-name} lab keep mgmt net | ||
${rc} ${output} = Run And Return Rc And Output | ||
... sudo containerlab --runtime ${runtime} destroy -t ${topo} --keep-mgmt-net | ||
Log ${output} | ||
Should Be Equal As Integers ${rc} 0 | ||
|
||
Check ${lab-name} mgmt network remains | ||
${rc} ${output} = Run And Return Rc And Output | ||
... sudo ip l show dev ${mgmt-bridge} | ||
Log ${output} | ||
Should Be Equal As Integers ${rc} 0 | ||
|
||
Deploy ${lab-name} lab again | ||
Log ${CURDIR} | ||
${rc} ${output} = Run And Return Rc And Output | ||
... sudo containerlab --runtime ${runtime} deploy -t ${topo} | ||
Log ${output} | ||
Should Be Equal As Integers ${rc} 0 | ||
|
||
Destroy ${lab-name} lab dont keep mgmt net | ||
${rc} ${output} = Run And Return Rc And Output | ||
... sudo containerlab --runtime ${runtime} destroy -t ${topo} --cleanup | ||
Log ${output} | ||
Should Be Equal As Integers ${rc} 0 | ||
|
||
Check ${lab-name} mgmt network is gone | ||
${rc} ${output} = Run And Return Rc And Output | ||
... sudo ip l show dev ${mgmt-bridge} | ||
Log ${output} | ||
Should Not Be Equal As Integers ${rc} 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2020 Nokia | ||
# Licensed under the BSD 3-Clause License. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
name: single-node | ||
mgmt: | ||
bridge: 01-07-net | ||
|
||
topology: | ||
nodes: | ||
l1: | ||
kind: linux | ||
image: alpine:3 | ||
cmd: ash -c "sleep 9999" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters