{{% set system_configuration_using_etc_bashrc_expected = false -%}}

{{% if product in ["ol7", "rhel7"] -%}} {{% set system_configuration_using_etc_bashrc_expected = true %}} {{%- endif -%}} {{{ oval_metadata("Checks interactive shell timeout") }}} {{% if "ubuntu" in product %}} {{% endif %}} {{% if system_configuration_using_etc_bashrc_expected %}} {{% endif %}} {{% macro test_tmout(test_stem, files) %}} {{% endmacro %}} {{% macro object_tmout(test_stem, path, filename, filepath) %}} {{% if path %}} {{{ path }}} {{% endif %}} {{% if filename %}} `{{{ filename }}}` {{% endif %}} {{% if filepath %}} {{{ filepath }}} {{% endif %}} {{% if product in ['sle12', 'sle15'] or "ubuntu" in product %}} ^[\s]*TMOUT=([\w$]+)[\s]*readonly TMOUT[\s]*export TMOUT$ {{% else %}} ^[\s]*declare[\s]+-xr[\s]+TMOUT=([\w$]+).*$ {{% endif %}} 1 {{% endmacro %}} {{% if 'ubuntu' in product %}} {{{ test_tmout( test_stem="etc_bashrc_tmout", files="/etc/bash.bashrc") }}} {{{ object_tmout(test_stem="etc_bashrc_tmout", filepath="/etc/bash.bashrc") }}} {{% endif %}} {{{ test_tmout( test_stem="etc_profile_tmout", files="/etc/profile") }}} {{{ object_tmout(test_stem="etc_profile_tmout", filepath="/etc/profile") }}} {{{ test_tmout( test_stem="etc_profiled_tmout", files="/etc/profile.d/*.sh") }}} {{{ object_tmout(test_stem="etc_profiled_tmout", path="/etc/profile.d", filename="^.*\.sh$") }}} {{% if system_configuration_using_etc_bashrc_expected %}} {{{ test_tmout( test_stem="etc_bashrc_tmout", files="/etc/bashrc") }}} {{{ object_tmout(test_stem="etc_bashrc_tmout", filepath="/etc/bashrc") }}} {{% endif %}} {{% if system_configuration_using_etc_bashrc_expected %}} object_etc_bashrc_tmout object_accounts_tmout_partial_tmout_instances object_etc_profile_tmout object_etc_profiled_tmout {{% else %}} object_etc_profile_tmout object_etc_profiled_tmout {{% endif %}} variable_count_of_tmout_instances 1