{{% if ESCAPE_TEXT %}}
  {{%- set regex = "^[\s]*" ~ (TEXT | escape_regex) ~ "[\s]*$" -%}}
{{% else %}}
  {{%- set regex = "^[\s]*" ~ TEXT ~ "[\s]*$" -%}}
{{% endif %}}
<def-group>
  <definition class="compliance" id="{{{ rule_id }}}" version="1">
    {{{ oval_metadata("Check presence of " + TEXT + " in " + PATH, rule_title=rule_title) }}}
    <criteria operator="AND" comment="Test conditions - presence of the file plus {{{ OVAL_EXTEND_DEFINITIONS | length }}} extra definitions.">
      {{%- for def in OVAL_EXTEND_DEFINITIONS %}}
     <extend_definition comment="extend_definition added explicitly" definition_ref="{{{ def }}}" />
      {{%- endfor %}}
      <criterion comment="Check that {{{ PATH }}} contains a line with certain text" test_ref="test_{{{ rule_id }}}" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all"
  comment="tests the presence of '{{{ TEXT }}}' setting in the {{{ PATH }}} file"
  id="test_{{{ rule_id }}}" version="1">
  <ind:object object_ref="obj_{{{ rule_id }}}" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="obj_{{{ rule_id }}}" version="1">
    <ind:filepath>{{{ PATH }}}</ind:filepath>
    <ind:pattern operation="pattern match">{{{ regex }}}</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
