Skip to content

Comments

OVAL service templates should check if service is running/not running#2433

Merged
yuumasato merged 1 commit intoComplianceAsCode:masterfrom
redhatrises:check_service_running
Oct 31, 2017
Merged

OVAL service templates should check if service is running/not running#2433
yuumasato merged 1 commit intoComplianceAsCode:masterfrom
redhatrises:check_service_running

Conversation

@redhatrises
Copy link
Contributor

@redhatrises redhatrises commented Oct 24, 2017

Description:

  • OVAL service templates should check if service is running/not running

Rationale:

@redhatrises redhatrises added the bugfix Fixes to reported bugs. label Oct 24, 2017
@redhatrises redhatrises added this to the 0.1.36 milestone Oct 24, 2017
@redhatrises redhatrises force-pushed the check_service_running branch 2 times, most recently from 0dc643c to 7ea14eb Compare October 30, 2017 17:35
Copy link
Member

@yuumasato yuumasato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tests for service_disabled and service_enabled that helped find some issues.

<linux:dependency entity_check="at least one">%SERVICENAME%.socket</linux:dependency>
</linux:systemdunitdependency_state>

<linux:systemdunitproperty_test id="test_service_running_%SERVICENAME%" check="all" check_existence="at_least_one_exists" comment="Test that the %SERVICENAME% service is running" version="1">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All test_service_running_ should have check="at least one". It is enough that either service or socket is in active state.

<linux:dependency entity_check="none satisfy">%SERVICENAME%.socket</linux:dependency>
</linux:systemdunitdependency_state>

<linux:systemdunitproperty_test id="test_service_not_running_%SERVICENAME%" check="all" check_existence="at_least_one_exists" comment="Test that the %SERVICENAME% service is not running" version="1">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All test_service_not_running_ should have `check_existence="any_exist", as it should be ok to not find the unit.

@yuumasato
Copy link
Member

@redhatrises Is the reference to the issue in "Fixes" list correct? I don't understand the relationship.

@redhatrises redhatrises force-pushed the check_service_running branch from 19d22d0 to dd020c0 Compare October 31, 2017 15:21
@redhatrises
Copy link
Contributor Author

@redhatrises Is the reference to the issue in "Fixes" list correct? I don't understand the relationship.

Thanks @yuumasato. The reference to the issue was a typo.

@yuumasato yuumasato merged commit d6c2fc6 into ComplianceAsCode:master Oct 31, 2017
@redhatrises redhatrises deleted the check_service_running branch October 31, 2017 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes to reported bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants