<def-group>
  <definition class="compliance" id="package_chrony_installed"
  version="1">
    <metadata>
        <title>The Chrony package is installed</title>
            <affected family="unix">
                <platform>multi_platform_all</platform>
            </affected>
        <description>The DPKG package chrony should be installed.</description>
    </metadata>
    <criteria operator="OR" comment="package chrony is installed or not needed">
      <criteria comment="chrony is not needed" operator="AND">
        <criterion comment="variable var_timesync_service is set to chronyd"
        test_ref="package_chrony_installed_test_variable_var_timesync_service" negate="true"/>
      </criteria>
      <criteria comment="package chrony is installed and needed" operator="AND">
        <criterion comment="package chrony is installed"
        test_ref="test_package_chrony_installed" />
        <criterion comment="variable var_timesync_service is set to chronyd"
        test_ref="package_chrony_installed_test_variable_var_timesync_service" />
      </criteria>
    </criteria>
  </definition>
<ind:variable_test id="package_chrony_installed_test_variable_var_timesync_service"
  comment="Check external var_timesync_service is set to chronyd" check="all" version="1">
    <ind:object object_ref="obj_package_chrony_installed_test_variable_var_timesync_service"/>
    <ind:state state_ref="ste_package_chrony_installed_test_variable_var_timesync_service" />
  </ind:variable_test>

  <ind:variable_object id="obj_package_chrony_installed_test_variable_var_timesync_service" version="1">
    <ind:var_ref>var_timesync_service</ind:var_ref>
  </ind:variable_object>
  <ind:variable_state id="ste_package_chrony_installed_test_variable_var_timesync_service" version="1">
    <ind:value operation="equals" datatype="string">chronyd</ind:value>
  </ind:variable_state>

  <external_variable comment="External variable var_timesync_service" datatype="string" id="var_timesync_service" version="1" />

  <linux:dpkginfo_test check="all" check_existence="all_exist"
  id="test_package_chrony_installed" version="1"
  comment="package chrony is installed">
    <linux:object object_ref="obj_test_package_chrony_installed" />
    
  </linux:dpkginfo_test>
  <linux:dpkginfo_object id="obj_test_package_chrony_installed" version="1">
    <linux:name>chrony</linux:name>
  </linux:dpkginfo_object>
  

</def-group>