Skip to content

Commit

Permalink
Merge branch 'sonic-net:master' into test_orchagent_standby_tor_downs…
Browse files Browse the repository at this point in the history
…tream_failure_fix
  • Loading branch information
AnantKishorSharma authored Jan 5, 2024
2 parents 0290b58 + 6c7190e commit f3834b9
Show file tree
Hide file tree
Showing 1,346 changed files with 139,860 additions and 84,949 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: BaselineTest_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

trigger: none
pr: none

schedules:
- cron: "0 4 * * *"
displayName: Baseline test Scheduler
branches:
include:
- master
always: true

stages:
- stage: Pre_test
variables:
- group: GIT_SECRETS
jobs:
- job: validate_test_cases
displayName: "Validate Test Cases"
timeoutInMinutes: 20
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../pytest-collect-only.yml

- stage: Test_round_1
dependsOn:
- Pre_test
condition: succeeded('Pre_test')
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
- group: GIT_SECRETS
jobs:
- template: baseline.test.template.yml

- stage: Test_round_2
dependsOn:
- Pre_test
- Test_round_1
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_1'))
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
- group: GIT_SECRETS
jobs:
- template: baseline.test.template.yml

- stage: Test_round_3
dependsOn:
- Pre_test
- Test_round_2
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_2'))
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
- group: GIT_SECRETS
jobs:
- template: baseline.test.template.yml

- stage: Test_round_4
dependsOn:
- Pre_test
- Test_round_3
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_3'))
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
- group: GIT_SECRETS
jobs:
- template: baseline.test.template.yml
134 changes: 134 additions & 0 deletions .azure-pipelines/baseline_test/baseline.test.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
jobs:
- job: t0_elastictest
displayName: "kvmtest-t0 by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t0
MIN_WORKER: $(T0_INSTANCE_NUM)
MAX_WORKER: $(T0_INSTANCE_NUM)
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)

- job: t0_2vlans_elastictest
displayName: "kvmtest-t0-2vlans by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t0
TEST_SET: t0-2vlans
MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM)
MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM)
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a"
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)

- job: t1_lag_elastictest
displayName: "kvmtest-t1-lag by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t1-lag
MIN_WORKER: $(T1_LAG_INSTANCE_NUM)
MAX_WORKER: $(T1_LAG_INSTANCE_NUM)
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)

- job: dualtor_elastictest
displayName: "kvmtest-dualtor-t0 by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../run-test-elastictest-template.yml
parameters:
TOPOLOGY: dualtor
MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
COMMON_EXTRA_PARAMS: "--disable_loganalyzer "
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)

- job: multi_asic_elastictest
displayName: "kvmtest-multi-asic-t1-lag by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t1-8-lag
TEST_SET: multi-asic-t1-lag
MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
NUM_ASIC: 4
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)

- job: sonic_t0_elastictest
displayName: "kvmtest-t0-sonic by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t0-64-32
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
TEST_SET: t0-sonic
COMMON_EXTRA_PARAMS: "--neighbor_type=sonic "
VM_TYPE: vsonic
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)

- job: dpu_elastictest
displayName: "kvmtest-dpu by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../run-test-elastictest-template.yml
parameters:
TOPOLOGY: dpu
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)
65 changes: 65 additions & 0 deletions .azure-pipelines/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import os
import sys
import logging
import json

_self_dir = os.path.dirname(os.path.abspath(__file__))
base_path = os.path.realpath(os.path.join(_self_dir, ".."))
if base_path not in sys.path:
sys.path.append(base_path)
ansible_path = os.path.realpath(os.path.join(_self_dir, "../ansible"))
if ansible_path not in sys.path:
sys.path.append(ansible_path)

from tests.common.plugins.pdu_controller.pdu_manager import pdu_manager_factory # noqa E402

logger = logging.getLogger(__name__)


def get_pdu_managers(sonichosts, conn_graph_facts):
"""Get PDU managers for all the devices to be upgraded.
Args:
sonichosts (SonicHosts): Instance of class SonicHosts
conn_graph_facts (dict): Connection graph dict.
Returns:
dict: A dict of PDU managers. Key is device hostname. Value is the PDU manager object for the device.
"""
pdu_managers = {}
device_pdu_links = conn_graph_facts['device_pdu_links']
device_pdu_info = conn_graph_facts['device_pdu_info']
for hostname in sonichosts.hostnames:
pdu_links = device_pdu_links[hostname]
pdu_info = device_pdu_info[hostname]
pdu_vars = {}
for pdu_name in pdu_info.keys():
pdu_vars[pdu_name] = sonichosts.get_host_visible_vars(pdu_name)

pdu_managers[hostname] = pdu_manager_factory(hostname, pdu_links, pdu_info, pdu_vars)
return pdu_managers


def check_reachability(localhost, sonichosts):
hosts_reachability = {}

logger.info("Check ICMP ping")
for hostname, ip in zip(sonichosts.hostnames, sonichosts.ips):
hosts_reachability[hostname] = True
logger.info("Ping {} @{} from localhost".format(hostname, ip))
ping_failed = localhost.command(
"timeout 2 ping {} -c 1".format(ip), module_ignore_errors=True
).get("localhost", {}).get("failed")
if ping_failed:
logger.info("Ping {} @{} from localhost failed.".format(hostname, ip))
hosts_reachability[hostname] = False

logger.info("Check if ansible can SSH to sonichosts")
for hostname, ping_result in sonichosts.ping(module_ignore_errors=True).items():
if ping_result["failed"]:
logger.info("SSH to {} failed.".format(hostname))
hosts_reachability[hostname] = False

logger.info("Hosts reachability: {}".format(json.dumps(hosts_reachability, indent=2)))

return hosts_reachability
7 changes: 4 additions & 3 deletions .azure-pipelines/get_dut_version.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import argparse
import logging
import os
Expand All @@ -13,7 +15,7 @@
if ansible_path not in sys.path:
sys.path.append(ansible_path)

from devutil.devices import init_localhost, init_testbed_sonichosts # noqa E402
from devutil.devices.factory import init_localhost, init_testbed_sonichosts # noqa E402

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -122,9 +124,8 @@ def main(args):

parser.add_argument(
"-i", "--inventory",
type=str,
dest="inventory",
required=True,
nargs="+",
help="Ansible inventory file")

parser.add_argument(
Expand Down
25 changes: 24 additions & 1 deletion .azure-pipelines/pr_test_scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ t0:
- generic_config_updater/test_ecn_config_update.py
- iface_namingmode/test_iface_namingmode.py
- lldp/test_lldp.py
- memory_checker/test_memory_checker.py
- minigraph/test_masked_services.py
- monit/test_monit_status.py
- ntp/test_ntp.py
- override_config_table/test_override_config_table.py
- pc/test_po_cleanup.py
- pc/test_po_update.py
# - platform_tests/test_advanced_reboot.py::test_warm_reboot
- platform_tests/test_advanced_reboot.py::test_warm_reboot
- platform_tests/test_cpu_memory_usage.py
- process_monitoring/test_critical_process_monitoring.py
- radv/test_radv_ipv6_ra.py
Expand All @@ -47,6 +49,7 @@ t0:
- snmp/test_snmp_cpu.py
- snmp/test_snmp_default_route.py
- snmp/test_snmp_interfaces.py
- snmp/test_snmp_link_local_ip.py
- snmp/test_snmp_lldp.py
- snmp/test_snmp_loopback.py
- snmp/test_snmp_pfc_counters.py
Expand All @@ -62,10 +65,12 @@ t0:
- tacacs/test_ro_user.py
- tacacs/test_rw_user.py
- telemetry/test_telemetry.py
- telemetry/test_events.py
- test_features.py
- test_interfaces.py
- test_procdockerstatsd.py
- database/test_db_scripts.py
- system_health/test_watchdog.py

t0-2vlans:
- dhcp_relay/test_dhcp_relay.py
Expand All @@ -78,6 +83,8 @@ t0-sonic:
- macsec/test_deployment.py
- macsec/test_fault_handling.py
- macsec/test_interop_protocol.py
- pc/test_retry_count.py
- platform_tests/test_advanced_reboot.py::test_warm_reboot

dualtor:
- arp/test_arp_extended.py
Expand All @@ -95,6 +102,7 @@ t1-lag:
- container_checker/test_container_checker.py
- generic_config_updater/test_mmu_dynamic_threshold_config_update.py
- http/test_http_copy.py
- iface_namingmode/test_iface_namingmode.py
- ipfwd/test_mtu.py
- lldp/test_lldp.py
- monit/test_monit_status.py
Expand All @@ -111,6 +119,7 @@ multi-asic-t1-lag:
- bgp/test_bgp_fact.py
- bgp/test_bgp_update_timer.py
- snmp/test_snmp_default_route.py
- snmp/test_snmp_link_local_ip.py
- snmp/test_snmp_loopback.py
- snmp/test_snmp_pfc_counters.py
- snmp/test_snmp_queue.py
Expand Down Expand Up @@ -148,3 +157,17 @@ wan-pub:
- tacacs/test_ro_disk.py
- tacacs/test_authorization.py
- tacacs/test_accounting.py

dpu:
- dash/test_dash_vnet.py

specific_param:
t0-sonic:
- name: bgp/test_bgp_fact.py
param: "--neighbor_type=sonic --enable_macsec --macsec_profile=128_SCI,256_XPN_SCI"
# all the test modules under macsec directory
- name: macsec
param: "--neighbor_type=sonic --enable_macsec --macsec_profile=128_SCI,256_XPN_SCI"
dpu:
- name: dash/test_dash_vnet.py
param: " --skip_dataplane_checking "
Loading

0 comments on commit f3834b9

Please sign in to comment.