Skip to content

environment: move tags to separate file

Filip Pokryvka requested to merge devel/fp/tags into master

Make tag handling more readable:

  • use separate file for before/after scenario routines for each tag
  • use separate file for general routines (restart, reload, log...)
  • make definitions of before and after scenario of the same tag close to each other
  • use "pyramid" logic:
    • in before_scenario run tags in order they are registered
    • in after_scenario run tags in reverse order
  • each tag can be defined only once - if this proves to be problem, we can discard this condition
  • remove unwanted try catch blocks

If exception occurs, behave fails the test automatically. Also, the code before after_scenario tags is simplified and no exception should be raised there (otherways cleanup is not done).

If exception/assert is raised in before_scenario, behave fails the test and executes after_scenario. The following message is visible in the output:

HOOK-ERROR in after_scenario: NameError: name 'bbb' is not defined

@RunTests:team_abs_set_link_watchers_nsna_ping,team_abs_set_link_watchers_arp_ping,team_abs_set_link_watchers_arp_ping_vlanid,team_abs_overwrite_watchers,nmcli_device_show_ip,nmcli_general_dhcp_hostname_over_localhost,nmtui_bridge_custom_bridge_port,nmtui_bridge_over_ethernet_and_vlan,nmtui_team_json_set_loadbalance_mode,nmtui_team_json_set_broadcast_mode,nmtui_team_json_set_invalid_mode,team_abs_set_runners,ipv4_dhcp_client_id_set,ipv4_dhcp_client_id_remove,ethtool_features_ring,ethtool_features_coal,general_check_version,shutdown_service_connected,nmcli_device_show_ip,NM_syslog_in_anaconda,iptunnel_gretap_doc_procedure,wireguard_activate_connection,connection_veth_profile_duplication,dns_resolved_two_default,dns_resolved_one_default,dns_resolved_two_default_with_priority,dns_resolved_two_default_with_negative_priority,dns_resolved_no_default,dns_resolved_full_tunnel_vpn,dns_resolved_split_tunnel_vpn,dns_resolved_add_remove_ipv6_dns,dns_priority,dns_priority_config,dns_default_two_default,dns_default_one_default,dns_default_two_default_with_priority,dns_default_two_default_with_negative_priority,dns_default_no_default,dns_default_full_tunnel_vpn,dns_default_split_tunnel_vpn,dns_default_split_tunnel_vpn_same_priority,dns_dnsmasq_two_default,dns_dnsmasq_one_default,dns_dnsmasq_two_default_with_priority,dns_dnsmasq_two_default_with_negative_priority,dns_dnsmasq_no_default,dns_dnsmasq_full_tunnel_vpn,dns_dnsmasq_split_tunnel_vpn,dns_dnsmasq_driver_removal,dns_dnsmasq_kill,dns_dnsmasq_kill_ratelimit,dns_multiple_options,dns_none,remove_dns_none,resolv_conf_dangling_symlink,resolv_conf_do_not_overwrite_symlink

Edited by Filip Pokryvka

Merge request reports