Skip to content

Commit

Permalink
op-mode: T6694: Move some op-mode commands in the "execute" family
Browse files Browse the repository at this point in the history
'force netns' — move to 'execute shell netns'.
'force vrf'— move to 'execute shell vrf'.
'force owping' — move to 'execute owping'.
'force twping' — move to 'execute twping'.
'monitor bandwidth-test' — move to 'execute bandwidth-test`.
'telnet' — move to 'execute telnet'
  • Loading branch information
natali-rs1985 committed Sep 10, 2024
1 parent d739a10 commit 65622a7
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="monitor">
<node name="execute">
<children>
<node name="bandwidth-test">
<properties>
Expand Down Expand Up @@ -39,7 +39,7 @@
<list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
</properties>
<command>${vyos_op_scripts_dir}/monitor_bandwidth_test.sh "$5"</command>
<command>${vyos_op_scripts_dir}/execute_bandwidth_test.sh "$5"</command>
</tagNode>
<tagNode name="udp">
<properties>
Expand All @@ -48,7 +48,7 @@
<list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
</properties>
<command>${vyos_op_scripts_dir}/monitor_bandwidth_test.sh "$5" "-u"</command>
<command>${vyos_op_scripts_dir}/execute_bandwidth_test.sh "$5" "-u"</command>
</tagNode>
</children>
</node>
Expand Down
32 changes: 32 additions & 0 deletions op-mode-definitions/execute-shell.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="execute">
<children>
<node name="shell">
<properties>
<help>Execute shell</help>
</properties>
<children>
<tagNode name="netns">
<properties>
<help>Execute shell in given Network Namespace</help>
<completionHelp>
<path>netns name</path>
</completionHelp>
</properties>
<command>sudo ip netns exec $4 su - $(whoami)</command>
</tagNode>
<tagNode name="vrf">
<properties>
<help>Execute shell in given VRF instance</help>
<completionHelp>
<path>vrf name</path>
</completionHelp>
</properties>
<command>sudo ip vrf exec $4 su - $(whoami)</command>
</tagNode>
</children>
</node>
</children>
</node>
</interfaceDefinition>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="force">
<node name="execute">
<children>
<tagNode name="owping">
<properties>
Expand Down
16 changes: 0 additions & 16 deletions op-mode-definitions/force-netns.xml.in

This file was deleted.

16 changes: 0 additions & 16 deletions op-mode-definitions/force-vrf.xml.in

This file was deleted.

35 changes: 20 additions & 15 deletions op-mode-definitions/telnet.xml.in
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="telnet">
<properties>
<help>Telnet to a node</help>
</properties>
<node name="execute">
<children>
<tagNode name="to">
<node name="telnet">
<properties>
<help>Telnet to a host</help>
<completionHelp>
<list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
<help>Telnet to a node</help>
</properties>
<command>/usr/bin/telnet $3</command>
<children>
<tagNode name="port">
<tagNode name="to">
<properties>
<help>Telnet to a host:port</help>
<help>Telnet to a host</help>
<completionHelp>
<list>&lt;0-65535&gt;</list>
<list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
</properties>
<command>/usr/bin/telnet $3 $5</command>
<command>/usr/bin/telnet $4</command>
<children>
<tagNode name="port">
<properties>
<help>Telnet to a host:port</help>
<completionHelp>
<list>&lt;0-65535&gt;</list>
</completionHelp>
</properties>
<command>/usr/bin/telnet $4 $6</command>
</tagNode>
</children>
</tagNode>
</children>
</tagNode>
</node>
</children>
</node>
</interfaceDefinition>

2 changes: 1 addition & 1 deletion op-mode-definitions/wake-on-lan.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<properties>
<help>Station (MAC) address to wake up</help>
</properties>
<command>sudo /usr/sbin/etherwake -i "$3" "$5"</command>
<command>sudo /usr/sbin/etherwake -i "$4" "$6"</command>
</tagNode>
</children>
</tagNode>
Expand Down
File renamed without changes.

0 comments on commit 65622a7

Please sign in to comment.