Skip to content

Commit

Permalink
[Venom] Inline: Add variables for l3, Create symlink from qemu-kvm to…
Browse files Browse the repository at this point in the history
… qemu-system-x86_64
  • Loading branch information
JeGoi committed Dec 23, 2021
1 parent fbe037b commit afbb74d
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 22 deletions.
7 changes: 7 additions & 0 deletions t/venom/scenarios/unit_tests/playbooks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
state: present
enablerepo: "epel"
when: ansible_facts['os_family'] == "RedHat"

- name: For RHEL8Create a symbolic link for qemu-system-x86_64
ansible.builtin.file:
src: /usr/libexec/qemu-kvm
dest: /usr/bin/qemu-system-x86_64
state: link
when: ansible_facts['os_family'] == "RedHat"
8 changes: 4 additions & 4 deletions t/venom/test_suites/inline/l3/10_setup_packetfence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ testcases:
"network": "100.64.0.0",
"network_iseditable": true,
"networks": [
"192.168.1.0"
"{{.inline_l3.routed_networks}}"
],
"not_editable": false,
"reg_network": null,
Expand All @@ -61,16 +61,16 @@ testcases:
ignore_verify_ssl: true
body: >-
{
"id": "192.168.1.0",
"id": "{{.inline_l3.routed_networks}}",
"isClone": false,
"isNew": true,
"algorithm": 1,
"coa": "disabled",
"description": "Inline L3",
"dhcp_default_lease_time": "30",
"dhcp_end": "192.168.1.10",
"dhcp_end": "{{.inline_l3.node.ipaddress}}",
"dhcp_max_lease_time": "30",
"dhcp_start": "192.168.1.10",
"dhcp_start": "{{.inline_l3.node.ipaddress}}",
"dhcpd": "enabled",
"dns": "8.8.8.8",
"fake_mac_enabled": 0,
Expand Down
2 changes: 1 addition & 1 deletion t/venom/test_suites/inline/l3/15_client_start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ testcases:
[Service]
Environment="haltcmd=kill -INT $MAINPID"
ExecStart= ip netns exec inlinel3 qemu-system-x86_64 -boot d -hda /tmp/ulinux.qcow2 -m 128M -device virtio-net-pci,netdev=network0,mac=02:06:19:98:00:00 -netdev tap,id=network0,ifname=blok-tap0,script=no,downscript=no -nographic -serial telnet:localhost:4321,server,nowait
ExecStart= ip netns exec inlinel3 /usr/bin/qemu-system-x86_64 -boot d -hda /tmp/ulinux.qcow2 -m 128M -device "virtio-net-pci,netdev=network0,mac={{.inline_l3.node.macaddress}}" -netdev tap,id=network0,ifname=blok-tap0,script=no,downscript=no -nographic -serial telnet:localhost:4321,server,nowait
ExecStop=/usr/bin/bash -c ${haltcmd}
ExecStop=/usr/bin/bash -c 'while nc localhost 7100; do sleep 1; done'
Expand Down
2 changes: 1 addition & 1 deletion t/venom/test_suites/inline/l3/20_unregistered_device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ testcases:
- name: test_if_the_device_is_in_the_ipset_unregister_set
steps:
- type: exec
script: ipset test pfsession_Unreg_192.168.1.0 192.168.1.10
script: 'ipset test pfsession_Unreg_{{.inline_l3.routed_networks}} {{.inline_l3.node.ipaddress}}'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testcases:
- name: register_device_on_the_portal
steps:
- type: exec
script: ssh -o "ConnectTimeout 3" -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "root@192.168.1.10" -t "/root/register_node -portal=https://100.64.0.2"
script: ssh -o "ConnectTimeout 3" -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "root@{{.inline_l3.node.ipaddress}}" -t "/root/register_node -portal=https://100.64.0.2"

# let wait a bit until the device is set in the ipset
- type: exec
Expand All @@ -12,15 +12,15 @@ testcases:
- name: test_if_the_device_is_in_the_ipset_register_set
steps:
- type: exec
script: ipset test pfsession_Reg_192.168.1.0 192.168.1.10
script: 'ipset test pfsession_Reg_{{.inline_l3.routed_networks}} {{.inline_l3.node.ipaddress}}'


- name: test_if_the_device_is_in_the_ipset_role_id_1
steps:
- type: exec
script: ipset test PF-iL3_ID1_192.168.1.0 192.168.1.10
script: 'ipset test PF-iL3_ID1_{{.inline_l3.routed_networks}} {{.inline_l3.node.ipaddress}}'

- name: test_if_the_device_can_reach_cnn_com
steps:
- type: exec
script: ssh -o "ConnectTimeout 3" -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "root@192.168.1.10" -t "/root/test_internet_access"
script: ssh -o "ConnectTimeout 3" -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "root@{{.inline_l3.node.ipaddress}}" -t "/root/test_internet_access"
14 changes: 7 additions & 7 deletions t/venom/test_suites/inline/l3/30_trigger_violation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ testcases:
steps:
- type: http
method: PUT
url: '{{.pfserver_webadmin_url}}/api/v1/node/02:06:19:98:00:00/apply_security_event'
url: '{{.pfserver_webadmin_url}}/api/v1/node/{{.inline_l3.node.macaddress}}/apply_security_event'
ignore_verify_ssl: true
body: >-
{
"id": "02:06:19:98:00:00",
"mac": "02:06:19:98:00:00",
"id": "{{.inline_l3.node.macaddress}}",
"mac": "{{.inline_l3.node.macaddress}}",
"security_event_id": "1300000"
}
headers:
Expand All @@ -31,18 +31,18 @@ testcases:
script: sleep 5

- type: exec
script: ipset test pfsession_Isol_192.168.1.0 192.168.1.10
script: 'ipset test pfsession_Isol_{{.inline_l3.routed_networks}} {{.inline_l3.node.ipaddress}}'

- name: release_violation_on_the_node
steps:
- type: http
method: PUT
url: '{{.pfserver_webadmin_url}}/api/v1/node/02:06:19:98:00:00/close_security_event'
url: '{{.pfserver_webadmin_url}}/api/v1/node/{{.inline_l3.node.macaddress}}/close_security_event'
ignore_verify_ssl: true
body: >-
{
"security_event_id": "{{.trigger_a_violation_on_the_node.vid}}",
"mac": "02:06:19:98:00:00"
"mac": "{{.inline_l3.node.macaddress}}"
}
headers:
"Authorization": "{{.get_login_token.result.token}}"
Expand All @@ -57,5 +57,5 @@ testcases:
script: sleep 5

- type: exec
script: ipset test pfsession_Reg_192.168.1.0 192.168.1.10
script: 'ipset test pfsession_Reg_{{.inline_l3.routed_networks}} {{.inline_l3.node.ipaddress}}'

8 changes: 4 additions & 4 deletions t/venom/test_suites/inline/l3/35_change_role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ testcases:
steps:
- type: http
method: PATCH
url: '{{.pfserver_webadmin_url}}/api/v1/node/02:06:19:98:00:00'
url: '{{.pfserver_webadmin_url}}/api/v1/node/{{.inline_l3.node.macaddress}}'
ignore_verify_ssl: true
body: >-
{
"id": "02:06:19:98:00:00",
"id": "{{.inline_l3.node.macaddress}}",
"category": "guest",
"category_id": 2,
"mac": "02:06:19:98:00:00",
"mac": "{{.inline_l3.node.macaddress}}",
"tenant_id": 1
}
headers:
Expand All @@ -30,5 +30,5 @@ testcases:
script: sleep 5

- type: exec
script: ipset test PF-iL3_ID2_192.168.1.0 192.168.1.10
script: 'ipset test PF-iL3_ID2_{{.inline_l3.routed_networks}} {{.inline_l3.node.ipaddress}}'

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ testcases:
steps:
- type: http
method: DELETE
url: '{{.pfserver_webadmin_url}}/api/v1/config/routed_network/192.168.1.0'
url: '{{.pfserver_webadmin_url}}/api/v1/config/routed_network/{{.inline_l3.routed_networks}}'
ignore_verify_ssl: true
headers:
"Authorization": "{{.get_login_token.result.token}}"
Expand Down
11 changes: 11 additions & 0 deletions t/venom/vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,14 @@ pfdhcplistener_multi_tenant.nodes.node11.dhcp_server: 10.10.10.1
# fingerbank_proxy test suite specific variables
################################################################################
fingerbank_proxy_test_wan_ip: 1.1.1.1


################################################################################
## fingerbank_proxy test suite specific variables
#################################################################################
inline_l3.node.macaddress: 02:06:19:98:00:00
inline_l3.node.ipaddress: 192.168.1.10
inline_l3.routed_networks: 192.168.1.0



0 comments on commit afbb74d

Please sign in to comment.