<commit_before>test_name 'C59029: networking facts should be fully populated' do
  tag 'risk:high'

  #
  # This test is intended to ensure that networking facts resolve
  # as expected across supported platforms.
  #

  @ip_regex       = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
  @netmask_regex  = /^(((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(0|128|192|224|240|248|252|254)\.0\.0)|(255\.255\.(0|128|192|224|240|248|252|254)\.0)|(255\.255\.255\.(0|128|192|224|240|248|252|254)))$/

  expected_networking = {
    %w[networking dhcp] => agent['platform'] =~ /fedora-32|el-8-aarch64/ ? '' : @ip_regex, # https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/426
    %w[networking ip] => @ip_regex,
    %w[networking ip6] => /[a-f0-9]+:+/,
    %w[networking mac] => /[a-f0-9]{2}:/,
    %w[networking mtu] => /\d+/,
    %w[networking netmask] => @netmask_regex,
    %w[networking netmask6] => /[a-f0-9]+:/,
    %w[networking network] => @ip_regex,
    %w[networking network6] => /([a-f0-9]+)?:([a-f0-9]+)?/,
    %w[networking scope6] => /link|host|site|global|compat/
  }

  agents.each do |agent|
    primary_interface = fact_on(agent, 'networking.primary')<commit_msg>(maint) adapt test for RHEL 8 PPC<commit_after>test_name 'C59029: networking facts should be fully populated' do
  tag 'risk:high'

  #
  # This test is intended to ensure that networking facts resolve
  # as expected across supported platforms.
  #

  @ip_regex       = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
  @netmask_regex  = /^(((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(0|128|192|224|240|248|252|254)\.0\.0)|(255\.255\.(0|128|192|224|240|248|252|254)\.0)|(255\.255\.255\.(0|128|192|224|240|248|252|254)))$/

  expected_networking = {
    %w[networking dhcp] => agent['platform'] =~ /fedora-32|el-8-aarch64|el-8-ppc64le/ ? '' : @ip_regex, # https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/426
    %w[networking ip] => @ip_regex,
    %w[networking ip6] => /[a-f0-9]+:+/,
    %w[networking mac] => /[a-f0-9]{2}:/,
    %w[networking mtu] => /\d+/,
    %w[networking netmask] => @netmask_regex,
    %w[networking netmask6] => /[a-f0-9]+:/,
    %w[networking network] => @ip_regex,
    %w[networking network6] => /([a-f0-9]+)?:([a-f0-9]+)?/,
    %w[networking scope6] => /link|host|site|global|compat/
  }

  agents.each do |agent|
    primary_interface = fact_on(agent, 'networking.primary')
{'fraction_non_alphanumeric': 0.2524850894632207, 'fraction_numerical': 0.136779324055666, 'mean_word_length': 3.943025540275049, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1202903', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1090, 'n_words': 145}