aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/virl/topologies/double-ring-nested.virl
blob: 9018cb529f65da3f92ee470aa9c310a0fe47bef6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
}
@media (prefers-color-scheme: light) {
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
}
fr
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<topology xmlns="http://www.cisco.com/VIRL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="0.9" xsi:schemaLocation="http://www.cisco.com/VIRL https://raw.github.com/CiscoVIRL/schema/v0.9/virl.xsd">
    <extensions>
        <entry key="management_network" type="String">flat</entry>
    </extensions>
    <node name="tg1" type="SIMPLE" subtype="server" location="570,238" vmImage="server-java-nested">
        <extensions>
            <entry key="config" type="String">#cloud-config&#xD;
bootcmd:&#xD;
- ln -s -t /etc/rc.d /etc/rc.local&#xD;
hostname: tg1&#xD;
manage_etc_hosts: true&#xD;
nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
nfs_server_common: $$NFS_SERVER_COMMON$$
runcmd:&#xD;
- start ttyS0&#xD;
- systemctl start getty@ttyS0.service&#xD;
- systemctl start rc-local&#xD;
- touch /tmp/before-sed&#xD;
- sed -i 's/^\s*PasswordAuthentication\s\+no/PasswordAuthentication yes/' /etc/ssh/sshd_config&#xD;
- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config&#xD;
- service ssh restart&#xD;
- service sshd restart&#xD;
users:&#xD;
- default&#xD;
- gecos: User configured by VIRL Configuration Engine 0.21.4&#xD;
  lock-passwd: false&#xD;
  name: cisco&#xD;
  plain-text-passwd: cisco&#xD;
  shell: /bin/bash&#xD;
  ssh-authorized-keys:&#xD;
  - VIRL-USER-SSH-PUBLIC-KEY&#xD;
  - VIRL-USER-SSH-PUBLIC-KEY&#xD;
  sudo: ALL=(ALL) NOPASSWD:ALL&#xD;
write_files:&#xD;
- path: /etc/init/ttyS0.conf&#xD;
  owner: root:root&#xD;
  content: |&#xD;
    # ttyS0 - getty&#xD;
    # This service maintains a getty on ttyS0 from the point the system is&#xD;
    # started until it is shut down again.&#xD;
    start on stopped rc or RUNLEVEL=[12345]&#xD;
    stop on runlevel [!12345]&#xD;
    respawn&#xD;
    exec /sbin/getty -L 115200 ttyS0 vt102&#xD;
  permissions: '0644'&#xD;
- path: /etc/systemd/system/dhclient@.service&#xD;
  content: |&#xD;
    [Unit]&#xD;
    Description=Run dhclient on %i interface&#xD;
    After=network.target&#xD;
    [Service]&#xD;
    Type=oneshot&#xD;
    ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease&#xD;
    RemainAfterExit=yes&#xD;
  owner: root:root&#xD;
  permissions: '0644'&#xD;
- path: /usr/local/sbin/cloud-instance-name
  content: |
    #!/usr/bin/python
    import pickle
    print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
  owner: root:root
  permissions: '0755'
- path: /etc/rc.local&#xD;
  owner: root:root&#xD;
  permissions: '0755'&#xD;
  content: |-&#xD;
    #!/bin/sh&#xD;
    grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1
    grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1
    nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
    nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
    instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
    echo My instance name is $instance_name

    MAXCOUNT=12
    RETRY=5

    mkdir -p /scratch
    mkdir -p /mnt/common

    echo "Mounting NFS directories"
    count=0
    while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
    do
      sleep 5
      count=$[$count+1]
    done

    mount -t nfs "${nfs_server_common}" /mnt/common

    mkdir /scratch/$(hostname)

    exit 0&#xD;
</entry>
            <entry key="Auto-generate config" type="Boolean">false</entry>
        </extensions>
        <interface id="0" name="eth1"/>
        <interface id="1" name="eth2"/>
        <interface id="2" name="eth3"/>
        <interface id="3" name="eth4"/>
        <interface id="4" name="eth5"/>
        <interface id="5" name="eth6"/>
    </node>
    <node name="sut1" type="SIMPLE" subtype="vPP" location="425,26" vmImage="server-java-nested">
        <extensions>
            <entry key="config" type="string">#cloud-config
bootcmd:
- ln -s -t /etc/rc.d /etc/rc.local
hostname: sut1
manage_etc_hosts: true
nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
nfs_server_common: $$NFS_SERVER_COMMON$$
runcmd:
- start ttyS0
- systemctl start getty@ttyS0.service
- systemctl start rc-local
- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
- service ssh restart
- service sshd restart
- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf
- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf
users:
- default
- gecos: User configured by VIRL Configuration Engine 0.21.4
  lock-passwd: false
  name: cisco
  plain-text-passwd: cisco
  shell: /bin/bash
  ssh-authorized-keys:
  - VIRL-USER-SSH-PUBLIC-KEY
  - VIRL-USER-SSH-PUBLIC-KEY
  sudo: ALL=(ALL) NOPASSWD:ALL
write_files:
- path: /etc/init/ttyS0.conf
  owner: root:root
  content: |
    # ttyS0 - getty
    # This service maintains a getty on ttyS0 from the point the system is
    # started until it is shut down again.
    start on stopped rc or RUNLEVEL=[12345]
    stop on runlevel [!12345]
    respawn
    exec /sbin/getty -L 115200 ttyS0 vt102
  permissions: '0644'
- path: /etc/systemd/system/dhclient@.service
  content: |
    [Unit]
    Description=Run dhclient on %i interface
    After=network.target
    [Service]
    Type=oneshot
    ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
    RemainAfterExit=yes
  owner: root:root
  permissions: '0644'
- path: /usr/local/sbin/cloud-instance-name
  content: |
    #!/usr/bin/python
    import pickle
    print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
  owner: root:root
  permissions: '0755'
- path: /etc/rc.local&#xD;
  owner: root:root&#xD;
  permissions: '0755'&#xD;
  content: |-&#xD;
    #!/bin/sh&#xD;
    grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1
    grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1
    nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
    nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
    instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
    echo My instance name is $instance_name

    MAXCOUNT=12
    RETRY=5

    mkdir -p /scratch
    mkdir -p /mnt/common

    echo "Mounting NFS directories"
    count=0
    while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
    do
      sleep 5
      count=$[$count+1]
    done

    mount -t nfs "${nfs_server_common}" /mnt/common

    mkdir /scratch/$(hostname)

    exit 0&#xD;
</entry>
        </extensions>
        <interface id="0" name="GigabitEthernet0/4/0"/>
        <interface id="1" name="GigabitEthernet0/5/0"/>
        <interface id="2" name="GigabitEthernet0/6/0"/>
        <interface id="3" name="GigabitEthernet0/7/0"/>
    </node>
    <node name="sut2" type="SIMPLE" subtype="vPP" location="748,26" vmImage="server-java-nested">
        <extensions>
            <entry key="config" type="string">#cloud-config
bootcmd:
- ln -s -t /etc/rc.d /etc/rc.local
hostname: sut2
manage_etc_hosts: true
nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
nfs_server_common: $$NFS_SERVER_COMMON$$
runcmd:
- start ttyS0
- systemctl start getty@ttyS0.service
- systemctl start rc-local
- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
- service ssh restart
- service sshd restart
- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf
- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf
users:
- default
- gecos: User configured by VIRL Configuration Engine 0.21.4
  lock-passwd: false
  name: cisco
  plain-text-passwd: cisco
  shell: /bin/bash
  ssh-authorized-keys:
  - VIRL-USER-SSH-PUBLIC-KEY
  - VIRL-USER-SSH-PUBLIC-KEY
  sudo: ALL=(ALL) NOPASSWD:ALL
write_files:
- path: /etc/init/ttyS0.conf
  owner: root:root
  content: |
    # ttyS0 - getty
    # This service maintains a getty on ttyS0 from the point the system is
    # started until it is shut down again.
    start on stopped rc or RUNLEVEL=[12345]
    stop on runlevel [!12345]
    respawn
    exec /sbin/getty -L 115200 ttyS0 vt102
  permissions: '0644'
- path: /etc/systemd/system/dhclient@.service
  content: |
    [Unit]
    Description=Run dhclient on %i interface
    After=network.target
    [Service]
    Type=oneshot
    ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
    RemainAfterExit=yes
  owner: root:root
  permissions: '0644'
- path: /usr/local/sbin/cloud-instance-name
  content: |
    #!/usr/bin/python
    import pickle
    print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
  owner: root:root
  permissions: '0755'
- path: /etc/rc.local&#xD;
  owner: root:root&#xD;
  permissions: '0755'&#xD;
  content: |-&#xD;
    #!/bin/sh&#xD;
    grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1
    grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1
    nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
    nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
    instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
    echo My instance name is $instance_name

    MAXCOUNT=12
    RETRY=5

    mkdir -p /scratch
    mkdir -p /mnt/common

    echo "Mounting NFS directories"
    count=0
    while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
    do
      sleep 5
      count=$[$count+1]
    done

    mount -t nfs "${nfs_server_common}" /mnt/common

    mkdir /scratch/$(hostname)

    exit 0&#xD;
</entry>
        </extensions>
        <interface id="0" name="GigabitEthernet0/4/0"/>
        <interface id="1" name="GigabitEthernet0/5/0"/>
        <interface id="2" name="GigabitEthernet0/6/0"/>
        <interface id="3" name="GigabitEthernet0/7/0"/>
    </node>
    <connection dst="/virl:topology/virl:node[1]/virl:interface[3]" src="/virl:topology/virl:node[2]/virl:interface[1]"/>
    <connection dst="/virl:topology/virl:node[1]/virl:interface[4]" src="/virl:topology/virl:node[2]/virl:interface[2]"/>
    <connection dst="/virl:topology/virl:node[2]/virl:interface[3]" src="/virl:topology/virl:node[3]/virl:interface[3]"/>
    <connection dst="/virl:topology/virl:node[2]/virl:interface[4]" src="/virl:topology/virl:node[3]/virl:interface[4]"/>
    <connection dst="/virl:topology/virl:node[1]/virl:interface[5]" src="/virl:topology/virl:node[3]/virl:interface[1]"/>
    <connection dst="/virl:topology/virl:node[1]/virl:interface[6]" src="/virl:topology/virl:node[3]/virl:interface[2]"/>
</topology>
n>, self.is_outbound, self.is_ipv6, self.remote_port_start) def query_vpp_config(self): ss = self.test.vapi.ipsec_spd_dump(self.spd.id) for s in ss: if s.sa_id == self.sa_id and \ s.is_outbound == self.is_outbound and \ s.priority == self.priority and \ s.policy == self.policy and \ s.is_ipv6 == self.is_ipv6 and \ s.remote_start_port == self.remote_port_start: return True return False class VppIpsecSA(VppObject): """ VPP SAD Entry """ def __init__(self, test, id, spi, integ_alg, integ_key, crypto_alg, crypto_key, proto, tun_src=None, tun_dst=None, use_anti_replay=0, udp_encap=0): self.test = test self.id = id self.spi = spi self.integ_alg = integ_alg self.integ_key = integ_key self.crypto_alg = crypto_alg self.crypto_key = crypto_key self.proto = proto self.is_tunnel = 0 self.is_tunnel_v6 = 0 self.tun_src = tun_src self.tun_dst = tun_dst if (tun_src): self.tun_src = ip_address(text_type(tun_src)) self.is_tunnel = 1 if (self.tun_src.version == 6): self.is_tunnel_v6 = 1 if (tun_dst): self.tun_dst = ip_address(text_type(tun_dst)) self.use_anti_replay = use_anti_replay self.udp_encap = udp_encap def add_vpp_config(self): self.test.vapi.ipsec_sad_add_del_entry( self.id, self.spi, self.integ_alg, self.integ_key, self.crypto_alg, self.crypto_key, self.proto, (self.tun_src.packed if self.tun_src else []), (self.tun_dst.packed if self.tun_dst else []), is_tunnel=self.is_tunnel, is_tunnel_ipv6=self.is_tunnel_v6, use_anti_replay=self.use_anti_replay, udp_encap=self.udp_encap) self.test.registry.register(self, self.test.logger) def remove_vpp_config(self): self.test.vapi.ipsec_sad_add_del_entry( self.id, self.spi, self.integ_alg, self.integ_key, self.crypto_alg, self.crypto_key, self.proto, (self.tun_src.packed if self.tun_src else []), (self.tun_dst.packed if self.tun_dst else []), is_tunnel=self.is_tunnel, is_tunnel_ipv6=self.is_tunnel_v6, use_anti_replay=self.use_anti_replay, udp_encap=self.udp_encap, is_add=0) def __str__(self): return self.object_id() def object_id(self): return "ipsec-sa-%d" % self.id def query_vpp_config(self): bs = self.test.vapi.ipsec_sa_dump() for b in bs: if b.sa_id == self.id: return True return False