├── .github └── workflows │ └── centos-stream8.yml ├── .gitignore ├── AUTHORS ├── Container-8.test ├── Container-9.test ├── README.lightweight ├── README.md ├── centos_ci_build ├── preupdates ├── CentOS-Base.repo ├── CentOS-Base.repo.aarch64 ├── CentOS-Base.repo.c5 ├── CentOS-Base.repo.c5.fasttrack ├── CentOS-Base.repo.centosplus ├── CentOS-Base.repo.extras ├── CentOS-Base.repo.extras.aarch64 ├── CentOS-Base.repo.extras.i386 ├── CentOS-Base.repo.extras.ppc64 ├── CentOS-Base.repo.extras.ppc64le ├── CentOS-Base.repo.fasttrack ├── CentOS-Base.repo.i386 ├── CentOS-Base.repo.ppc64 └── CentOS-Base.repo.ppc64le ├── runtests.sh ├── serial-tests.sh ├── skipped-tests.list ├── t_functional_duffy_runner ├── .gitignore ├── README.md ├── pyproject.toml ├── requirements.txt ├── setup.cfg ├── setup.py └── src │ ├── __init__.py │ └── __main__.py ├── test_incomplete └── user.sh ├── tests ├── 0_common │ ├── 000_centos_default_repos.py │ ├── 00_centos_repos.sh │ ├── 01_dist_release_check.sh │ ├── 03_print_booted_kernel.sh │ ├── 05_stop_yumupdatesd.sh │ ├── 10_remove_32bitpkgs.sh │ ├── 15_list_repos.sh │ ├── 20_upgrade_all.sh │ ├── 30_dns_works.sh │ ├── 40_update_hosts.sh │ ├── 50_test_comps.sh │ └── readme ├── 0_lib │ ├── functions.sh │ └── readme ├── p_abrt-cli │ ├── 0-install_abrt-cli.sh │ ├── 10-abrt-cli-reporting-test.sh │ ├── 5-abrt-cli-test.sh │ ├── _CentOSBugTracker.conf │ ├── _attachment_file │ ├── _expect │ ├── _expect_report │ ├── _lib.sh │ ├── _mantisbt.conf │ ├── _mantisbt_format.conf │ ├── _mantisbt_formatdup.conf │ ├── _pyserve │ ├── problem_dir │ │ ├── analyzer │ │ ├── architecture │ │ ├── backtrace │ │ ├── backtrace_rating │ │ ├── cmdline │ │ ├── component │ │ ├── crash_function │ │ ├── dso_list │ │ ├── duphash │ │ ├── executable │ │ ├── hostname │ │ ├── kernel │ │ ├── maps │ │ ├── os_release │ │ ├── package │ │ ├── reason │ │ ├── time │ │ ├── type │ │ ├── uid │ │ ├── username │ │ ├── uuid │ │ ├── var_log_messages │ │ └── xsession_errors │ └── queries │ │ ├── add_note │ │ ├── attachment │ │ ├── create │ │ ├── dummy │ │ ├── get_custom_fields │ │ ├── get_issue │ │ ├── get_issue_closed_as_duplicate │ │ ├── get_issue_comment_rating_1 │ │ ├── get_issue_dup_comment_rating_1 │ │ ├── login_correct │ │ ├── login_incorrect │ │ ├── project_get_id_from_name │ │ ├── search_no_issue │ │ ├── search_one_issue │ │ └── search_two_issues ├── p_abrt │ ├── 0-install_abrt.sh │ └── abrt_gpg_keys_test.sh ├── p_acl │ ├── 0-install_acl.sh │ └── acl_set_get_test.sh ├── p_amanda │ ├── 0-install_amanda.sh │ └── amanda-server_test.sh ├── p_anaconda │ ├── 0-install_anaconda.sh │ └── anaconda_centos_patch.sh ├── p_annobin │ ├── 0-install_annobin.sh │ ├── 10-test_annobin-gcc.sh │ └── 20-test_annobin-gcc-c++.sh ├── p_arpwatch │ ├── 0_install_arpwatch.sh │ └── 10_arpwatch_test.sh ├── p_attr │ ├── 0-install-attr.sh │ └── attr_check_installed.sh ├── p_audit │ ├── 0_install_auditd.sh │ ├── 1_auditd_running.sh │ ├── 2_auditd_generate-events.sh │ └── 3_auditd_logging.sh ├── p_autofs │ ├── 0-install_autofs.sh │ └── 10-autofs-nfs-mount.sh ├── p_bash │ └── bash_version_info_test.sh ├── p_bc │ ├── 0-install_bc.sh │ ├── 10-bc-installed-test.sh │ ├── 20-bc-test-simple-calculation.sh │ ├── bc-test-basic-functionalities.sh │ └── bc-test-installation.sh ├── p_bind │ ├── 0-install_bind.sh │ └── bind_test.sh ├── p_bridge-utils │ ├── 00-install_bridge-utils.sh │ ├── 05-add_bridge.sh │ ├── 10-delete_bridge.sh │ └── p_bridge-utils-functions ├── p_busybox │ ├── 00_install_busybox.sh │ ├── 10_test_busybox.sh │ └── 20_functiontest_busybox.sh ├── p_bzip2 │ ├── 0_install_bzip2.sh │ └── 10-bzip2-test.sh ├── p_centos-release │ ├── 0-install_file.sh │ ├── centos-release_centos-base_repos.sh │ ├── centos-release_centos_gpg.sh │ ├── centos-release_issue.sh │ ├── centos-release_os-release.sh │ ├── centos-release_release_compat_symlinks.sh │ └── centos-release_system_release.sh ├── p_chkconfig │ └── chkconfig_list_services.sh ├── p_coreutils │ ├── 0-install_coreutils.sh │ ├── arch.sh │ ├── basename.sh │ ├── cat.sh │ ├── cut.sh │ ├── false.sh │ ├── head.sh │ ├── pathchk.sh │ ├── readlink.sh │ ├── seq.sh │ ├── sleeptimeout.sh │ ├── tail.sh │ ├── test_hashsums.sh │ ├── touch.sh │ ├── true.sh │ ├── uniq.sh │ ├── wc.sh │ └── yes.sh ├── p_cpio │ ├── 0_install_cpio │ └── 10-cpio-tests ├── p_cracklib │ ├── 0-install_cracklib.sh │ └── cracklib_passwordtest.sh ├── p_cron │ ├── 0-install_cron.sh │ ├── cron_crontab_daily_test.sh │ ├── cron_crontab_hourly_test.sh │ └── cron_crontab_weekly_test.sh ├── p_curl │ ├── 0-install_curl.sh │ └── curl_test.sh ├── p_diffutils │ ├── 0_install_diffutils │ ├── 10-cmp-tests │ ├── 20-diff-tests │ ├── 30-diff3-tests │ ├── 40-sdiff-tests │ ├── TODO │ └── files │ │ ├── F │ │ ├── F-G │ │ ├── G │ │ ├── H │ │ ├── context_format │ │ ├── context_format-1 │ │ ├── diff3_easy_only │ │ ├── diff3_ed_script │ │ ├── diff3_i │ │ ├── diff3_label │ │ ├── diff3_merge │ │ ├── diff3_normal │ │ ├── diff3_overlap_only │ │ ├── diff3_show_all │ │ ├── diff3_show_overlap │ │ ├── diff_pager │ │ ├── dir │ │ ├── dir_N │ │ ├── dir_X │ │ ├── dir_case │ │ ├── dir_new_file │ │ ├── dir_r │ │ ├── dir_s │ │ ├── dir_unidirectional │ │ ├── dir_x │ │ ├── e_F-G │ │ ├── ed_script │ │ ├── ed_script-f │ │ ├── exclude │ │ ├── if_then_else │ │ ├── label-change │ │ ├── lao │ │ ├── left_column │ │ ├── n_F-G │ │ ├── normal_format │ │ ├── paginate │ │ ├── rcs_script │ │ ├── sdiff_input │ │ ├── sdiff_output │ │ ├── side-by-side-W72 │ │ ├── supress_common_lines │ │ ├── tao │ │ ├── tzu │ │ ├── unified_format │ │ └── unified_format-1 ├── p_dovecot │ ├── 0-install_dovecot.sh │ ├── 1-config_dovecot.sh │ ├── dovecot_imap_login.sh │ └── dovecot_pop3_login.sh ├── p_exim │ ├── 0-install_exim.sh │ ├── 10-test-sendmail.sh │ ├── 15_exim_smtp.sh │ ├── 20_exim_mta_helo-test.sh │ ├── 30_exim_mta_ehlo-test.sh │ ├── _helper_exim_ehlo.expect │ └── _helper_exim_helo.expect ├── p_file │ ├── 00_file_package.sh │ ├── 01_file_mime_application.sh │ ├── 02_file_mime_image.sh │ └── 03_file_mime_symlink.sh ├── p_findutils │ ├── 0-install_findutils │ ├── 10-find_tests │ └── 20-xargs_tests ├── p_firefox │ ├── 00-install_firefox.sh │ └── 10-check_default_startpage.sh ├── p_freeradius │ ├── 00-install_freeradius.sh │ └── 10_radiusd_test.sh ├── p_gcc-c++ │ ├── 0-install_gcc-c++.sh │ └── 1-test_hello_world.sh ├── p_gcc-gnat │ ├── 0-install_gcc-gnat.sh │ └── test_gcc-gnat.sh ├── p_gcc │ ├── 0-install_gcc.sh │ └── test_gcc.sh ├── p_git │ ├── 0-install_git.sh │ ├── 10-test_git.sh │ ├── 11-test_git_clone.sh │ └── 12-test_git_log.sh ├── p_grep │ ├── 00-install_grep.sh │ ├── 10-test_grep.sh │ ├── 11-test_grep.sh │ └── 13-test_grep.sh ├── p_grub │ └── grub_dir_layout_test.sh ├── p_grub2 │ └── 01_grub2_secureboot_signed.sh ├── p_gzip │ ├── 0_install_gzip.sh │ ├── 10-C5-test-binaries │ ├── 10-test-binaries │ ├── 20-gzip-test │ ├── 30-gzexe-test │ ├── 40-gcmp-gdiff-tests │ ├── 50-zgrep-tests │ ├── 60-zforce-tests │ ├── 70-zless-tests │ ├── 80-zmore-tests │ ├── 90-znew-tests │ └── gzip-test.txt.gz ├── p_httpd │ ├── 0-install_httpd.sh │ ├── httpd_basic_auth.sh │ ├── httpd_centos_brand_server_tokens.sh │ ├── httpd_centos_brand_welcome.sh │ ├── httpd_php.sh │ ├── httpd_servehtml.sh │ ├── httpd_servehtml_ssl.sh │ └── httpd_vhost.sh ├── p_initscripts │ ├── initscripts_centos_brand_rcsysinit.sh │ └── initscripts_service_status.sh ├── p_ipa-server │ ├── 0-preclean.sh │ ├── 1-install_freeipa.sh │ ├── 2-configure_freeipa.sh │ ├── 3-verify_kerberos_tickets.sh │ ├── 4-adduser.sh │ ├── 5-addservice.sh │ ├── 6-dnsdetails.sh │ ├── 7-addsudo.sh │ └── 99-postclean.sh ├── p_iptables │ ├── 00_install_service.sh │ ├── iptables_add-remove_test.sh │ ├── iptables_default_rules.sh │ ├── iptables_function-check_test.sh │ └── iptables_kmod_loaded.sh ├── p_iptraf │ ├── 0-install_iptraf.sh │ └── 5-test_iptraf.sh ├── p_iputils │ ├── 0-install_iputils.sh │ └── tracepath_test.sh ├── p_java-1.6.0-openjdk │ ├── 0-install-openjdk.sh │ └── 10-test_java.sh ├── p_java-openjdk │ ├── 0-install-openjdk.sh │ ├── 10-test_java.sh │ └── p_java-openjdk-common ├── p_jwhois │ ├── 0-install_jwhois.sh │ └── jwhois_test.sh ├── p_kernel │ ├── 01_kernel_centos_keyring.sh │ └── 02_kernel_secureboot_signed.sh ├── p_kvdo │ ├── 0-install_kvdo.sh │ └── kvdo_runtest.sh ├── p_lftp │ ├── 0_install_lftp.sh │ ├── 10_lftp_http_test.sh │ └── 20_lftp_ftp.sh ├── p_libbpf-tools │ ├── 0_install_libbpf-tools.sh │ └── libbpf-tools_tests.sh ├── p_libbpf │ ├── 0_install_libbpf.sh │ └── 10_test_bcc_tools.sh ├── p_libvirt │ ├── 0-install_libvirt.sh │ └── libvirt_virsh_test.sh ├── p_libxml2-python │ ├── 0-install-libxml2-python.sh │ └── 1-test-XmlTextReader.sh ├── p_logrotate │ ├── 0-install_logrotate.sh │ └── logrotate_test.sh ├── p_logwatch │ ├── 0-install_logwatch.sh │ └── logwatch_test.sh ├── p_lsb │ ├── 0-install_redhat-lsb.sh │ └── lsb_release_brand_test.sh ├── p_lsof │ ├── 0-install_lsof.sh │ └── 10-test_lsof.sh ├── p_lynx │ ├── 0-install_lynx.sh │ ├── lynx_default_page_centos_test.sh │ └── lynx_dump_page_test.sh ├── p_lzop │ ├── 0-install_lzop.sh │ └── lzop_test.sh ├── p_mailman │ ├── 0-install_mailman.sh │ └── mailman_test.sh ├── p_mdadm │ ├── 0-install-mdadm.sh │ ├── 5-test_mdadm.sh │ └── readme ├── p_minicom │ ├── 0-install_minicom.sh │ └── minicom_test.sh ├── p_mod_python │ ├── 0-install_mod_python.sh │ └── mod_python_test.sh ├── p_mod_wsgi │ ├── 0-install_mod_wsgi.sh │ ├── 10-test_mod_wsgi.sh │ └── 20-remove_mod_wsgi.sh ├── p_mtr │ ├── 0-install_mtr.sh │ └── mtr_test.sh ├── p_mysql │ ├── 0-install_mysqld.sh │ ├── 10_mysqld_conn_test.sh │ ├── 15_mysqld_create_db.sh │ ├── 20_mysqld_drop_db.sh │ ├── 25_mysqld_grant_test.sh │ ├── 50_switch_to_mysql55.sh │ ├── 60_mysqld55_conn_test.sh │ ├── 65_mysqld55_create_db.sh │ ├── 70_mysqld55_drop_db.sh │ └── 75_mysqld55_grant_test.sh ├── p_net-snmp │ ├── 0-install_snmpd.sh │ ├── snmpv1_test.sh │ ├── snmpv2c_test.sh │ └── snmpv3_test.sh ├── p_network │ ├── network_device_test.sh │ ├── networking_enabled_test.sh │ └── networking_vlan_test.sh ├── p_nfs │ ├── 0-install_nfs.sh │ └── nfs_share_rw.sh ├── p_nmap │ ├── 0_install_nmap.sh │ ├── nmap_test_eth0.sh │ └── nmap_test_lo.sh ├── p_ntp │ ├── 0-install_ntp.sh │ ├── 5-start-check.sh │ └── ntp_centos_servers.sh ├── p_openssh │ ├── 0-install_sshd.sh │ ├── _helper_sshd_user_login-with-key.expect │ ├── _helper_sshd_user_login.expect │ ├── sshd_conn_test.sh │ ├── sshd_user_login-with-key.sh │ └── sshd_user_login.sh ├── p_openssl │ ├── 0_install_openssl.sh │ └── 10-openssl-cert-test.sh ├── p_passwd │ ├── 0_install_passwd │ ├── 10_passwd_basic_test │ ├── 20_root_tests │ ├── 30_user_tests │ ├── TODO │ ├── _password_complexity.expect │ └── _user_password.expect ├── p_perf │ ├── 00_install_perf.sh │ ├── 01_perf_version.sh │ └── 02_perf_functionality.sh ├── p_perl │ ├── 0-install_perl.sh │ ├── 10-test_perl.sh │ └── 20-run_perl_script.sh ├── p_php │ ├── 0_install_php-cli.sh │ ├── 10-php-test.sh │ ├── 20-php-mysql-test.sh │ └── 25-php-mysql55-test.sh ├── p_php_7.2 │ ├── 10_php_api.sh │ └── 20_php_mariadb.sh ├── p_php_7.3 │ ├── 10_php_api.sh │ └── 20_php_mariadb.sh ├── p_podman │ ├── 00_install_podman.sh │ ├── 10_podman_tests.sh │ └── 15_podman_socket_tests.sh ├── p_postfix │ ├── 0-install_postfix.sh │ ├── 10_postfix_smtp.sh │ ├── 20_postfix_mta.sh │ ├── 30_postfix_mta_ehlo.sh │ ├── 40_postfix_sasl.sh │ └── 50_postfix_tls.sh ├── p_postgresql │ ├── 0-install_postgresql.sh │ ├── 1-config-postgresql.sh │ ├── postgresql_create_db.sh │ ├── postgresql_create_user_test.sh │ ├── postgresql_drop_db.sh │ └── postgresql_drop_user_test.sh ├── p_procinfo │ ├── 0-install_procinfo.sh │ └── 5-test_procinfo.sh ├── p_python-iniparse │ ├── 0-install-python-iniparse.sh │ └── 1-test-python-iniparse.sh ├── p_python │ ├── 0-install-python.sh │ ├── 10-test_python.sh │ ├── 20-python-mysql-test.sh │ └── 25-python-mysql55-test.sh ├── p_python3-mod_wsgi │ ├── 0-install_python3-mod_wsgi.sh │ ├── 10-test_python3-mod_wsgi.sh │ └── 20-remove_python3-mod_wsgi.sh ├── p_python38-mod_wsgi │ ├── 0-install_python38-mod_wsgi.sh │ ├── 10-test_python38-mod_wsgi.sh │ └── 20-remove_python38-mod_wsgi.sh ├── p_rootfiles │ ├── 0-install-rootfiles │ └── 10-rootfiles ├── p_rpm │ └── rpm_remove_pkg_test.sh ├── p_rrdtool │ ├── 0-install_rrdtool.sh │ └── rrdtool_test.sh ├── p_rsync │ ├── 0-install-rsync.sh │ └── 10-rsync-test.sh ├── p_ruby │ ├── 0-install-ruby.sh │ ├── 10-ruby-installed-test.sh │ ├── 20-ruby-version-test.sh │ ├── 25_ruby_hello-world.sh │ ├── 30-irb-version-test.sh │ ├── 40-ri-version-test.sh │ └── 50-rdoc-version-test.sh ├── p_samba │ ├── 0-install_samba.sh │ └── samba_share_test.sh ├── p_screen │ └── 0-install_screen.sh ├── p_selinux │ ├── 0_install_tools.sh │ ├── selinux_alerts.sh │ ├── selinux_enforce.sh │ └── selinux_policy_mismatch.sh ├── p_sendmail │ ├── 0-install_sendmail.sh │ ├── 10_sendmail_smtp.sh │ ├── 15-test-sendmail.sh │ ├── 20_sendmail_mta.sh │ └── 30_sendmail_mta_ehlo.sh ├── p_setup │ ├── group_file_test.sh │ ├── passwd_file_test.sh │ └── shells_file_test.sh ├── p_shadow-utils │ ├── 0-install_shadow_utils │ ├── 10-basic_test │ ├── 11-useradd_tests │ ├── 12-usermod_tests │ ├── 13-chpasswd_tests │ ├── 14-newusers_tests │ ├── 15-lastlog_tests │ ├── 19-userdel_tests │ ├── 20-chage_tests │ ├── 30-groupadd_tests │ ├── 31-gpasswd_tests │ ├── 32-groupmems_tests │ ├── 33-newgrp_tests │ ├── 34-groupmod_tests │ ├── 35-grpck-tests │ ├── 36-groupdel-tests │ ├── 37-grpconv-tests │ ├── 38-grpunconv-tests │ ├── 39-sg_tests │ ├── 40-pwck_tests │ ├── 41-pwconv_tests │ ├── 42-pwunconv_tests │ └── 99-cleanup ├── p_shim │ └── 01_shim_secureboot_signed.sh ├── p_spamassassin │ ├── 0-install_spamassassin.sh │ └── spamassassin_test.sh ├── p_sqlite │ ├── 0-install_sqlite.sh │ ├── sqlite_1-create_db_table.sh │ ├── sqlite_2-insert_table.sh │ ├── sqlite_dump_db.sh │ └── sqlite_select_table.sh ├── p_squid │ ├── 0-install_squid.sh │ └── squid_test.sh ├── p_squirrelmail │ ├── 0-install_squirrelmail.sh │ └── squirrelmail_test.sh ├── p_strace │ ├── 0-install_strace.sh │ └── 5-test_strace.sh ├── p_subversion │ ├── 0-install_subversion.sh │ ├── 10-test_subversion.sh │ └── 15-test_subversion.sh ├── p_syslog │ └── syslog_logging.sh ├── p_sysstat │ ├── 00-install_sysstat.sh │ ├── 05-iostat-cpu-basic.sh │ ├── 10-iostat-disk-basic.sh │ ├── 15-mpstat-basic.sh │ ├── 20-pidstat-basic.sh │ └── 25-sa-tests.sh ├── p_systemd │ ├── 10-systemctl_list_services.sh │ ├── 15-systemctl_list_non-native-services.sh │ ├── 20-systemctl_list-service-status.sh │ └── 25-journalctl.sh ├── p_tar │ ├── 0_install_tar.sh │ └── 10-tar-test.sh ├── p_tcl │ ├── 0-install_tcl.sh │ └── 10-test_tclsh.sh ├── p_tcpdump │ ├── 00_install_tcpdump.sh │ ├── 01_tcpdump_nic.sh │ ├── 02_tcpdump_lo.sh │ └── 03_tcpdump_lo_ipv6.sh ├── p_telnet │ ├── 0-install_telnet.sh │ └── 10-test_telnet.sh ├── p_tftp-server │ ├── 0-install_tftp-server.sh │ ├── 10-tftp-server_get-test.sh │ └── 20-tftp-server_put-test.sh ├── p_tmpwatch │ ├── 0-install_tmpwatch.sh │ └── tmpwatch_test.sh ├── p_tomcat │ ├── 0-install_tomcat.sh │ ├── 1-config_tomcat.sh │ ├── tomcat_manager_test.sh │ └── tomcat_test.sh ├── p_traceroute │ ├── 0-install_traceroute.sh │ └── traceroute_test.sh ├── p_valac │ ├── 0-install_valac.sh │ └── 10-test_valac.sh ├── p_vconfig │ ├── 0_install_vconfig.sh │ └── 10_test_vconfig.sh ├── p_vsftpd │ ├── 0-install_vsftpd.sh │ ├── vsftpd_anonymous_login.sh │ └── vsftpd_localusers_login.sh ├── p_webalizer │ ├── 0-install_webalizer.sh │ └── webalizer_test.sh ├── p_wget │ ├── 0-install_wget.sh │ └── wget_test.sh ├── p_which │ ├── 0-install_which.sh │ ├── which_basic.sh │ └── which_fail.sh ├── p_xorg-x11-server │ ├── 00_install-Xorg.sh │ └── 01_Xorg-centos-branding-test.sh ├── p_yum-plugin-fastestmirror │ ├── 0_install_yum-plugin-fastestmirror.sh │ └── 10-fastestmirror.sh ├── p_yum │ ├── yum_bugtracker.sh │ ├── yum_distroverpkg.sh │ └── yum_remove_pkg_test.sh ├── p_zip │ ├── 0_install_zip.sh │ └── 10-zip-test.sh ├── r_check_mod_packages │ ├── 01_modpackages.sh │ ├── c72-mod-packages.lst.aarch64 │ ├── c72-mod-packages.lst.armv7l │ ├── c72-mod-packages.lst.ppc64 │ ├── c72-mod-packages.lst.ppc64le │ └── c72-mod-packages.lst.x86_64 ├── r_lamp │ ├── 0_lamp_install.sh │ ├── 1_lamp_check.sh │ ├── 40_basic_lamp.sh │ ├── 45_basic_lamp_mysql55.sh │ ├── 50_lamp_check_mysql55.sh │ └── package_deps ├── r_pdf │ ├── 00_install_requirements.sh │ └── 01_pdf-test.sh ├── r_raid-0 │ └── package_deps ├── z_centos_pkg │ └── centos_rpm_checker.py ├── z_cr_test │ ├── cr-test.sh │ └── readme ├── z_install-tree │ ├── install-tree_test.sh │ └── readme ├── z_repoclosure │ └── repoclosure_test.sh └── z_rpminfo │ ├── README │ ├── check-rpminfo.py │ ├── check-rpminfo.sh │ └── special_overrides.txt └── utils ├── README ├── c5_req_list ├── c6_req_list ├── cleanup_vm.sh └── package-install-list.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .*.swp 3 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Please add your name to this list with your first commit request 2 | 3 | Karanbir Singh 4 | Fabian Arrotin 5 | Athmane Madjoudj 6 | Steve Barnes 7 | Johnny Hughes 8 | Christoph Galuschka 9 | Dan Trainor 10 | Nikhil Lanjewar 11 | Sahil Muthoo 12 | Sahil Aggarwal 13 | Saager Mhatre 14 | Iain Douglas 15 | Anssi Johansson 16 | Matej Habrnal 17 | Akemi Yagi 18 | -------------------------------------------------------------------------------- /Container-8.test: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos/centos:stream8 2 | 3 | RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ 4 | rm -f /lib/systemd/system/multi-user.target.wants/*;\ 5 | rm -f /etc/systemd/system/*.wants/*;\ 6 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ 7 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ 8 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ 9 | rm -f /lib/systemd/system/basic.target.wants/*;\ 10 | rm -f /lib/systemd/system/anaconda.target.wants/*; 11 | 12 | VOLUME [ "/sys/fs/cgroup" ] 13 | 14 | CMD ["/usr/sbin/init"] 15 | 16 | COPY . /tmp/test 17 | WORKDIR /tmp/test 18 | RUN CONTAINERTEST=1 ./runtests.sh 0_common 19 | RUN dnf -y install hostname initscripts iproute net-tools 20 | -------------------------------------------------------------------------------- /Container-9.test: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos/centos:stream9 2 | 3 | RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ 4 | rm -f /lib/systemd/system/multi-user.target.wants/*;\ 5 | rm -f /etc/systemd/system/*.wants/*;\ 6 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ 7 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ 8 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ 9 | rm -f /lib/systemd/system/basic.target.wants/*;\ 10 | rm -f /lib/systemd/system/anaconda.target.wants/*; 11 | 12 | VOLUME [ "/sys/fs/cgroup" ] 13 | 14 | CMD ["/usr/sbin/init"] 15 | 16 | COPY . /tmp/test 17 | WORKDIR /tmp/test 18 | RUN CONTAINERTEST=1 ./runtests.sh 0_common 19 | RUN dnf -y install hostname initscripts iproute net-tools 20 | -------------------------------------------------------------------------------- /README.lightweight: -------------------------------------------------------------------------------- 1 | This is a LightWeight branch and does not include the entire test suite, unless you know what you are doing, you should be running the master branch that contains the entire test suite. 2 | 3 | We are creating this as a small baseline to use during live hack sessions so we can quickly establish some of the core functionalities. 4 | -------------------------------------------------------------------------------- /centos_ci_build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Build steps used in CentOS CI 3 | 4 | yum -y update 5 | uname -a 6 | SKIP_QA_HARNESS=1 ./runtests.sh 7 | -------------------------------------------------------------------------------- /serial-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script would process all tests, one by one, so that we can have a look at which one[s] failed as a whole result 3 | for i in success fail;do 4 | test -e $i && rm $i 5 | done 6 | 7 | time for i in tests/* ; do 8 | ./runtests.sh ${i/tests\//} && echo ${i/tests\//} >> success || echo ${i/tests\//} >> fail 9 | done 10 | 11 | wc -l fail success 12 | 13 | -------------------------------------------------------------------------------- /skipped-tests.list: -------------------------------------------------------------------------------- 1 | # This file contains list of tests we need/want to skip 2 | # Reason is when there is upstream bug that we're aware of 3 | # So this file should contain: 4 | # - centos version (using $centos_ver) 5 | # - test to skip (tests/p_${name}/test.sh) 6 | # - reason why it's actually skipped (url to upstream BZ, or bug report) 7 | # Separated by | 8 | 8|tests/p_gzip/30-gzexe-test|https://apps.centos.org/kanboard/project/23/task/833 9 | 8|tests/p_diffutils/10-cmp-tests|https://bugzilla.redhat.com/show_bug.cgi?id=1732960 10 | 11 | -------------------------------------------------------------------------------- /t_functional_duffy_runner/.gitignore: -------------------------------------------------------------------------------- 1 | # Distribution / packaging 2 | build/ 3 | dist/ 4 | *.egg-info/ 5 | -------------------------------------------------------------------------------- /t_functional_duffy_runner/README.md: -------------------------------------------------------------------------------- 1 | # t_functional duffy runner 2 | 3 | Simple script to run these tests on new duffy. 4 | -------------------------------------------------------------------------------- /t_functional_duffy_runner/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /t_functional_duffy_runner/requirements.txt: -------------------------------------------------------------------------------- 1 | duffy 2 | fabric 3 | -------------------------------------------------------------------------------- /t_functional_duffy_runner/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = t_functional_duffy_runner 3 | version = 0.0.1 4 | 5 | [options] 6 | packages = src 7 | 8 | [options.entry_points] 9 | console_scripts = 10 | app = src.cli:main 11 | -------------------------------------------------------------------------------- /t_functional_duffy_runner/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup() 4 | -------------------------------------------------------------------------------- /t_functional_duffy_runner/src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentOS/sig-core-t_functional/19551e95cdc616bd82529403f25c9e0ae6c3d060/t_functional_duffy_runner/src/__init__.py -------------------------------------------------------------------------------- /test_incomplete/user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 - test various user commands from coreutils" 5 | who 6 | echo $? 7 | who | grep -q "$LOGNAME" && who mom likes 8 | echo $? 9 | who | grep -q "$LOGNAME" && who mom likes | grep -q "$LOGNAME" && users 10 | echo $? 11 | who | grep -q "$LOGNAME" && who mom likes | grep -q "$LOGNAME" && users | grep -q "$LOGNAME" && id 12 | echo $? 13 | who | grep -q "$LOGNAME" && who mom likes | grep -q "$LOGNAME" && users | grep -q "$LOGNAME" && id | grep -q "$LOGNAME" && logname 14 | echo $? 15 | who | grep -q "$LOGNAME" && who mom likes | grep -q "$LOGNAME" && users | grep -q "$LOGNAME" && id | grep -q "$LOGNAME" && logname | grep -q "$LOGNAME" 16 | 17 | t_CheckExitStatus $? 18 | -------------------------------------------------------------------------------- /tests/0_common/00_centos_repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$centos_ver" -ge "8" ]; then 4 | t_Log "python not installed by default on .el8. SKIP" 5 | exit 0 6 | else 7 | python tests/0_common/000_centos_default_repos.py 8 | fi 9 | 10 | -------------------------------------------------------------------------------- /tests/0_common/01_dist_release_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Just a check to determine full version (example 5.8) or just dist (example 6) 3 | 4 | export qa_dist=$(rpm -q --queryformat '%{version}\n' centos-release) 5 | export qa_releasever=$(rpm -q --queryformat '%{version}.' centos-release ; rpm -q --queryformat '%{release}\n' centos-release|cut -f 1 -d '.') 6 | -------------------------------------------------------------------------------- /tests/0_common/03_print_booted_kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | kerver="$(uname -r)" 4 | t_Log "Boot Kernel Version: $kerver" 5 | 6 | -------------------------------------------------------------------------------- /tests/0_common/05_stop_yumupdatesd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | t_Log "Running $0 - stopping yum-updatesd service" 4 | t_ServiceControl yum-updatesd stop 5 | -------------------------------------------------------------------------------- /tests/0_common/10_remove_32bitpkgs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | t_Log "Running $0 - test that all 32-bit rpms can be removed" 4 | 5 | # only run this test on x86_64 machines! 6 | is64=$(uname -m|grep x86_64) 7 | 8 | # This is a non-fatal status, so return PASS. 9 | [ $? -ne 0 ] && { t_Log 'Host is not 64bit, skipping.'; exit $PASS; } 10 | 11 | t_RemovePackage *.i?86 -------------------------------------------------------------------------------- /tests/0_common/15_list_repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | t_Log "Running $0 - Showing the repos we have configured" 4 | 5 | yum -d0 repolist -v 6 | 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/0_common/20_upgrade_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | t_Log "Running $0 - test that all updates can be applied to this machine cleanly" 4 | 5 | # If CENTOSPLUS, and CentOS 7, and x86_64 change default kernel to kernel-plus 6 | if [ "$CENTOSPLUS" == "1" ] && [ "$centos_ver" == "7" ] && [ "$arch" == "x86_64" ] ; then 7 | sed -i 's,DEFAULTKERNEL=.*,DEFAULTKERNEL=kernel-plus,g' /etc/sysconfig/kernel 8 | fi 9 | 10 | if [ "$centos_ver" -lt 8 ];then 11 | yum -d0 -y install deltarpm 12 | fi 13 | yum -d0 -y upgrade 14 | 15 | t_Log "Running $0 - listing all used/available packages" 16 | 17 | yum list 18 | 19 | t_CheckExitStatus $? 20 | -------------------------------------------------------------------------------- /tests/0_common/30_dns_works.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | t_Log "Running $0 - testing to see if DNS works" 4 | if [ $SKIP_QA_HARNESS -eq 1 ]; then 5 | HOST=www.centos.org 6 | else 7 | HOST=repo.centos.qa 8 | fi 9 | 10 | # its important we dont hit a dns record with a wildcard like centos.org 11 | getent hosts $HOST >/dev/null 12 | 13 | t_CheckExitStatus $? 14 | 15 | # implied results: 16 | # - network works 17 | # - default route is really routeable 18 | # - atleast one network link on the machine is working 19 | # - kernel' ip stack is functional 20 | -------------------------------------------------------------------------------- /tests/0_common/40_update_hosts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | 5 | t_Log "Running $0 - Update /etc/hosts" 6 | 7 | echo "127.0.0.1 `hostname`" >> /etc/hosts 8 | 9 | -------------------------------------------------------------------------------- /tests/0_common/readme: -------------------------------------------------------------------------------- 1 | These are tests that are run everytime a new machine instance comes up; 2 | these tests are run before any package specific or role specific test is run; 3 | these tests should : 4 | - not leave behind any state or content residue that might impact the package/role tests that come after 5 | 6 | -------------------------------------------------------------------------------- /tests/0_lib/readme: -------------------------------------------------------------------------------- 1 | Put everything that is shared across all tests here. 2 | Every file in this directory will get 'sourced' before tests are run 3 | ( which also means we can only ever really use Bash for stuff in here ) 4 | 5 | this readme file is ignored 6 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/0-install_abrt-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Matej Habrnal 3 | # Christoph Galuschka 4 | 5 | if [[ $centos_ver == 7 ]] 6 | then 7 | t_InstallPackage abrt-cli expect curl python python-libs bc 8 | else 9 | echo "Skipped on CentOS 5 and CentOS 6" 10 | fi 11 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/_CentOSBugTracker.conf: -------------------------------------------------------------------------------- 1 | URL=http://bugs-test.centos.org 2 | LOGIN=abrtuser 3 | PASSWORD=abrttestpass 4 | SSLVERIFY=no 5 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/_attachment_file: -------------------------------------------------------------------------------- 1 | SSBhbSBhdHRhY2hlZCA6KQo= 2 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/_mantisbt.conf: -------------------------------------------------------------------------------- 1 | # MantisBT URL 2 | MantisbtURL = http://localhost:12345 3 | # yes means that ssl certificates will be checked 4 | SSLVerify = no 5 | # your login has to exist, if you don have any, please create one 6 | Login = test 7 | # your password 8 | Password = password 9 | 10 | Project = proj 11 | ProjectVersion = 666 12 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/analyzer: -------------------------------------------------------------------------------- 1 | CCpp -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/architecture: -------------------------------------------------------------------------------- 1 | x86_64 -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/backtrace_rating: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/cmdline: -------------------------------------------------------------------------------- 1 | urxvtd -q -o -f -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/component: -------------------------------------------------------------------------------- 1 | rxvt-unicode -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/crash_function: -------------------------------------------------------------------------------- 1 | rxvt_term::selection_delimit_word -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/duphash: -------------------------------------------------------------------------------- 1 | bbfe66399cc9cb8ba647414e33c5d1e4ad82b511 -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/executable: -------------------------------------------------------------------------------- 1 | /usr/bin/urxvtd -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/hostname: -------------------------------------------------------------------------------- 1 | fluffy -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/kernel: -------------------------------------------------------------------------------- 1 | 2.6.38.8-35.fc15.x86_64 -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/os_release: -------------------------------------------------------------------------------- 1 | Fedora release 15 (Lovelock) -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/package: -------------------------------------------------------------------------------- 1 | rxvt-unicode-9.12-2.fc15 -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/reason: -------------------------------------------------------------------------------- 1 | Process /usr/bin/urxvtd was killed by signal 11 (SIGSEGV) -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/time: -------------------------------------------------------------------------------- 1 | 1312184367 -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/type: -------------------------------------------------------------------------------- 1 | CCpp -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/uid: -------------------------------------------------------------------------------- 1 | 502 -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/username: -------------------------------------------------------------------------------- 1 | rmarko 2 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/uuid: -------------------------------------------------------------------------------- 1 | b43d70450c44352de194f545a7d3841eb80b1ae5 -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/var_log_messages: -------------------------------------------------------------------------------- 1 | Aug 1 09:39:27 fluffy kernel: [149820.130191] urxvtd[10303]: segfault at 56 ip 0000000000420240 sp 00007fff728dc680 error 4 in urxvtd[400000+114000] 2 | Aug 1 09:39:28 fluffy abrt[19696]: saved core dump of pid 10303 (/usr/bin/urxvtd) to /var/spool/abrt/ccpp-2011-08-01-09:39:27-10303.new/coredump (5025792 bytes) 3 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/problem_dir/xsession_errors: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentOS/sig-core-t_functional/19551e95cdc616bd82529403f25c9e0ae6c3d060/tests/p_abrt-cli/problem_dir/xsession_errors -------------------------------------------------------------------------------- /tests/p_abrt-cli/queries/dummy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | id 9 | 10 | 323795 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/p_abrt-cli/queries/login_incorrect: -------------------------------------------------------------------------------- 1 | HTTP/1.1 500 Internal Service Error 2 | Date: Fri, 07 Nov 2014 21:51:25 GMT 3 | Server: Apache/2.4.10 (Fedora) PHP/5.6.2 4 | X-Powered-By: PHP/5.6.2 5 | Set-Cookie: PHPSESSID=d7codh295fdqov4hta9jb1c6a6; path=/; HttpOnly 6 | Cache-Control: private, max-age=10800, pre-check=10800 7 | Last-Modified: Mon, 03 Mar 2014 19:19:50 GMT 8 | Connection: close 9 | Content-Length: 280 10 | Content-Type: text/xml; charset=utf-8 11 | 12 | 13 | SOAP-ENV:ClientAccess denied 14 | -------------------------------------------------------------------------------- /tests/p_abrt/0-install_abrt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | 5 | if (t_GetPkgRel basesystem | grep -q el6) 6 | then 7 | t_InstallPackage abrt 8 | else 9 | echo "Skipped on CentOS 5" 10 | fi 11 | -------------------------------------------------------------------------------- /tests/p_abrt/abrt_gpg_keys_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | # Note: This was a known issue in CentOS 6.0 5 | # See: http://bugs.centos.org/view.php?id=4993 6 | # Christoph Galuschka: added functionality for C7 7 | 8 | t_Log "Running $0 - check that abrt is using CentOS' gpg keys." 9 | 10 | if [ "$centos_ver" = "7" ] ;then 11 | ls /etc/pki/rpm-gpg/ | grep -q "RPM-GPG-KEY-CentOS" 12 | elif [ "$centos_ver" = "6" ] ; then 13 | grep -q "RPM-GPG-KEY-CentOS" /etc/abrt/gpg_keys 14 | else 15 | echo "Skipped on CentOS 5" 16 | fi 17 | 18 | t_CheckExitStatus $? 19 | -------------------------------------------------------------------------------- /tests/p_acl/0-install_acl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "$0 - installing acl" 5 | t_InstallPackage acl 6 | 7 | t_Log "Remount root fs with acl support" 8 | mount -o remount,acl / 9 | sleep 2 10 | -------------------------------------------------------------------------------- /tests/p_acl/acl_set_get_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Dan Trainor 3 | # Athmane Madjoudj 4 | 5 | t_Log "Running $0 - Check that we can get and set acl" 6 | 7 | touch /tmp/acl_test_file 8 | 9 | setfacl -m user:nobody:r-- /tmp/acl_test_file 10 | getfacl /tmp/acl_test_file |grep -q 'user:nobody:r--' 11 | 12 | t_CheckExitStatus $? 13 | 14 | /bin/rm -f /tmp/acl_test_file 15 | -------------------------------------------------------------------------------- /tests/p_amanda/0-install_amanda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "$0 - installing amanda system" 6 | 7 | 8 | if (t_GetPkgRel basesystem | grep -q el5) 9 | then 10 | t_Log "This is a C5 system. Skipping." 11 | t_CheckExitStatus 0 12 | exit $PASS 13 | fi 14 | 15 | if (t_GetPkgRel basesystem | grep -q el9) 16 | then 17 | t_Log "This is a C9 system. Amanda not present. Skipping." 18 | t_CheckExitStatus 0 19 | exit $PASS 20 | fi 21 | 22 | t_InstallPackage amanda amanda-server amanda-client 23 | id -u amandabackup &>/dev/null || useradd amandabackup 24 | -------------------------------------------------------------------------------- /tests/p_anaconda/0-install_anaconda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | uname_arch=$(uname -m) 5 | if [ "$centos_ver" -eq "8" ]; then 6 | t_Log "c8 => SKIPPING" 7 | exit 0 8 | fi 9 | 10 | if [ "$uname_arch" == "armv7l" ]; then 11 | t_Log "*** Not testing on Arch: $uname_arch ***" 12 | exit 0 13 | fi 14 | 15 | t_InstallPackage anaconda 16 | -------------------------------------------------------------------------------- /tests/p_annobin/0-install_annobin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Neal Gompa 3 | 4 | # Skip if older than CentOS 8 5 | if [ "$centos_ver" -lt "8" ]; then 6 | t_Log "annobin does not exist pre-c8 => SKIP" 7 | exit 0 8 | fi 9 | 10 | # Install annobin and gcc 11 | t_Log "Running $0 - installing annobin and gcc." 12 | 13 | t_InstallPackage annobin redhat-rpm-config gcc gcc-c++ 14 | -------------------------------------------------------------------------------- /tests/p_annobin/10-test_annobin-gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Neal Gompa 3 | 4 | # Skip if older than CentOS 8 5 | if [ "$centos_ver" -lt "8" ]; then 6 | t_Log "annobin does not exist pre-c8 => SKIP" 7 | exit 0 8 | fi 9 | 10 | # Run the test 11 | t_Log "Running $0 - build a hello world program with gcc using annobin" 12 | 13 | BUILTPROG=$(mktemp) 14 | 15 | cat < 17 | int main() { 18 | printf("Hello World!\n"); 19 | return 0; 20 | } 21 | EOF 22 | 23 | ${BUILTPROG} | grep -q "Hello World" 24 | t_CheckExitStatus $? 25 | 26 | rm -f ${BUILTPROG} 27 | -------------------------------------------------------------------------------- /tests/p_annobin/20-test_annobin-gcc-c++.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Neal Gompa 3 | 4 | # Skip if older than CentOS 8 5 | if [ "$centos_ver" -lt "8" ]; then 6 | t_Log "annobin does not exist pre-c8 => SKIP" 7 | exit 0 8 | fi 9 | 10 | # Run the test 11 | t_Log "Running $0 - build a hello world program with gcc-c++ using annobin" 12 | 13 | BUILTPROG=$(mktemp) 14 | 15 | cat < 17 | int main() { 18 | std::cout << "Hello World!\n"; 19 | return 0; 20 | } 21 | EOF 22 | 23 | ${BUILTPROG} | grep -q "Hello World" 24 | t_CheckExitStatus $? 25 | 26 | rm -f ${BUILTPROG} 27 | -------------------------------------------------------------------------------- /tests/p_arpwatch/0_install_arpwatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | # Rene Diepstraten 4 | 5 | if (t_GetPkgRel basesystem | grep -q el9) 6 | then 7 | t_Log "This is a C9 system. Skipping." 8 | t_CheckExitStatus 0 9 | exit $PASS 10 | fi 11 | 12 | 13 | # Install requirements 14 | t_InstallPackage arpwatch psmisc net-tools 15 | 16 | -------------------------------------------------------------------------------- /tests/p_attr/0-install-attr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Dan Trainor 3 | 4 | t_InstallPackage attr 5 | -------------------------------------------------------------------------------- /tests/p_attr/attr_check_installed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Dan Trainor 3 | # Athmane Madjoudj 4 | 5 | t_Log "Running $0 - Checking to see if setfattr, getfattr work" 6 | 7 | 8 | dd if=/dev/zero of=/tmp/attrtest.img bs=1024000 count=100 &>/dev/null 9 | t_CheckExitStatus $? 10 | 11 | echo -e 'y\n' | mkfs.ext3 /tmp/attrtest.img > /dev/null 2>&1 12 | 13 | mkdir /mnt/attr_test 14 | mount -t ext3 -o loop,user_xattr /tmp/attrtest.img /mnt/attr_test 15 | touch /mnt/attr_test/testfile 16 | setfattr -n user.test /mnt/attr_test/testfile 17 | getfattr /mnt/attr_test/testfile | grep -oq "user.test" 18 | 19 | t_CheckExitStatus $? 20 | 21 | umount /mnt/attr_test 22 | rm -f /tmp/attrtest.img 23 | -------------------------------------------------------------------------------- /tests/p_audit/0_install_auditd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install tests deps 4 | t_Log "Running $0 - auditd" 5 | 6 | 7 | t_InstallPackage audit 8 | t_ServiceControl auditd restart 9 | 10 | -------------------------------------------------------------------------------- /tests/p_audit/1_auditd_running.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check if auditd is running." 5 | 6 | if [ "$SKIP_QA_HARNESS" -eq 1 ] | [ "$CONTAINERTEST" -eq 1 ] ; then 7 | echo "Skipping this test ..." 8 | else 9 | service auditd status > /dev/null 2>&1 10 | t_CheckExitStatus $? 11 | fi 12 | -------------------------------------------------------------------------------- /tests/p_audit/2_auditd_generate-events.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | if [ $SKIP_QA_HARNESS -eq 1 -o $CONTAINERTEST -eq 1 ]; then 5 | echo "Skipping this test ..." 6 | else 7 | t_Log "Running $0 - Generate some events for audit log." 8 | 9 | useradd testauditd 10 | userdel testauditd 11 | 12 | t_CheckExitStatus $? 13 | fi 14 | -------------------------------------------------------------------------------- /tests/p_audit/3_auditd_logging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | if [ $SKIP_QA_HARNESS -eq 1 -o $CONTAINERTEST -eq 1 ]; then 4 | echo "Skipping this test ..." 5 | else 6 | t_Log "Running $0 - check if audit log is not empty." 7 | 8 | [[ -s /var/log/audit/audit.log ]] 9 | 10 | t_CheckExitStatus $? 11 | fi 12 | -------------------------------------------------------------------------------- /tests/p_bash/bash_version_info_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Note: This was a known issue in CentOS 6.0 4 | # See: http://bugs.centos.org/view.php?id=5158 5 | 6 | t_Log "Running $0 - check that bash version info is the same with upstream." 7 | 8 | bash --version | grep -qE "(i386|i686|x86_64|aarch64|armv7hl|powerpc64le|powerpc64)-redhat-linux-gnu" 9 | 10 | t_CheckExitStatus $? 11 | -------------------------------------------------------------------------------- /tests/p_bc/0-install_bc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author : Varadharajan M 3 | # Manoj Mahalingam 4 | t_InstallPackage bc 5 | t_CheckExitStatus $? 6 | -------------------------------------------------------------------------------- /tests/p_bc/10-bc-installed-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author : Varadharajan M 3 | # Manoj Mahalingam 4 | 5 | t_Log "Running $0 - Test bc is installed" 6 | bc --version 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_bc/20-bc-test-simple-calculation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author : Varadharajan M 3 | # Manoj Mahalingam 4 | 5 | t_Log "Running $0 - Testing basic bc functionalities" 6 | test `echo "5 + 6 * 5 / 10 - 1" | bc` -eq "7" 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_bc/bc-test-basic-functionalities.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author : Varadharajan M 3 | # Manoj Mahalingam 4 | 5 | t_Log "Running $0 - Testing basic bc functionalities" 6 | test `echo "5 + 6 * 5 / 10 - 1" | bc` -eq "7" ; t_CheckExitStatus $? 7 | -------------------------------------------------------------------------------- /tests/p_bc/bc-test-installation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author : Varadharajan M 3 | # Manoj Mahalingam 4 | 5 | 6 | t_Log "Running $0 - Test bc is installed" 7 | bc --version 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_bind/bind_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - bind: local resolver can qualify 127.0.0.1" 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_Log "Running in container -> SKIP" 8 | exit 0 9 | fi 10 | 11 | dig +timeout=1 +short @127.0.0.1 localhost | grep -q '127.0.0.1' 12 | 13 | t_CheckExitStatus $? 14 | -------------------------------------------------------------------------------- /tests/p_bridge-utils/00-install_bridge-utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Madhurranjan Mohaan 3 | 4 | # Install bridge_utils package 5 | t_Log "Running $0 - bridge-utils: Installation" 6 | 7 | if [ "$centos_ver" -ge 8 ] ; then 8 | t_InstallPackage iproute 9 | else 10 | t_InstallPackage bridge-utils 11 | fi 12 | -------------------------------------------------------------------------------- /tests/p_bridge-utils/05-add_bridge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author : Madhurranjan Mohaan 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | if [ $# -eq 0 ] 10 | then 11 | bridge=testbridge1 12 | else 13 | bridge=$1 14 | fi 15 | 16 | . "$(dirname "$0")"/p_bridge-utils-functions 17 | 18 | t_Log "Running $0 - Adding a dummy Bridge: $bridge" 19 | ret_val=$(bru_add_bridge $bridge) 20 | 21 | t_CheckExitStatus $ret_val 22 | bru_del_bridge $bridge >/dev/null 23 | exit $ret_val 24 | -------------------------------------------------------------------------------- /tests/p_bridge-utils/10-delete_bridge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author : Madhurranjan Mohaan 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | . "$(dirname "$0")"/p_bridge-utils-functions 10 | #add bridge 11 | bridge=testbridge2 12 | bru_add_bridge $bridge >/dev/null 13 | 14 | t_Log "Running $0 - Deleting the dummy bridge: $bridge" 15 | 16 | t_Log "Deleting bridge $bridge" 17 | ret_val=$(bru_del_bridge $bridge) 18 | 19 | t_CheckExitStatus $ret_val 20 | -------------------------------------------------------------------------------- /tests/p_busybox/00_install_busybox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | # Author: Rene Diepstraten 4 | 5 | [[ $centos_ver -ge 7 ]] && { t_Log "busybox is not part of el${centos_ver}" ; exit ; } 6 | 7 | t_Log "Running $0 - attempting to install busybox." 8 | t_InstallPackage busybox 9 | 10 | -------------------------------------------------------------------------------- /tests/p_busybox/10_test_busybox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Author: Christoph Galuschka 4 | # Author: Rene Diepstraten 5 | 6 | [[ $centos_ver -ge 7 ]] && exit 7 | 8 | t_Log "Running $0 - busybox test: busybox lists available functions." 9 | 10 | busybox | grep -q 'Currently defined functions' 11 | busy_ok=$? 12 | if [ $busy_ok = 1 ] 13 | then 14 | t_Log 'busybox does not seem to list available functions' 15 | fi 16 | t_CheckExitStatus $busy_ok 17 | -------------------------------------------------------------------------------- /tests/p_bzip2/0_install_bzip2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - attempting to install bzip2." 5 | t_InstallPackage bzip2 6 | 7 | -------------------------------------------------------------------------------- /tests/p_bzip2/10-bzip2-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Author: Christoph Galuschka 4 | 5 | t_Log "Running $0 - run a file through bzip2,bzcat and bunzip2 test." 6 | 7 | # create file 8 | FILE=/var/tmp/bzip2-test.txt 9 | 10 | cat > $FILE < 3 | 4 | t_Log "$0 - installing file utility" 5 | t_InstallPackage file 6 | -------------------------------------------------------------------------------- /tests/p_centos-release/centos-release_centos-base_repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - CentOS Base repos sanity test." 5 | 6 | # grep "name=CentOS" /etc/yum.repos.d/CentOS*-Base*.repo >/dev/null 2>&1 7 | grep "name=CentOS" /etc/yum.repos.d/*.repo >/dev/null 2>&1 8 | 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_centos-release/centos-release_centos_gpg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - CentOS RPM GPG Keys exist." 5 | 6 | file /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS* >/dev/null 2>&1 && \ 7 | file /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Security* >/dev/null 2>&1 8 | 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_centos-release/centos-release_issue.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - /etc/issue* has correct branding" 5 | if [ "$centos_ver" -ge 7 ] ; then 6 | t_Log "CentOS $centos_ver -> SKIP" 7 | exit 0 8 | else 9 | (grep "CentOS" /etc/issue >/dev/null 2>&1) && \ 10 | (grep "CentOS" /etc/issue.net >/dev/null 2>&1) 11 | t_CheckExitStatus $? 12 | fi 13 | -------------------------------------------------------------------------------- /tests/p_centos-release/centos-release_release_compat_symlinks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - /etc/centos-release compatibility symbolic links test." 5 | if [ "$centos_ver" -ge 6 ] 6 | then 7 | grep "CentOS" /etc/centos-release >/dev/null 2>&1 8 | (file /etc/redhat-release | grep -E "symbolic link to .?centos-release.?" >/dev/null 2>&1) &&\ 9 | (file /etc/system-release | grep -E "symbolic link to .?centos-release.?" >/dev/null 2>&1) 10 | else 11 | echo "This test is not comptatible with CentOS <= 5" 12 | fi 13 | 14 | t_CheckExitStatus $? 15 | -------------------------------------------------------------------------------- /tests/p_centos-release/centos-release_system_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - /etc/centos-release has correct branding" 5 | 6 | if [ "$centos_ver" = "5" ] ; then 7 | grep "CentOS" /etc/redhat-release >/dev/null 2>&1 8 | else 9 | grep "CentOS" /etc/centos-release >/dev/null 2>&1 10 | fi 11 | 12 | t_CheckExitStatus $? 13 | 14 | -------------------------------------------------------------------------------- /tests/p_chkconfig/chkconfig_list_services.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Rene Diepstraten 4 | 5 | t_Log "Running $0 - check if chkconfig can list a service status" 6 | 7 | if [ $centos_ver -ge 8 ]; then 8 | echo "CentOS $centos_ver does not use chkconfig, skipping" 9 | exit 0 10 | fi 11 | 12 | # network is used as example because it's standard with minimal install 13 | 14 | chkconfig --list network | grep -q '3:on' 15 | 16 | t_CheckExitStatus $? 17 | 18 | -------------------------------------------------------------------------------- /tests/p_coreutils/0-install_coreutils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 - installing coreutils" 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_InstallPackage coreutils-single 8 | else 9 | t_InstallPackage coreutils 10 | fi -------------------------------------------------------------------------------- /tests/p_coreutils/arch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 Check arch agrees with current running kernel" 5 | uname -a | grep -q `arch` 6 | t_CheckExitStatus $? 7 | -------------------------------------------------------------------------------- /tests/p_coreutils/basename.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 testing basename" 5 | 6 | basename $0 | grep -q basename.sh || exit 1 7 | basename /etc/hosts | grep -q hosts 8 | t_CheckExitStatus $? 9 | 10 | -------------------------------------------------------------------------------- /tests/p_coreutils/cat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 test cat command" 5 | 6 | cat > /var/tmp/cat-test < /var/tmp/cat-test2 && grep -q "file 2" /var/tmp/cat-test2 12 | t_CheckExitStatus $? 13 | 14 | rm /var/tmp/cat-test 15 | -------------------------------------------------------------------------------- /tests/p_coreutils/cut.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 test cut" 5 | 6 | test `echo "1 2 3" | cut -f2 -d" "` -eq 2 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_coreutils/false.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 test false command" 5 | false 6 | test $? -eq 1 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_coreutils/head.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 test head command" 5 | 6 | cat << EOF > /var/tmp/head-test 7 | 1 8 | 2 9 | 3 10 | 4 11 | 5 12 | EOF 13 | 14 | head -n1 /var/tmp/head-test | grep -q 1 15 | t_CheckExitStatus $? 16 | 17 | # Cleanup 18 | rm /var/tmp/head-test 19 | -------------------------------------------------------------------------------- /tests/p_coreutils/pathchk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | t_Log "$0 testing pathchk gives good results" 4 | pathchk -p "<>" 2> /dev/null 5 | test $? -eq 1 && pathchk /var/tmp/1234567890123456789012345123456789012345678901234512345678901234567890123451234567890123456789012345123456789012345678901234512345678901234567890123451234567890123456789012345123456789012345678901234512345678901234567890123451234567890123456789012345123456 2> /dev/null 6 | test $? -eq 1 && pathchk /var/tmp 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_coreutils/readlink.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 checking readlink prints target of a symlink" 5 | 6 | ln -s /var/tmp/foo /var/tmp/readlink-test 7 | readlink /var/tmp/readlink-test | grep -q "/var/tmp/foo" 8 | t_CheckExitStatus $? 9 | rm /var/tmp/readlink-test 10 | -------------------------------------------------------------------------------- /tests/p_coreutils/seq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0" 5 | seq -s " " 5 | grep -q "1 2 3 4 5" && seq -s " " 6 8 | grep -q "6 7 8" && seq -s " " 8 2 12 | grep -q "8 10 12" 6 | t_CheckExitStatus $? 7 | -------------------------------------------------------------------------------- /tests/p_coreutils/sleeptimeout.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author Alice Kaerast 3 | 4 | t_Log "$0 checking timeout and sleep" 5 | 6 | if [ $centos_ver = 5 ] 7 | then 8 | t_Log "This is a C5 system. no 'timeout' available. Skipping." 9 | ret_val=0 10 | else 11 | timeout 1 sleep 2 12 | test $? -eq 124 && timeout 2 sleep 1 13 | ret_val=$? 14 | fi 15 | 16 | t_CheckExitStatus $ret_val 17 | -------------------------------------------------------------------------------- /tests/p_coreutils/tail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 test tail command" 5 | 6 | cat << EOF > /var/tmp/tail-test 7 | 1 8 | 2 9 | 3 10 | 4 11 | 5 12 | EOF 13 | 14 | tail -n1 /var/tmp/tail-test | grep -q 5 15 | t_CheckExitStatus $? 16 | 17 | # Cleanup 18 | rm /var/tmp/tail-test 19 | -------------------------------------------------------------------------------- /tests/p_coreutils/touch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 testing touch and ls" 5 | 6 | # Create two files 7 | touch -t 198307081200 /var/tmp/touch-test-1 8 | touch -t 198707071200 /var/tmp/touch-test-2 9 | 10 | # ls -lt should show oldest file last 11 | ls -lt /var/tmp/touch-test-? | tail -n 1 | grep -q "touch-test-1" 12 | 13 | t_CheckExitStatus $? 14 | 15 | # Cleanup 16 | rm /var/tmp/touch-test-? 17 | -------------------------------------------------------------------------------- /tests/p_coreutils/true.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 test true command" 5 | true 6 | t_CheckExitStatus $? 7 | -------------------------------------------------------------------------------- /tests/p_coreutils/uniq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 test uniq command" 5 | 6 | cat << EOF > /var/tmp/uniq-test 7 | 1 8 | 2 9 | 2 10 | 3 11 | 3 12 | 4 13 | 5 14 | EOF 15 | 16 | uniq -d /var/tmp/uniq-test | wc -l | grep -q 2 && uniq -u /var/tmp/uniq-test | wc -l | grep -q 3 17 | t_CheckExitStatus $? 18 | -------------------------------------------------------------------------------- /tests/p_coreutils/wc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 - test wc output" 5 | 6 | cat << EOF > /var/tmp/wc-test 7 | 1 2 8 | 3 4 9 | 5 6 10 | EOF 11 | 12 | # file should have 3 lines, 12 bytes, 12 characters, max line length of 3, and 6 words 13 | wc -l /var/tmp/wc-test | grep -q 3 && wc -c /var/tmp/wc-test | grep -q 12 && wc -m /var/tmp/wc-test | grep -q 12 && wc -L /var/tmp/wc-test | grep -q 3 && wc -w /var/tmp/wc-test | grep -q 6 14 | 15 | t_CheckExitStatus $? 16 | 17 | # Cleanup 18 | rm /var/tmp/wc-test 19 | -------------------------------------------------------------------------------- /tests/p_coreutils/yes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 - Test yes command" 5 | 6 | # Create test files 7 | touch /var/tmp/test-yes-123 8 | touch /var/tmp/test-yes-456 9 | 10 | # -i makes rm ask for confirmation with 'y' so pipe yes to it 11 | yes | rm -i /var/tmp/test-yes-* || exit 1 12 | 13 | #Set deleted to 1, until we've succesfully tested that the files have gone 14 | deleted=1 15 | #Test that the files don't exist then set deleted=0 16 | test -f /var/tmp/test-yes-123 || test -f /var/tmp/test-yes-456 || deleted=0 17 | t_CheckExitStatus $deleted 18 | -------------------------------------------------------------------------------- /tests/p_cpio/0_install_cpio: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | #Ensure the packeages we require are available 4 | 5 | t_Log "Running $0 installing required packages" 6 | t_InstallPackage cpio diffutils 7 | -------------------------------------------------------------------------------- /tests/p_cracklib/0-install_cracklib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - installing cracklib." 5 | t_InstallPackage cracklib 6 | -------------------------------------------------------------------------------- /tests/p_cracklib/cracklib_passwordtest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - cracklib can check some passwords." 5 | ret_val=0 6 | 7 | t_Log "checking very simple password" 8 | echo -e "test" | cracklib-check | grep -q 'too short' 9 | t_CheckExitStatus $? 10 | 11 | t_Log "checking simple password" 12 | echo -e "testing" | cracklib-check | grep -q 'dictionary' 13 | t_CheckExitStatus $? 14 | 15 | if (t_GetPkgRel basesystem | grep -q el5) 16 | then 17 | t_Log "Simplistic password not checked on C5" 18 | else 19 | t_Log "checking simplistic password" 20 | echo -e "1234_Hgi" | cracklib-check | grep -q 'simplistic' 21 | t_CheckExitStatus $? 22 | fi 23 | 24 | t_Log "checking complicated password" 25 | echo -e "1536_Hargi" | cracklib-check | grep -q 'OK' 26 | t_CheckExitStatus $? 27 | -------------------------------------------------------------------------------- /tests/p_cron/0-install_cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "$0 - Installing crond" 5 | if (t_GetPkgRel basesystem | grep -q -E 'el6|el7|el8|el9') 6 | then 7 | pn="cronie" 8 | else 9 | pn="vixie-cron" 10 | fi 11 | 12 | t_InstallPackage $pn 13 | t_ServiceControl crond cycle 14 | -------------------------------------------------------------------------------- /tests/p_cron/cron_crontab_daily_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - crontab will run daily jobs." 5 | 6 | # Add a test cron 7 | cat > /etc/cron.daily/test.sh< 3 | 4 | t_Log "Running $0 - crontab will run hourly jobs." 5 | 6 | # Add a test cron 7 | cat > /etc/cron.hourly/test.sh< 3 | 4 | t_Log "Running $0 - crontab will run weekly jobs" 5 | 6 | # Add a test cron 7 | cat > /etc/cron.weekly/test.sh< 3 | # Christoph Galuschka 4 | 5 | t_Log "$0 - installing curl" 6 | if [ "$centos_ver" -ge "9" ]; then 7 | binary=$(which curl) 8 | if [ -z $binary ]; then 9 | t_InstallPackage curl-minimal 10 | fi 11 | else 12 | t_InstallPackage curl 13 | fi 14 | 15 | -------------------------------------------------------------------------------- /tests/p_curl/curl_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - curl can access http-host and retrieve index.html." 6 | 7 | 8 | if [ $SKIP_QA_HARNESS -eq 1 ]; then 9 | CHECK_FOR="The CentOS Project" 10 | URL="http://www.centos.org/" 11 | else 12 | CHECK_FOR="Index of /srv" 13 | URL="http://repo.centos.qa/srv/CentOS/" 14 | fi 15 | 16 | t_Log "Querying ${URL}" 17 | curl --location -s ${URL} | grep -q "${CHECK_FOR}" 18 | 19 | t_CheckExitStatus $? 20 | -------------------------------------------------------------------------------- /tests/p_diffutils/0_install_diffutils: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | #Ensure the packeages we require are available 4 | 5 | t_Log "Running $0 installing required packages" 6 | t_InstallPackage diffutils 7 | -------------------------------------------------------------------------------- /tests/p_diffutils/40-sdiff-tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | # Tests for sdiff 5 | 6 | # Basic Tests 7 | 8 | t_Log "Running $0 - sdiff tests" 9 | 10 | sdiff -v &>/dev/null 11 | 12 | t_CheckExitStatus $? 13 | 14 | FILES=./tests/p_diffutils/files 15 | 16 | # sdiff will take it's commands from a /dev/null && Exitfail 19 | diff "$FILES"/sdiff_output /var/tmp/sdiff.out 20 | t_CheckExitStatus $? 21 | 22 | # Clean up 23 | rm -f /var/tmp/sdiff.out 24 | -------------------------------------------------------------------------------- /tests/p_diffutils/TODO: -------------------------------------------------------------------------------- 1 | The following haven't been tested mostly because I can't figure out how to do so. 2 | diff --minimal 3 | diff --horizon-lines 4 | diff --speed-large-files 5 | diff --show-c-function 6 | diff --show-function-line 7 | diff --starting-file 8 | 9 | diff -x | -X in combination with --ignore-file-name-case as the latter doesn't work due to a bug. 10 | 11 | diff3 -a 12 | diff3 -T 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/F: -------------------------------------------------------------------------------- 1 | f -------------------------------------------------------------------------------- /tests/p_diffutils/files/F-G: -------------------------------------------------------------------------------- 1 | 1c1 2 | < f 3 | \ No newline at end of file 4 | --- 5 | > g 6 | \ No newline at end of file 7 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/G: -------------------------------------------------------------------------------- 1 | g -------------------------------------------------------------------------------- /tests/p_diffutils/files/H: -------------------------------------------------------------------------------- 1 | h -------------------------------------------------------------------------------- /tests/p_diffutils/files/context_format-1: -------------------------------------------------------------------------------- 1 | *************** 2 | *** 1,5 **** 3 | - The Way that can be told of is not the eternal Way; 4 | - The name that can be named is not the eternal name. 5 | The Nameless is the origin of Heaven and Earth; 6 | ! The Named is the mother of all things. 7 | Therefore let there always be non-being, 8 | --- 1,4 ---- 9 | The Nameless is the origin of Heaven and Earth; 10 | ! The named is the mother of all things. 11 | ! 12 | Therefore let there always be non-being, 13 | *************** 14 | *** 11 **** 15 | --- 10,13 ---- 16 | they have different names. 17 | + They both may be called deep and profound. 18 | + Deeper and more profound, 19 | + The door of all subtleties! 20 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_easy_only: -------------------------------------------------------------------------------- 1 | 8c 2 | so we may see their result. 3 | . 4 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_ed_script: -------------------------------------------------------------------------------- 1 | 11a 2 | 3 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan 4 | . 5 | 8c 6 | so we may see their result. 7 | . 8 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_i: -------------------------------------------------------------------------------- 1 | 8c 2 | so we may see their result. 3 | . 4 | w 5 | q 6 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_label: -------------------------------------------------------------------------------- 1 | <<<<<<< TZU 2 | ======= 3 | The Way that can be told of is not the eternal Way; 4 | The name that can be named is not the eternal name. 5 | >>>>>>> TAO 6 | The Nameless is the origin of Heaven and Earth; 7 | The Named is the mother of all things. 8 | Therefore let there always be non-being, 9 | so we may see their subtlety, 10 | And let there always be being, 11 | so we may see their result. 12 | The two are the same, 13 | But after they are produced, 14 | they have different names. 15 | <<<<<<< LAO 16 | ||||||| TZU 17 | They both may be called deep and profound. 18 | Deeper and more profound, 19 | The door of all subtleties! 20 | ======= 21 | 22 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan 23 | >>>>>>> TAO 24 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_merge: -------------------------------------------------------------------------------- 1 | <<<<<<< ./tests/p_diffutils/files/tzu 2 | ======= 3 | The Way that can be told of is not the eternal Way; 4 | The name that can be named is not the eternal name. 5 | >>>>>>> ./tests/p_diffutils/files/tao 6 | The Nameless is the origin of Heaven and Earth; 7 | The Named is the mother of all things. 8 | Therefore let there always be non-being, 9 | so we may see their subtlety, 10 | And let there always be being, 11 | so we may see their result. 12 | The two are the same, 13 | But after they are produced, 14 | they have different names. 15 | <<<<<<< ./tests/p_diffutils/files/lao 16 | ||||||| ./tests/p_diffutils/files/tzu 17 | They both may be called deep and profound. 18 | Deeper and more profound, 19 | The door of all subtleties! 20 | ======= 21 | 22 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan 23 | >>>>>>> ./tests/p_diffutils/files/tao 24 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_normal: -------------------------------------------------------------------------------- 1 | ====2 2 | 1:1,2c 3 | 3:1,2c 4 | The Way that can be told of is not the eternal Way; 5 | The name that can be named is not the eternal name. 6 | 2:0a 7 | ====1 8 | 1:4c 9 | The Named is the mother of all things. 10 | 2:2,3c 11 | 3:4,5c 12 | The named is the mother of all things. 13 | 14 | ====3 15 | 1:8c 16 | 2:7c 17 | so we may see their outcome. 18 | 3:9c 19 | so we may see their result. 20 | ==== 21 | 1:11a 22 | 2:11,13c 23 | They both may be called deep and profound. 24 | Deeper and more profound, 25 | The door of all subtleties! 26 | 3:13,14c 27 | 28 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan 29 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_overlap_only: -------------------------------------------------------------------------------- 1 | 11a 2 | 3 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan 4 | . 5 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_show_all: -------------------------------------------------------------------------------- 1 | 11a 2 | ||||||| ./tests/p_diffutils/files/tzu 3 | They both may be called deep and profound. 4 | Deeper and more profound, 5 | The door of all subtleties! 6 | ======= 7 | 8 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan 9 | >>>>>>> ./tests/p_diffutils/files/tao 10 | . 11 | 11a 12 | <<<<<<< ./tests/p_diffutils/files/lao 13 | . 14 | 8c 15 | so we may see their result. 16 | . 17 | 2a 18 | >>>>>>> ./tests/p_diffutils/files/tao 19 | . 20 | 0a 21 | <<<<<<< ./tests/p_diffutils/files/tzu 22 | ======= 23 | . 24 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/diff3_show_overlap: -------------------------------------------------------------------------------- 1 | 11a 2 | ======= 3 | 4 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan 5 | >>>>>>> ./tests/p_diffutils/files/tao 6 | . 7 | 11a 8 | <<<<<<< ./tests/p_diffutils/files/lao 9 | . 10 | 8c 11 | so we may see their result. 12 | . 13 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/dir: -------------------------------------------------------------------------------- 1 | Common subdirectories: /var/tmp/difftest/a/1 and /var/tmp/difftest/b/1 2 | Only in /var/tmp/difftest/a: tzu 3 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/dir_X: -------------------------------------------------------------------------------- 1 | Common subdirectories: /var/tmp/difftest/a/1 and /var/tmp/difftest/b/1 2 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/dir_case: -------------------------------------------------------------------------------- 1 | Common subdirectories: /var/tmp/difftest/a/1 and /var/tmp/difftest/b/1 2 | Only in /var/tmp/difftest/b: lao 3 | Only in /var/tmp/difftest/a: LAO 4 | Only in /var/tmp/difftest/a: tzu 5 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/dir_r: -------------------------------------------------------------------------------- 1 | Only in /var/tmp/difftest/a/1: tao 2 | Files /var/tmp/difftest/a/lao and /var/tmp/difftest/b/lao are identical 3 | Only in /var/tmp/difftest/a: tzu 4 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/dir_s: -------------------------------------------------------------------------------- 1 | Common subdirectories: /var/tmp/difftest/a/1 and /var/tmp/difftest/b/1 2 | Files /var/tmp/difftest/a/lao and /var/tmp/difftest/b/lao are identical 3 | Only in /var/tmp/difftest/a: tzu 4 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/dir_unidirectional: -------------------------------------------------------------------------------- 1 | Common subdirectories: /var/tmp/difftest/b/1 and /var/tmp/difftest/a/1 2 | diff --unidirectional-new-file /var/tmp/difftest/b/tzu /var/tmp/difftest/a/tzu 3 | 0a1,13 4 | > The Nameless is the origin of Heaven and Earth; 5 | > The named is the mother of all things. 6 | > 7 | > Therefore let there always be non-being, 8 | > so we may see their subtlety, 9 | > And let there always be being, 10 | > so we may see their outcome. 11 | > The two are the same, 12 | > But after they are produced, 13 | > they have different names. 14 | > They both may be called deep and profound. 15 | > Deeper and more profound, 16 | > The door of all subtleties! 17 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/dir_x: -------------------------------------------------------------------------------- 1 | Common subdirectories: /var/tmp/difftest/a/1 and /var/tmp/difftest/b/1 2 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/e_F-G: -------------------------------------------------------------------------------- 1 | 1c 2 | g 3 | . 4 | diff: ./tests/p_diffutils/files/F: No newline at end of file 5 | 6 | diff: ./tests/p_diffutils/files/G: No newline at end of file 7 | 8 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/ed_script: -------------------------------------------------------------------------------- 1 | 11a 2 | They both may be called deep and profound. 3 | Deeper and more profound, 4 | The door of all subtleties! 5 | . 6 | 4c 7 | The named is the mother of all things. 8 | 9 | . 10 | 1,2d 11 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/ed_script-f: -------------------------------------------------------------------------------- 1 | d1 2 2 | c4 3 | The named is the mother of all things. 4 | 5 | . 6 | a11 7 | They both may be called deep and profound. 8 | Deeper and more profound, 9 | The door of all subtleties! 10 | . 11 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/exclude: -------------------------------------------------------------------------------- 1 | tz* 2 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/if_then_else: -------------------------------------------------------------------------------- 1 | #ifndef TWO 2 | The Way that can be told of is not the eternal Way; 3 | The name that can be named is not the eternal name. 4 | #endif /* ! TWO */ 5 | The Nameless is the origin of Heaven and Earth; 6 | #ifndef TWO 7 | The Named is the mother of all things. 8 | #else /* TWO */ 9 | The named is the mother of all things. 10 | 11 | #endif /* TWO */ 12 | Therefore let there always be non-being, 13 | so we may see their subtlety, 14 | And let there always be being, 15 | so we may see their outcome. 16 | The two are the same, 17 | But after they are produced, 18 | they have different names. 19 | #ifdef TWO 20 | They both may be called deep and profound. 21 | Deeper and more profound, 22 | The door of all subtleties! 23 | #endif /* TWO */ 24 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/label-change: -------------------------------------------------------------------------------- 1 | *** original 2 | --- modified 3 | *************** 4 | *** 1,6 **** 5 | - The Way that can be told of is not the eternal Way; 6 | - The name that can be named is not the eternal name. 7 | The Nameless is the origin of Heaven and Earth; 8 | ! The Named is the mother of all things. 9 | Therefore let there always be non-being, 10 | so we may see their subtlety, 11 | --- 1,5 ---- 12 | The Nameless is the origin of Heaven and Earth; 13 | ! The named is the mother of all things. 14 | ! 15 | Therefore let there always be non-being, 16 | so we may see their subtlety, 17 | *************** 18 | *** 10,11 **** 19 | --- 9,13 ---- 20 | But after they are produced, 21 | they have different names. 22 | + They both may be called deep and profound. 23 | + Deeper and more profound, 24 | + The door of all subtleties! 25 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/lao: -------------------------------------------------------------------------------- 1 | The Way that can be told of is not the eternal Way; 2 | The name that can be named is not the eternal name. 3 | The Nameless is the origin of Heaven and Earth; 4 | The Named is the mother of all things. 5 | Therefore let there always be non-being, 6 | so we may see their subtlety, 7 | And let there always be being, 8 | so we may see their outcome. 9 | The two are the same, 10 | But after they are produced, 11 | they have different names. 12 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/left_column: -------------------------------------------------------------------------------- 1 | The Way that can be told of is n < 2 | The name that can be named is no < 3 | The Nameless is the origin of He ( 4 | The Named is the mother of all t | The named is the mother of all t 5 | > 6 | Therefore let there always be no ( 7 | so we may see their subtlety, ( 8 | And let there always be being, ( 9 | so we may see their outcome. ( 10 | The two are the same, ( 11 | But after they are produced, ( 12 | they have different names. ( 13 | > They both may be called deep and 14 | > Deeper and more profound, 15 | > The door of all subtleties! 16 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/n_F-G: -------------------------------------------------------------------------------- 1 | d1 1 2 | a1 1 3 | g -------------------------------------------------------------------------------- /tests/p_diffutils/files/normal_format: -------------------------------------------------------------------------------- 1 | 1,2d0 2 | < The Way that can be told of is not the eternal Way; 3 | < The name that can be named is not the eternal name. 4 | 4c2,3 5 | < The Named is the mother of all things. 6 | --- 7 | > The named is the mother of all things. 8 | > 9 | 11a11,13 10 | > They both may be called deep and profound. 11 | > Deeper and more profound, 12 | > The door of all subtleties! 13 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/paginate: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1,2d0 4 | < The Way that can be told of is not the eternal Way; 5 | < The name that can be named is not the eternal name. 6 | 4c2,3 7 | < The Named is the mother of all things. 8 | --- 9 | > The named is the mother of all things. 10 | > 11 | 11a11,13 12 | > They both may be called deep and profound. 13 | > Deeper and more profound, 14 | > The door of all subtleties! 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/rcs_script: -------------------------------------------------------------------------------- 1 | d1 2 2 | d4 1 3 | a4 2 4 | The named is the mother of all things. 5 | 6 | a11 3 7 | They both may be called deep and profound. 8 | Deeper and more profound, 9 | The door of all subtleties! 10 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/sdiff_input: -------------------------------------------------------------------------------- 1 | l 2 | r 3 | l 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/sdiff_output: -------------------------------------------------------------------------------- 1 | The Way that can be told of is not the eternal Way; 2 | The name that can be named is not the eternal name. 3 | The Nameless is the origin of Heaven and Earth; 4 | The named is the mother of all things. 5 | 6 | Therefore let there always be non-being, 7 | so we may see their subtlety, 8 | And let there always be being, 9 | so we may see their outcome. 10 | The two are the same, 11 | But after they are produced, 12 | they have different names. 13 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/supress_common_lines: -------------------------------------------------------------------------------- 1 | The Way that can be told of is n < 2 | The name that can be named is no < 3 | The Named is the mother of all t | The named is the mother of all t 4 | > 5 | > They both may be called deep and 6 | > Deeper and more profound, 7 | > The door of all subtleties! 8 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/tao: -------------------------------------------------------------------------------- 1 | The Way that can be told of is not the eternal Way; 2 | The name that can be named is not the eternal name. 3 | The Nameless is the origin of Heaven and Earth; 4 | The named is the mother of all things. 5 | 6 | Therefore let there always be non-being, 7 | so we may see their subtlety, 8 | And let there always be being, 9 | so we may see their result. 10 | The two are the same, 11 | But after they are produced, 12 | they have different names. 13 | 14 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan 15 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/tzu: -------------------------------------------------------------------------------- 1 | The Nameless is the origin of Heaven and Earth; 2 | The named is the mother of all things. 3 | 4 | Therefore let there always be non-being, 5 | so we may see their subtlety, 6 | And let there always be being, 7 | so we may see their outcome. 8 | The two are the same, 9 | But after they are produced, 10 | they have different names. 11 | They both may be called deep and profound. 12 | Deeper and more profound, 13 | The door of all subtleties! 14 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/unified_format: -------------------------------------------------------------------------------- 1 | @@ -1,7 +1,6 @@ 2 | -The Way that can be told of is not the eternal Way; 3 | -The name that can be named is not the eternal name. 4 | The Nameless is the origin of Heaven and Earth; 5 | -The Named is the mother of all things. 6 | +The named is the mother of all things. 7 | + 8 | Therefore let there always be non-being, 9 | so we may see their subtlety, 10 | And let there always be being, 11 | @@ -9,3 +8,6 @@ 12 | The two are the same, 13 | But after they are produced, 14 | they have different names. 15 | +They both may be called deep and profound. 16 | +Deeper and more profound, 17 | +The door of all subtleties! 18 | -------------------------------------------------------------------------------- /tests/p_diffutils/files/unified_format-1: -------------------------------------------------------------------------------- 1 | @@ -1,5 +1,4 @@ 2 | -The Way that can be told of is not the eternal Way; 3 | -The name that can be named is not the eternal name. 4 | The Nameless is the origin of Heaven and Earth; 5 | -The Named is the mother of all things. 6 | +The named is the mother of all things. 7 | + 8 | Therefore let there always be non-being, 9 | @@ -11 +10,4 @@ 10 | they have different names. 11 | +They both may be called deep and profound. 12 | +Deeper and more profound, 13 | +The door of all subtleties! 14 | -------------------------------------------------------------------------------- /tests/p_dovecot/0-install_dovecot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - installation and startup of dovecot IMAP/POP3." 5 | 6 | # Install some pkgs needed by the tests 7 | t_InstallPackage nc grep dovecot 8 | 9 | t_ServiceControl dovecot start 10 | -------------------------------------------------------------------------------- /tests/p_dovecot/1-config_dovecot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | if (t_GetPkgRel dovecot | egrep -q 'el6|7|8') 5 | then 6 | t_Log "Running $0 - Configuration of Dovecot" 7 | 8 | cat > /etc/dovecot/conf.d/11-mail.conf < 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - remove unused MTAs and install exim" 6 | 7 | if (t_GetPkgRel basesystem | grep -q el5) 8 | then 9 | t_InstallPackage exim expect telnet 10 | # Remove other MTAs 11 | t_ServiceControl postfix stop 12 | t_ServiceControl sendmail stop 13 | sleep 3 14 | t_RemovePackage postfix sendmail 15 | # Fix exim.conf to not use IPv6 16 | sed -i 's/\:\:1//' /etc/exim/exim.conf 17 | t_ServiceControl exim start 18 | else 19 | t_Log "This seems to be a C6 system - skipping" 20 | fi 21 | 22 | -------------------------------------------------------------------------------- /tests/p_exim/10-test-sendmail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - testing if /usr/sbin/sendmail for exim is sane." 5 | 6 | if (t_GetPkgRel basesystem | grep -q el5) 7 | then 8 | mta=$(ls -H /usr/sbin/sendmail) 9 | 10 | if [ $mta == '/usr/sbin/sendmail' ] 11 | then 12 | t_Log "link to sendmail seems to be sane" 13 | ret_val=0 14 | else 15 | t_Log "link to sendmail seems to be wrong" 16 | ret_val=1 17 | fi 18 | else 19 | t_Log "This seems to be a C6 system - skipping" 20 | ret_val=0 21 | fi 22 | 23 | t_CheckExitStatus $ret_val 24 | -------------------------------------------------------------------------------- /tests/p_exim/15_exim_smtp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - Exim SMTP test." 6 | 7 | if (t_GetPkgRel basesystem | grep -q el5) 8 | then 9 | echo "helo test" | nc -i 1 -w 3 localhost 25 | grep -q '250' 10 | ret_val=$? 11 | else 12 | t_Log "This seems to be a C6 system - skipping" 13 | ret_val=0 14 | fi 15 | 16 | t_CheckExitStatus $ret_val 17 | -------------------------------------------------------------------------------- /tests/p_exim/_helper_exim_ehlo.expect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | # Author: Christoph Galuschka 3 | 4 | set timeout 1 5 | spawn telnet localhost 25 6 | expect "220 *" 7 | send -- "ehlo localhost\n" 8 | expect -- "250-PIPELINING" 9 | sleep 1 10 | send -- "mail from: root@localhost\n" 11 | expect -- "250\ OK" 12 | send -- "rcpt to: eximtest@localhost\n" 13 | expect -- "250\ Accepted" 14 | send -- "data\n" 15 | expect -- "354*" 16 | send -- "t_functional test\n.\n" 17 | expect -- "250\ OK*" 18 | send -- "quit\n" 19 | expect "221*closing\ connection" 20 | -------------------------------------------------------------------------------- /tests/p_exim/_helper_exim_helo.expect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | # Author: Christoph Galuschka 3 | 4 | set timeout 1 5 | spawn telnet localhost 25 6 | expect "220 *" 7 | send -- "helo localhost\n" 8 | expect -- "250*Hello\ localhost*" 9 | sleep 1 10 | send -- "mail from: root@localhost\n" 11 | expect -- "250\ OK" 12 | send -- "rcpt to: eximtest@localhost\n" 13 | expect -- "250\ Accepted" 14 | send -- "data\n" 15 | expect -- "354*" 16 | send -- "t_functional test\n.\n" 17 | expect -- "250\ OK*" 18 | send -- "quit\n" 19 | expect "221*closing\ connection" 20 | -------------------------------------------------------------------------------- /tests/p_file/00_file_package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | t_Log "Running $0 - checking if file package is installed" 4 | 5 | t_InstallPackage file 6 | 7 | t_Assert "rpm -q file" 8 | -------------------------------------------------------------------------------- /tests/p_file/01_file_mime_application.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: ??? 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - checking if file can recognize mime executable type " 6 | 7 | if [ "$centos_ver" -eq "8" ] ;then 8 | string="application/x-sharedlib" 9 | elif [ "$centos_ver" -eq "9" ] ;then 10 | string="application/x-pie-executable" 11 | else 12 | string="application/x-executable" 13 | fi 14 | 15 | file /bin/bash -i | grep -q "${string}" 16 | 17 | t_CheckExitStatus $? 18 | -------------------------------------------------------------------------------- /tests/p_file/02_file_mime_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: ??? 3 | # Christoph Galuschka 4 | # Rene Diepstraten 5 | 6 | t_Log "Running $0 - checking if file can recognize image mime file type " 7 | 8 | pngfile="$(find /usr/share/ -type f -name '*.png' -print -quit)" 9 | 10 | if [ -z "$pngfile" ];then 11 | t_Log "No png file found => SKIP" 12 | exit 0 13 | fi 14 | 15 | file $pngfile -i | grep -q 'image/png' 16 | 17 | t_CheckExitStatus $? 18 | -------------------------------------------------------------------------------- /tests/p_file/03_file_mime_symlink.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: ??? 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - checking if file can recognize symlink mime file type " 6 | 7 | TEST_FILE_PATH=/tmp/p_file_link_test 8 | 9 | ln -s /etc/hosts $TEST_FILE_PATH 10 | 11 | case $centos_ver in 12 | 5) 13 | mimetype='x-not-regular-file' 14 | ;; 15 | 6) 16 | mimetype='application/x-symlink' 17 | ;; 18 | *) 19 | mimetype='inode/symlink' 20 | ;; 21 | esac 22 | 23 | file -i $TEST_FILE_PATH | grep -q $mimetype 24 | ret_val=$? 25 | 26 | t_CheckExitStatus $ret_val 27 | -------------------------------------------------------------------------------- /tests/p_findutils/0-install_findutils: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "$0 - installing findutils" 5 | t_InstallPackage findutils 6 | -------------------------------------------------------------------------------- /tests/p_findutils/20-xargs_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Running $0" 3 | TMPDIR=/var/tmp/find 4 | # Basic xargs tests 5 | 6 | echo "Basic xargs tests" 7 | find "$TMPDIR" -type f -print0 | xargs -0 ls &>/dev/null 8 | #ls -l >/dev/null 9 | t_CheckExitStatus $? 10 | 11 | echo "Check xargs fails when filenames with spaces are passed in" 12 | find "$TMPDIR" -type f | xargs ls &>/dev/null && { t_Log "FAIL: This test returned 0 status incorrectly"; exit $FAIL; } 13 | t_Log "PASS" 14 | 15 | 16 | # Cleanup 17 | [[ -d "$TMPDIR" ]] && rm -rf "$TMPDIR" 18 | -------------------------------------------------------------------------------- /tests/p_firefox/00-install_firefox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | # Install firefox 5 | 6 | t_Log "Running $0 - installation of firefox." 7 | 8 | t_InstallPackage firefox 9 | 10 | -------------------------------------------------------------------------------- /tests/p_firefox/10-check_default_startpage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | # Check for centos.org in preferences.js 5 | t_Log "Running $0 - firefox has www.centos.org as default page." 6 | 7 | if (t_GetArch firefox | grep -q 'x86_64') 8 | then 9 | path='/usr/lib64/firefox/defaults/preferences/all-redhat.js' 10 | else 11 | path='/usr/lib/firefox/defaults/preferences/all-redhat.js' 12 | fi 13 | 14 | count=$(grep -c www.centos.org $path) 15 | 16 | if [ $count=2 ] 17 | then 18 | t_CheckExitStatus 0 19 | else 20 | t_CheckExitStatus 1 21 | fi 22 | -------------------------------------------------------------------------------- /tests/p_gcc-c++/0-install_gcc-c++.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Dries Verachtert 3 | 4 | t_Log "$0 - installing gcc-c++" 5 | t_InstallPackage gcc-c++ 6 | -------------------------------------------------------------------------------- /tests/p_gcc-c++/1-test_hello_world.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Dries Verachtert 3 | 4 | t_Log "Running $0 - test gcc-c++ with a hello world program" 5 | 6 | CPPBINARY=`mktemp` 7 | 8 | cat < 10 | int main(int argc, char** argv) { 11 | std::cout << "Hello world!" << std::endl; 12 | } 13 | EOF 14 | 15 | $CPPBINARY | grep -q "Hello world" 16 | t_CheckExitStatus $? 17 | 18 | rm -f $CPPBINARY 19 | -------------------------------------------------------------------------------- /tests/p_gcc-gnat/0-install_gcc-gnat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | # Author: Pablo Greco 3 | 4 | # Install gcc-gnat 5 | t_Log "Running $0 - installing gcc-gnat." 6 | 7 | 8 | # Install gcc-gnat 9 | if [ $centos_ver -eq 7 ]; then 10 | t_InstallPackage gcc-gnat 11 | else 12 | t_Log "This test is only valid in CentOS7." 13 | fi 14 | -------------------------------------------------------------------------------- /tests/p_gcc-gnat/test_gcc-gnat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Pablo Greco 3 | 4 | t_Log "Running $0 - gcc-gnat can build a hello.adb" 5 | 6 | if [ "$centos_ver" -ne 7 ] ; then 7 | t_Log "CentOS $centos_ver -> SKIP" 8 | exit 0 9 | fi 10 | 11 | # creating source code 12 | pushd '/var/tmp' >/dev/null 13 | FILE='/var/tmp/gcctesthello.adb' 14 | EXE='/var/tmp/gcctesthello' 15 | 16 | cat > $FILE </dev/null 35 | -------------------------------------------------------------------------------- /tests/p_gcc/0-install_gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | # Install gcc 5 | t_Log "Running $0 - installing gcc." 6 | 7 | t_InstallPackage gcc 8 | -------------------------------------------------------------------------------- /tests/p_gcc/test_gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | # Athmane Madjodj 4 | 5 | t_Log "Running $0 - gcc can build a hello world .c" 6 | 7 | # creating source code 8 | FILE='/var/tmp/gcc-test.c' 9 | EXE='/var/tmp/gcc' 10 | 11 | cat > $FILE < 13 | main() 14 | { 15 | printf("hello, centos\n"); 16 | } 17 | EOF 18 | 19 | # Executing gcc 20 | gcc $FILE -o $EXE 21 | 22 | # run EXE 23 | $EXE |grep -q 'hello, centos' 24 | t_CheckExitStatus $? 25 | 26 | # remove files 27 | /bin/rm $FILE 28 | /bin/rm $EXE 29 | 30 | 31 | -------------------------------------------------------------------------------- /tests/p_git/0-install_git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Pratima Singh , Nilesh Bairagi , Madhurranjan Mohaan 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - installing git" 6 | 7 | # Install git 8 | if [ $centos_ver -ge 6 ] 9 | then 10 | t_InstallPackage git 11 | else 12 | t_Log "This test is skipped in CentOS5." 13 | fi 14 | -------------------------------------------------------------------------------- /tests/p_git/10-test_git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Pratima Singh , Nilesh Bairagi , Madhurranjan Mohaan 3 | # Christoph Galuschka 4 | 5 | # Check git installation 6 | 7 | t_Log "Running $0 - checking git installation" 8 | 9 | if [ $centos_ver -ge 6 ] 10 | then 11 | git --version 12 | ret_val=$? 13 | else 14 | t_Log "This test is skipped in CentOS5." 15 | ret_val=0 16 | fi 17 | 18 | t_CheckExitStatus $ret_val 19 | -------------------------------------------------------------------------------- /tests/p_grep/00-install_grep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | # Author: Ravi Kumar P , Anoop Hallur 3 | t_Log "running $0 - installing grep" 4 | t_InstallPackage grep 5 | -------------------------------------------------------------------------------- /tests/p_grep/10-test_grep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Ravi Kumar P , Anoop Hallur 3 | 4 | # Check grep installation 5 | 6 | t_Log "Running $0 - checking grep installation" 7 | 8 | grep --version &>/dev/null 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_grep/11-test_grep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Ravi Kumar P , Anoop Hallur 3 | 4 | # Check grep functionality 5 | 6 | t_Log "Running $0 - checking grep functionality" 7 | 8 | echo "wow grep is working" | grep -q "wow" 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_grep/13-test_grep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Ravi Kumar P , Anoop Hallur 3 | 4 | # Check grep functionality with count of repititive words 5 | 6 | t_Log "Running $0 - checking grep with count" 7 | 8 | count=`echo -e "wow grep is working" | grep -c "wow"` 9 | t_Log $count 10 | 11 | t_Assert_Equals $count 1 12 | -------------------------------------------------------------------------------- /tests/p_grub/grub_dir_layout_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Note: This was a known issue in CentOS 6.0 4 | # See: http://bugs.centos.org/view.php?id=4995 5 | 6 | t_Log "Running $0 - check that grub file layout is the same with upstream." 7 | 8 | if [ "$centos_ver" -ge 7 ] ; then 9 | t_Log "el$centos_ver comes with grub2, skipping grub test ..." 10 | t_CheckExitStatus 0 11 | exit 0 12 | fi 13 | 14 | 15 | ARCH=`uname -m | sed 's/i6/i3/'` 16 | 17 | [[ $( ls /usr/share/grub/ | wc -l ) -eq 1 ]] && \ 18 | ls /usr/share/grub/ | grep -q "$ARCH-redhat" 19 | 20 | t_CheckExitStatus $? 21 | -------------------------------------------------------------------------------- /tests/p_grub2/01_grub2_secureboot_signed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This test will verify that grub2-efi is correctly signed with correct cert in the CA chain 3 | 4 | t_Log "Running $0 - Verifying that grub2-efi is correctly signed with correct cert" 5 | 6 | arch=$(uname -m) 7 | 8 | if [[ "$centos_ver" -ge 7 && "$arch" = "x86_64" ]] ; then 9 | t_InstallPackage pesign grub2-efi-x64 10 | pesign --show-signature --in /boot/efi/EFI/centos/grubx64.efi|egrep -q 'CentOS Secure Boot Signing 202' 11 | t_CheckExitStatus $? 12 | else 13 | t_Log "previous versions than CentOS 7 - or not x86_64 arch - aren't using secureboot ... skipping" 14 | exit 0 15 | fi 16 | 17 | -------------------------------------------------------------------------------- /tests/p_gzip/0_install_gzip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - attempting to install gzip." 5 | t_InstallPackage gzip zip diffutils less util-linux-ng expect 6 | if (t_GetPkgRel basesystem | grep -q el9) 7 | then 8 | t_Log "Ncompress unavailable in el9" 9 | else 10 | t_InstallPackage ncompress 11 | fi 12 | 13 | -------------------------------------------------------------------------------- /tests/p_gzip/30-gzexe-test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Author: Iain Douglas 3 | 4 | function ExitFail { 5 | t_Log "FAIL" 6 | exit $FAIL 7 | } 8 | 9 | t_Log Running $0 Check gzexe 10 | 11 | # Create a file to work with 12 | 13 | t_Log "Create file to work with" 14 | 15 | FILE=/var/tmp/gzexe-test-script 16 | rm $FILE* $OUTPUT &>/dev/null 17 | 18 | cat <$FILE 19 | #!/bin/bash 20 | echo "Hello World" 21 | EOF 22 | 23 | chmod +x $FILE 24 | $FILE | grep -q "Hello World" || ExitFail 25 | 26 | t_Log "Run file through gzexe" 27 | 28 | gzexe $FILE &>/dev/null || ExitFail 29 | 30 | t_Log "Check resultant file runs" 31 | $FILE | grep -q "Hello World" 32 | t_CheckExitStatus $? 33 | 34 | #Cleanup 35 | rm $FILE* 2>/dev/null 36 | 37 | -------------------------------------------------------------------------------- /tests/p_gzip/40-gcmp-gdiff-tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | function ExitFail { 5 | t_Log "FAIL" 6 | exit $FAIL 7 | } 8 | 9 | t_Log "Running $0 Check zcmp and zdiff" 10 | 11 | # We don't check that cmp and diff work - that should be done as 12 | # part of p_diffutils. 13 | 14 | BASEFILE=/var/tmp/gzip-test 15 | rm $BASEFILE* &>/dev/null 16 | 17 | # Create files to work with 18 | cat <$BASEFILE.1 19 | Some data to be testing with 20 | EOF 21 | 22 | 23 | gzip $BASEFILE.1 || exit FAIL 24 | cp $BASEFILE.1.gz $BASEFILE.2.gz 25 | 26 | t_Log "Check zcmp" 27 | zcmp $BASEFILE.1.gz $BASEFILE.2.gz || ExitFail 28 | 29 | t_Log "Check zdiff" 30 | zdiff $BASEFILE.1.gz $BASEFILE.2.gz 31 | t_CheckExitStatus $? 32 | 33 | rm $BASEFILE* 34 | 35 | -------------------------------------------------------------------------------- /tests/p_gzip/50-zgrep-tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | # 4 | 5 | # Only check zgrep as zegrep is zgrep -E and zfgrep is zgrep -F 6 | # also not testing grep - that should be done in p_grep 7 | 8 | t_Log "running $0 Testing zgrep" 9 | BASEFILE=/var/tmp/gzip-test 10 | rm $BASEFILE* &>/dev/null 11 | 12 | # Create files to work with 13 | cat <$BASEFILE.1 14 | Some data to be testing with 15 | EOF 16 | gzip $BASEFILE.1 17 | 18 | zgrep -q 'Some data to be testing with' $BASEFILE.1 19 | t_CheckExitStatus $? 20 | 21 | rm $BASEFILE* 22 | -------------------------------------------------------------------------------- /tests/p_gzip/60-zforce-tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | # 4 | 5 | # Test zforce - force a .gz extension on all suitable files. 6 | # Currently doesen't work see 7 | # http://bugs.centos.org/view.php?id=6096 8 | # 9 | 10 | function ExitFail { 11 | t_Log "FAIL" 12 | exit $FAIL 13 | } 14 | 15 | t_Log "Running $0 Testing zforce " 16 | t_Log "Skipped see http://bugs.centos.org/view.php?id=6096" 17 | exit 0 18 | 19 | BASEFILE=/var/tmp/12345678901234 20 | rm $BASEFILE* &>/dev/null 21 | 22 | # Create files to work with 23 | cat <$BASEFILE 24 | Some data to be testing with 25 | EOF 26 | 27 | gzip $BASEFILE 28 | mv $BASEFILE.gz $BASEFILE 29 | 30 | zforce $BASEFILE || ExitFail 31 | 32 | [ -e /var/tmp/12345678901234.gz ] 33 | t_CheckExitStatus $? 34 | 35 | rm /var/tmp/12345678901234.gz 36 | -------------------------------------------------------------------------------- /tests/p_gzip/70-zless-tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | # 4 | 5 | # The zless utility is a wrapper round less so just check that 6 | # it works as less should be tested as part of p_less 7 | # 8 | 9 | t_Log "Running $0 Testing zless " 10 | 11 | # -F makes less quit if the output all fits on one screen. 12 | 13 | zless -F ./tests/p_gzip/gzip-test.txt.gz | grep -q 'gzip-test of single file' 14 | t_CheckExitStatus $? 15 | 16 | -------------------------------------------------------------------------------- /tests/p_gzip/90-znew-tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iian Douglas 3 | 4 | # Test znew - converts .Z files to .gz 5 | # Create a test file 6 | 7 | if (t_GetPkgRel basesystem | grep -q el9) 8 | then 9 | t_Log "This is a C9 system. Ncompress not present. Skipping." 10 | t_CheckExitStatus 0 11 | exit $PASS 12 | fi 13 | 14 | t_Log "Running $0 - Testing znew" 15 | 16 | TESTFILE=/var/tmp/znew.txt 17 | rm $TESTFILE* &>/dev/null 18 | 19 | ls /usr/bin >$TESTFILE 20 | compress $TESTFILE 21 | 22 | znew $TESTFILE.Z 23 | t_CheckExitStatus $? 24 | -------------------------------------------------------------------------------- /tests/p_gzip/gzip-test.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentOS/sig-core-t_functional/19551e95cdc616bd82529403f25c9e0ae6c3d060/tests/p_gzip/gzip-test.txt.gz -------------------------------------------------------------------------------- /tests/p_httpd/0-install_httpd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | php_mysql="php-mysql" 6 | if [ $centos_ver -ge 7 ] 7 | then 8 | php_mysql="php-mysqlnd" 9 | fi 10 | 11 | curl="curl" 12 | if [ $centos_ver -ge 8 ] & [ "$CONTAINERTEST" -eq "1" ] 13 | then 14 | curl="curl" 15 | fi 16 | 17 | # Install tests deps 18 | t_Log "Running $0 - httpd: installing $curl, http, php and $php_mysql" 19 | 20 | #t_InstallPackage curl 21 | 22 | # HTTPD / PHP 23 | t_InstallPackage $curl httpd mod_ssl php $php_mysql 24 | t_ServiceControl httpd stop 25 | sleep 3 26 | killall httpd 27 | sleep 3 28 | t_ServiceControl httpd start 29 | 30 | -------------------------------------------------------------------------------- /tests/p_httpd/httpd_basic_auth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - httpd: basic authentication" 5 | 6 | cat > /etc/httpd/conf.d/dir-test-basic-auth.conf < 9 | AuthType Basic 10 | AuthName "Test" 11 | AuthUserFile /etc/httpd/htpasswd 12 | require user test 13 | 14 | EOF 15 | 16 | htpasswd -c -b /etc/httpd/htpasswd test test 17 | mkdir -p /var/www/html/basic_auth_test 18 | echo "Basic authentication Test Page" > /var/www/html/basic_auth_test/index.html 19 | t_ServiceControl httpd stop 20 | sleep 3 21 | killall httpd 22 | sleep 3 23 | t_ServiceControl httpd start 24 | 25 | curl -s -u test:test http://localhost/basic_auth_test/ | grep 'Basic authentication Test Page' > /dev/null 2>&1 26 | 27 | t_CheckExitStatus $? 28 | -------------------------------------------------------------------------------- /tests/p_httpd/httpd_centos_brand_server_tokens.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - httpd: centos branding / Server tokens value " 5 | 6 | curl -sI http://localhost/ | grep -i "Server:\ Apache.*\ (CentOS" > /dev/null 2>&1 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_httpd/httpd_centos_brand_welcome.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - httpd: Welcome page has CentOS Branding." 5 | 6 | curl -s http://localhost/ | grep 'CentOS' > /dev/null 2>&1 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_httpd/httpd_php.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - httpd: can parse a phpinfo/PHP page" 5 | 6 | echo "" > /var/www/html/test.php 7 | 8 | curl -s http://localhost/test.php | grep 'PHP Version' > /dev/null 2>&1 9 | 10 | t_CheckExitStatus $? 11 | -------------------------------------------------------------------------------- /tests/p_httpd/httpd_servehtml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - httpd: serve html page" 5 | 6 | curl -H 'Accept-Language: en' -s http://localhost/ | grep 'Test Page' > /dev/null 2>&1 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_httpd/httpd_servehtml_ssl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - httpd: serve html page over SSL " 5 | 6 | curl -H 'Accept-Language: en' -ks https://localhost/ | grep 'Test Page' > /dev/null 2>&1 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_initscripts/initscripts_centos_brand_rcsysinit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - initscripts CentOS branding " 5 | 6 | if [ "$centos_ver" -gt "5" ] ; then 7 | t_Log "Test not required for CentOS $centos_ver -> SKIP" 8 | exit 0 9 | else 10 | grep "CentOS" /etc/rc.sysinit > /dev/null 2>&1 11 | fi 12 | 13 | t_CheckExitStatus $? 14 | -------------------------------------------------------------------------------- /tests/p_initscripts/initscripts_service_status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | t_Log "Running $0 - check if service cmd can get service status" 10 | 11 | output_file=$(mktemp) 12 | trap "rm -f ${output_file}" EXIT 13 | 14 | # auditd is used as example because it's standard with minimal install 15 | if ! service auditd status > ${output_file} 2>&1; then 16 | cat ${output_file} 17 | t_CheckExitStatus 1 18 | fi 19 | 20 | t_CheckExitStatus 0 21 | -------------------------------------------------------------------------------- /tests/p_ipa-server/1-install_freeipa.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: James Hogarth 3 | # 4 | 5 | if (t_GetPkgRel basesystem | grep -qE 'el(6|7)') && !(t_GetArch | grep -qE 'aarch64') 6 | then 7 | t_Log "Running $0 - Installing java-1.6 to fix java-issues with 1.7/1.8, to be fixed with 6.7" 8 | t_InstallPackage java-1.6.0-openjdk 9 | t_Log "Running $0 - Installing packages, this takes around 2-3 mins" 10 | t_InstallPackage ipa-server bind-dyndb-ldap libsss_sudo 11 | else 12 | echo "Skipped on CentOS 5 and AArch64" 13 | fi 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/p_iptables/00_install_service.sh: -------------------------------------------------------------------------------- 1 | t_InstallPackage iptables-services 2 | systemctl start iptables 3 | systemctl enable iptables 4 | -------------------------------------------------------------------------------- /tests/p_iptables/iptables_default_rules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check iptables default rules" 5 | 6 | if [ "$centos_ver" -ge 7 ];then 7 | t_Log "CentOS $centos_ver uses firewalld and not iptables -> SKIP" 8 | t_CheckExitStatus 0 9 | exit 0 10 | fi 11 | 12 | if [ $SKIP_QA_HARNESS -eq 1 ]; then 13 | echo "Skip, No standard firewall config ..." 14 | else 15 | 16 | (grep "state --state ESTABLISHED,RELATED -j ACCEPT" /etc/sysconfig/iptables > /dev/null 2>&1 ) && \ 17 | 18 | (grep "state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT" /etc/sysconfig/iptables > /dev/null 2>&1 ) && \ 19 | 20 | (grep "REJECT --reject-with icmp-host-prohibited" /etc/sysconfig/iptables > /dev/null 2>&1 ) 21 | 22 | fi 23 | 24 | t_CheckExitStatus $? 25 | 26 | -------------------------------------------------------------------------------- /tests/p_iptables/iptables_kmod_loaded.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check if iptables kernel modules are loaded" 5 | 6 | if [ "$centos_ver" -ge 7 ];then 7 | t_Log "CentOS $centos_ver uses firewalld and not iptables -> SKIP" 8 | t_CheckExitStatus 0 9 | exit 0 10 | fi 11 | 12 | lsmod | grep "ip_tables" > /dev/null 2>&1 13 | 14 | t_CheckExitStatus $? 15 | 16 | -------------------------------------------------------------------------------- /tests/p_iptraf/0-install_iptraf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | t_Log "Running $0 - iptraf: install iptraf and which" 10 | 11 | # IPTraf traffic monitoring package 12 | t_InstallPackage iptraf 13 | 14 | # Required by the test 15 | t_InstallPackage which 16 | -------------------------------------------------------------------------------- /tests/p_iputils/0-install_iputils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - installing package iputils" 5 | t_InstallPackage iputils 6 | 7 | -------------------------------------------------------------------------------- /tests/p_java-1.6.0-openjdk/0-install-openjdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | # Install java 5 | if [ $centos_ver -ge 8 ]; then 6 | echo "Package not included in CentOS $centos_ver, skipping" 7 | exit 0 8 | fi 9 | if (t_GetArch | grep -qE 'aarch64|ppc64le') 10 | then 11 | echo "Package not included for current arch, skipping" 12 | exit 0 13 | fi 14 | 15 | t_Log "Running $0 - installing openjdk runtime/development environment." 16 | 17 | t_InstallPackage java-1.6.0-openjdk java-1.6.0-openjdk-devel 18 | -------------------------------------------------------------------------------- /tests/p_java-openjdk/0-install-openjdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Pablo Greco 3 | # Based on java-1.6.0-openjdk test from Christoph Galuschka 4 | 5 | . $(dirname "$0")/p_java-openjdk-common 6 | 7 | t_Log "Running $0 - installing openjdk runtime/development environment." 8 | 9 | for i in $JAVA_VERSIONS;do 10 | t_InstallPackage java-$i-openjdk java-$i-openjdk-devel 11 | done 12 | -------------------------------------------------------------------------------- /tests/p_java-openjdk/p_java-openjdk-common: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Pablo Greco 3 | # Based on java-1.6.0-openjdk test from Christoph Galuschka 4 | 5 | [ ${centos_ver} -lt 7 ] && { t_Log "Multiple java versions test is only available since el7, skipping tests..." ; exit ; } 6 | 7 | if [ ${centos_ver} -eq 8 ];then 8 | JAVA_VERSIONS="1.8.0 11" 9 | elif [ ${centos_ver} -eq 9 ];then 10 | JAVA_VERSIONS="1.8.0 11 17" 11 | else 12 | JAVA_VERSIONS="1.7.0 1.8.0 11" 13 | 14 | if (t_GetArch | grep -qvE 'aarch64|ppc64le') 15 | then 16 | JAVA_VERSIONS="1.6.0 $JAVA_VERSIONS" 17 | fi 18 | fi 19 | 20 | [ -z "${JAVA_VERSIONS}" ] && { t_Log "No java versions to test, skipping tests..." ; exit ; } 21 | -------------------------------------------------------------------------------- /tests/p_jwhois/0-install_jwhois.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | # nc (netcat) is required for the test 5 | 6 | if [ "$centos_ver" -ge 8 ] ;then 7 | t_Log "No whois package for CentOS $centos_ver -> SKIP" 8 | t_CheckExitStatus 0 9 | exit 0 10 | elif [ "$centos_ver" = "7" ] ;then 11 | whois_pkg="whois" 12 | else 13 | whois_pkg="jwhois" 14 | fi 15 | 16 | t_InstallPackage $whois_pkg nc 17 | 18 | -------------------------------------------------------------------------------- /tests/p_jwhois/jwhois_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$centos_ver" -ge 8 ] ;then 5 | exit 0 6 | fi 7 | t_Log "Running $0 - check that jwhois can connect to whois server and get the info." 8 | 9 | # Dummy whois server 10 | echo 'tf_jwhois_test_response' | nc -l 43 & 11 | sleep 1 12 | 13 | whois -h 127.0.0.1 domain.tld | grep -q 'tf_jwhois_test_response' 14 | 15 | t_CheckExitStatus $? 16 | -------------------------------------------------------------------------------- /tests/p_kvdo/0-install_kvdo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | if [ "$centos_ver" -ne "8" ]; then 10 | t_Log "non c8 => SKIPPING" 11 | exit 0 12 | fi 13 | 14 | t_Log "Running $0 - installing beakerlib" 15 | t_InstallPackage git make patch 16 | pushd /tmp 17 | git clone https://github.com/beakerlib/beakerlib 18 | cd beakerlib 19 | make 20 | make install 21 | popd 22 | -------------------------------------------------------------------------------- /tests/p_lftp/0_install_lftp.sh: -------------------------------------------------------------------------------- 1 | # Author: Piyush Kumar 2 | # Author: Munish Kumar 3 | # Author: Ayush Gupta 4 | # Author: Konark Modi 5 | 6 | t_Log "Running $0 -installing lftp." 7 | t_InstallPackage lftp 8 | -------------------------------------------------------------------------------- /tests/p_lftp/10_lftp_http_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Piyush Kumar 3 | # Author: Munish Kumar 4 | # Author: Ayush Gupta 5 | # Author: Konark Modi 6 | # Christoph Galuschka 7 | 8 | t_Log "Running $0 - lftp: HTTP test" 9 | 10 | if [ "$CONTAINERTEST" -eq "1" ]; then 11 | t_Log "Running in container -> SKIP" 12 | exit 0 13 | fi 14 | 15 | if [ $SKIP_QA_HARNESS -eq 1 ]; then 16 | URL="http://mirror.centos.org/" 17 | else 18 | URL="http://repo.centos.qa/srv/CentOS/" 19 | fi 20 | 21 | CHECK_FOR="UTC" 22 | FILE="timestamp.txt" 23 | 24 | t_Log "Querying ${URL}${FILE}" 25 | 26 | lftp < 3 | 4 | t_Log "Running $0 -installing libbpf-tools." 5 | if [ "$centos_ver" -ge 9 ] ; then 6 | t_InstallPackage libbpf-tools 7 | else 8 | t_Log "Skip on less than EL9" 9 | fi 10 | -------------------------------------------------------------------------------- /tests/p_libbpf/0_install_libbpf.sh: -------------------------------------------------------------------------------- 1 | # Author: Piyush Kumar 2 | # Author: Munish Kumar 3 | # Author: Ayush Gupta 4 | # Author: Konark Modi 5 | 6 | t_Log "Running $0 -installing libbpf and bcc-tools." 7 | if [ "$centos_ver" -ge 8 ] ; then 8 | t_InstallPackage libbpf 9 | t_InstallPackage bcc-tools 10 | else 11 | t_Log "Skip on less than EL8" 12 | fi 13 | -------------------------------------------------------------------------------- /tests/p_libbpf/10_test_bcc_tools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Piyush Kumar 3 | # Author: Munish Kumar 4 | # Author: Ayush Gupta 5 | # Author: Konark Modi 6 | # Christoph Galuschka 7 | 8 | 9 | t_Log "Running $0 - bcc-tools: argdist test" 10 | 11 | if [ -z "$CONTAINERTEST" ] && [ "$centos_ver" -ge 8 ]; then 12 | /usr/share/bcc/tools/argdist -i 1 -n 5 -C 'p:c:umask(u32 mask):u32:mask' 13 | else 14 | t_Log "Running in container -> SKIP" 15 | exit 0 16 | fi 17 | -------------------------------------------------------------------------------- /tests/p_libvirt/0-install_libvirt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | if (t_GetArch | grep -qE 'aarch64') 10 | then 11 | echo "Package not included with AArch64, skipping" 12 | exit 0 13 | fi 14 | 15 | t_Log "Running $0 - installing libvirt" 16 | t_InstallPackage libvirt 17 | service libvirtd restart 18 | -------------------------------------------------------------------------------- /tests/p_libvirt/libvirt_virsh_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | if (t_GetArch | grep -qE 'aarch64') 10 | then 11 | echo "Package not included with AArch64, skipping" 12 | exit 0 13 | fi 14 | 15 | t_Log "Running $0 - libvirt: Virsh can talk to local hypervisor." 16 | 17 | virsh -c test:///default list > /dev/null 18 | 19 | t_CheckExitStatus $? 20 | -------------------------------------------------------------------------------- /tests/p_libxml2-python/0-install-libxml2-python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author Dries Verachtert 3 | 4 | # Install libxml2-python 5 | t_Log "Running $0 - installing libxml2-python." 6 | 7 | if [ "$centos_ver" -ge 8 ] ; then 8 | t_InstallPackage python3 python3-libxml2 9 | else 10 | t_InstallPackage libxml2-python 11 | fi 12 | -------------------------------------------------------------------------------- /tests/p_logrotate/0-install_logrotate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - Installing logrotate" 5 | t_InstallPackage logrotate 6 | 7 | -------------------------------------------------------------------------------- /tests/p_logrotate/logrotate_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - logrotate: is happy with all configs" 5 | 6 | /usr/sbin/logrotate /etc/logrotate.conf 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_logwatch/0-install_logwatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "$0 - Installing logwatch" 5 | t_InstallPackage logwatch 6 | 7 | -------------------------------------------------------------------------------- /tests/p_logwatch/logwatch_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - logwatch test." 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_Log "Running in container -> SKIP" 8 | exit 0 9 | fi 10 | 11 | if [ "$centos_ver" -ge 7 ] ; then 12 | lw_options="--range Today" 13 | else 14 | lw_options="--range Today --print" 15 | fi 16 | 17 | logwatch ${lw_options}| grep -q 'Logwatch End' 18 | 19 | t_CheckExitStatus $? 20 | -------------------------------------------------------------------------------- /tests/p_lsb/0-install_redhat-lsb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | 5 | if (t_GetPkgRel basesystem | grep -q el9) 6 | then 7 | t_Log "This is a C9 system. redhat-lsb not present. Skipping." 8 | t_CheckExitStatus 0 9 | exit $PASS 10 | fi 11 | 12 | 13 | t_Log "$0 - Installing redhat-lsb" 14 | t_InstallPackage redhat-lsb 15 | -------------------------------------------------------------------------------- /tests/p_lsb/lsb_release_brand_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | if (t_GetPkgRel basesystem | grep -q el9) 5 | then 6 | t_Log "This is a C9 system. redhat-lsb not present. Skipping." 7 | t_CheckExitStatus 0 8 | exit $PASS 9 | fi 10 | 11 | t_Log "Running $0 - LSB CentOS branding check." 12 | 13 | lsb_release -i | grep -q "CentOS" && \ 14 | lsb_release -d | grep -q "CentOS" 15 | 16 | t_CheckExitStatus $? 17 | -------------------------------------------------------------------------------- /tests/p_lsof/0-install_lsof.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Madhurranjan Mohaan 3 | 4 | t_Log "Running $0 - installing lsof" 5 | 6 | # Install lsof 7 | t_InstallPackage lsof 8 | -------------------------------------------------------------------------------- /tests/p_lsof/10-test_lsof.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Madhurranjan Mohaan 4 | 5 | t_Log "Running $0 - testing lsof against ssh port" 6 | 7 | if [ "$CONTAINERTEST" -eq "1" ]; then 8 | t_Log "Running in container -> SKIP" 9 | exit 0 10 | fi 11 | 12 | sshd_status=`service sshd status | grep running` 13 | if ! [ "$sshd_status" ] 14 | then 15 | service sshd start 16 | fi 17 | t_InstallPackage openssh-server openssh-clients 18 | t_ServiceControl sshd start 19 | 20 | sshd_port_listening=`lsof -i:22 | grep LISTEN` 21 | if [ "$sshd_port_listening" ] 22 | then 23 | t_Log "Ssh port 22 is in the listening mode" 24 | ret_val=0 25 | else 26 | ret_val=1 27 | fi 28 | t_CheckExitStatus $ret_val 29 | -------------------------------------------------------------------------------- /tests/p_lynx/0-install_lynx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "$0 - installing Lynx" 5 | 6 | if [ "$centos_ver" -ge "8" ]; then 7 | t_Log "Package lynx not available in default repos on c8 => SKIP" 8 | exit 0 9 | fi 10 | 11 | t_InstallPackage lynx 12 | 13 | -------------------------------------------------------------------------------- /tests/p_lynx/lynx_default_page_centos_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check that lynx default page is CentOS welcome page ." 5 | 6 | if [ "$centos_ver" -ge "8" ]; then 7 | t_Log "Package lynx not available in default repos on c8 => SKIP" 8 | exit 0 9 | fi 10 | 11 | 12 | lynx -dump | grep "Welcome to CentOS" >/dev/null 2>&1 13 | 14 | t_CheckExitStatus $? 15 | -------------------------------------------------------------------------------- /tests/p_lynx/lynx_dump_page_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check that lynx can dump remote page." 5 | 6 | if [ "$centos_ver" -ge "8" ]; then 7 | t_Log "Package lynx not available in default repos on c8 => SKIP" 8 | exit 0 9 | fi 10 | 11 | 12 | if [ "$SKIP_QA_HARNESS" = "1" ] ; then 13 | URL="http://mirror.centos.org/" 14 | CHECK_FOR="timestamp" 15 | else 16 | URL="http://repo.centos.qa/qa/" 17 | CHECK_FOR="ks_cfg" 18 | fi 19 | 20 | lynx -dump ${URL} | grep "${CHECK_FOR}" >/dev/null 2>&1 21 | 22 | t_CheckExitStatus $? 23 | -------------------------------------------------------------------------------- /tests/p_lzop/0-install_lzop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Vivek Dubey 3 | # Akshay Karle 4 | # Christoph Galuschka 5 | 6 | t_Log "Running $0 - installing lzop" 7 | 8 | if [ $centos_ver = 5 ] 9 | then 10 | t_Log "This is a C5 system. Skipping." 11 | elif [ $(t_GetArch) = i686 ] 12 | then 13 | t_Log "Package not available in i386 architecture. Skipping" 14 | else 15 | t_InstallPackage lzop 16 | fi 17 | -------------------------------------------------------------------------------- /tests/p_mailman/0-install_mailman.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | if (t_GetPkgRel basesystem | grep -q el9) 10 | then 11 | t_Log "This is a C9 system. mailman not present. Skipping." 12 | t_CheckExitStatus 0 13 | exit $PASS 14 | fi 15 | 16 | t_Log "$0 - Installing mailman" 17 | t_InstallPackage mailman 18 | 19 | -------------------------------------------------------------------------------- /tests/p_mailman/mailman_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | if (t_GetPkgRel basesystem | grep -q el9) 10 | then 11 | t_Log "This is a C9 system. mailman not present. Skipping." 12 | t_CheckExitStatus 0 13 | exit $PASS 14 | fi 15 | 16 | t_Log "Running $0 - mailman test." 17 | 18 | # Add mailman list 19 | /usr/lib/mailman/bin/newlist -q mailman root@localhost.localdomain password > /dev/null 2>&1 20 | 21 | # Restart httpd (started in other tests) and start mailman 22 | t_ServiceControl httpd restart 23 | t_ServiceControl mailman start 24 | 25 | curl -s http://localhost/mailman/listinfo | grep -q 'localhost Mailing Lists' 26 | t_CheckExitStatus $? 27 | 28 | t_ServiceControl httpd stop 29 | t_ServiceControl mailman stop 30 | -------------------------------------------------------------------------------- /tests/p_mdadm/0-install-mdadm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # mdadm controls Linux md devices (software RAID arrays) 4 | t_InstallPackage mdadm 5 | -------------------------------------------------------------------------------- /tests/p_mdadm/5-test_mdadm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | t_Log "Running $0 - checking mdadm utility works and returns non-zero exit status." 4 | 5 | # mdadm utility only available to root 6 | [ ${EUID} -eq 0 ] || { t_Log "Not running as root, skipping this test. Non-fatal."; exit $PASS; } 7 | 8 | MDADM=`which mdadm` 9 | 10 | [ -z "${MDADM}" ] && { t_Log "Failed to find mdadm binary. That ain't good...."; exit $FAIL; } 11 | 12 | # even with no meta devices available, this should still return a 0 exit status 13 | ${MDADM} --detail --scan &>/dev/null 14 | 15 | [ $? -eq 0 ] || { t_Log "mdadm exited with non-zero status. That ain't good..."; exit $FAIL; } 16 | -------------------------------------------------------------------------------- /tests/p_mdadm/readme: -------------------------------------------------------------------------------- 1 | we just need to make sure that the packages are sane, most of the mdadm testing is done in the role tests 2 | -------------------------------------------------------------------------------- /tests/p_minicom/0-install_minicom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | # Install minicom 5 | t_InstallPackage minicom 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/p_minicom/minicom_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Author: Christoph Galuschka 4 | 5 | t_Log "Running $0 - minicom binary load test." 6 | 7 | # FIXME: this test is very basic 8 | minicom -h | grep -q "terminal program" 9 | 10 | t_CheckExitStatus $? 11 | -------------------------------------------------------------------------------- /tests/p_mod_python/0-install_mod_python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | if (t_GetPkgRel basesystem | grep -q el5) 5 | then 6 | t_InstallPackage mod_python 7 | service httpd restart 8 | else 9 | echo "Skipped on CentOS 6" 10 | fi 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/p_mod_wsgi/0-install_mod_wsgi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - installing mod_wsgi" 5 | 6 | if [[ $centos_ver -lt 6 || $centos_ver -gt 7 ]]; then 7 | t_Log "mod_wsgi not available before CentOS 6 or after CentOS 7 -> SKIP" 8 | exit 0 9 | fi 10 | 11 | t_InstallPackage mod_wsgi 12 | -------------------------------------------------------------------------------- /tests/p_mod_wsgi/20-remove_mod_wsgi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | t_Log "Running $0 - removing mod_wsgi" 4 | 5 | if [[ $centos_ver -lt 6 || $centos_ver -gt 7 ]]; then 6 | t_Log "mod_wsgi not available before CentOS 6 or after CentOS 7 -> SKIP" 7 | exit 0 8 | fi 9 | 10 | t_RemovePackage mod_wsgi 11 | -------------------------------------------------------------------------------- /tests/p_mtr/0-install_mtr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - installing package mtr" 5 | t_InstallPackage mtr 6 | 7 | -------------------------------------------------------------------------------- /tests/p_mysql/0-install_mysqld.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - installing and starting mysql server." 6 | 7 | # MySQL 8 | # starting with 5.10, we have to add mysql55 9 | 10 | if [ "$centos_ver" -ge 7 ] ; then 11 | my_packages="mariadb mariadb-server nc" 12 | mysql_service="mariadb" 13 | elif [ "$centos_ver" = "5" ] ;then 14 | my_packages="mysql mysql-server nc mysql55-mysql-server" 15 | mysql_service="mysqld" 16 | else 17 | my_packages="mysql mysql-server nc" 18 | mysql_service="mysqld" 19 | fi 20 | 21 | t_InstallPackage ${my_packages} 22 | 23 | t_ServiceControl ${mysql_service} start >/dev/null 2>&1 24 | -------------------------------------------------------------------------------- /tests/p_mysql/10_mysqld_conn_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | t_Log "Running $0 - mysqld client can talk to mysql server." 4 | 5 | 6 | HostName=$(hostname -s) 7 | MySqlHostName=$(mysql -N -B -u root -e "show variables like 'hostname'" | cut -f 2 | cut -d . -f 1) 8 | # printing both variables for debugging purposes 9 | echo $HostName 10 | echo ${MySqlHostName} 11 | if [ "$HostName" = "${MySqlHostName}" ]; then 12 | ret_val=0 13 | else 14 | ret_val=1 15 | fi 16 | t_CheckExitStatus $ret_val 17 | 18 | t_Log "Running $0 - mysqld listening test." 19 | grep 'skip-networking' /etc/my.cnf > /dev/null 20 | if [ $? -eq 1 ]; then 21 | # FIXME: Test is very basic 22 | >/dev/null 2>&1 >/dev/tcp/localhost/3306 23 | t_CheckExitStatus $? 24 | else 25 | t_Log "Skipped, looks like networking is disabled for mysql" 26 | fi 27 | -------------------------------------------------------------------------------- /tests/p_mysql/15_mysqld_create_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - MySQL create database test" 5 | 6 | mysql -u root -e 'create database mysql_test' >/dev/null 2>&1 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_mysql/20_mysqld_drop_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - MySQL drop database test." 5 | 6 | mysql -u root -e 'drop database mysql_test' >/dev/null 2>&1 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_mysql/25_mysqld_grant_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - MySQL GRANT privileges test" 5 | 6 | mysql -u root -e 'create database mysql_test;' > /dev/null 2>&1 7 | mysql -u root -e "grant all on mysql_test.* to mysql_test@localhost identified by 'mysqltest'" > /dev/null 2>&1 8 | mysql -u root -e "flush privileges;" > /dev/null 2>&1 9 | mysql -u mysql_test -pmysqltest mysql_test -e 'create table test_table(id int);' > /dev/null 2>&1 10 | ret_val=$? 11 | 12 | # Clean up 13 | mysql -u root -e 'drop database mysql_test;' > /dev/null 2>&1 14 | 15 | t_CheckExitStatus $ret_val 16 | -------------------------------------------------------------------------------- /tests/p_mysql/50_switch_to_mysql55.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - switching to mysql55 on C5." 6 | 7 | if [ $centos_ver = 5 ] 8 | then 9 | t_ServiceControl mysqld stop 10 | t_ServiceControl mysql55-mysqld start >/dev/null 2>&1 11 | else 12 | t_Log "This is not a C5 system - skipping" 13 | fi 14 | -------------------------------------------------------------------------------- /tests/p_mysql/60_mysqld55_conn_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | t_Log "Running $0 - mysqld client can talk to mysql55 server." 4 | 5 | if [ $centos_ver -gt 5 ] 6 | then 7 | t_Log 'mysql55 is only avialable on C5, skipping' 8 | t_CheckExitStatus 0 9 | exit 0 10 | fi 11 | 12 | HostName=$(hostname -s) 13 | MySqlHostName=$(mysql -N -B -u root -e "show variables like 'hostname'" | cut -f 2 | cut -d . -f 1) 14 | if [ $HostName = ${MySqlHostName} ]; then 15 | ret_val=0 16 | else 17 | ret_val=1 18 | fi 19 | t_CheckExitStatus $ret_val 20 | 21 | t_Log "Running $0 - mysqld listening test." 22 | grep 'skip-networking' /etc/my.cnf > /dev/null 23 | if [ $? -eq 1 ]; then 24 | # FIXME: Test is very basic 25 | nc -d -w 1 localhost 3306 >/dev/null 2>&1 26 | t_CheckExitStatus $? 27 | else 28 | t_Log "Skipped, looks like networking is disabled for mysql" 29 | fi 30 | -------------------------------------------------------------------------------- /tests/p_mysql/65_mysqld55_create_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - MySQL55 create database test" 6 | 7 | if [ $centos_ver -gt 5 ] 8 | then 9 | t_Log 'mysql55 is only supported on C5, skipping' 10 | t_CheckExitStatus 0 11 | exit 0 12 | fi 13 | 14 | mysql -u root -e 'create database mysql_test' >/dev/null 2>&1 15 | t_CheckExitStatus $? 16 | -------------------------------------------------------------------------------- /tests/p_mysql/70_mysqld55_drop_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - MySQL55 drop database test." 6 | 7 | if [ $centos_ver -gt 5 ] 8 | then 9 | t_Log 'mysql55 is only supported on C5, skipping' 10 | t_CheckExitStatus 0 11 | exit 0 12 | fi 13 | 14 | mysql -u root -e 'drop database mysql_test' >/dev/null 2>&1 15 | t_CheckExitStatus $? 16 | -------------------------------------------------------------------------------- /tests/p_mysql/75_mysqld55_grant_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - MySQL55 GRANT privileges test" 6 | 7 | if [ $centos_ver -gt 5 ] 8 | then 9 | t_Log 'mysql55 is only supported on C5, skipping' 10 | t_CheckExitStatus 0 11 | exit 0 12 | fi 13 | 14 | mysql -u root -e 'create database mysql_test;' > /dev/null 2>&1 15 | mysql -u root -e "grant all on mysql_test.* to mysql_test@localhost identified by 'mysqltest'" > /dev/null 2>&1 16 | mysql -u root -e "flush privileges;" > /dev/null 2>&1 17 | mysql -u mysql_test -pmysqltest mysql_test -e 'create table test_table(id int);' > /dev/null 2>&1 18 | ret_val=$? 19 | 20 | # Clean up 21 | mysql -u root -e 'drop database mysql_test;' > /dev/null 2>&1 22 | 23 | t_CheckExitStatus $ret_val 24 | -------------------------------------------------------------------------------- /tests/p_net-snmp/0-install_snmpd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - attempting to install net-snmp, net-snmp-utils" 5 | 6 | # Install net-snmp and net-snmp-utils 7 | t_InstallPackage net-snmp net-snmp-utils 8 | 9 | # start daemon with default settings 10 | t_ServiceControl snmpd start 11 | 12 | -------------------------------------------------------------------------------- /tests/p_net-snmp/snmpv1_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | if (t_GetPkgRel basesystem | grep -q el9) 5 | then 6 | t_Log "This is a C9 system. Snmpwal failing. Fix later. Skipping." 7 | t_CheckExitStatus 0 8 | exit $PASS 9 | fi 10 | 11 | 12 | t_Log "Running $0 - snmpv1 test" 13 | 14 | snmpwalk -v 1 -c public 127.0.0.1 > /dev/null 2>&1 15 | 16 | t_CheckExitStatus $? 17 | -------------------------------------------------------------------------------- /tests/p_net-snmp/snmpv2c_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Author: Christoph Galuschka 4 | 5 | 6 | if (t_GetPkgRel basesystem | grep -q el9) 7 | then 8 | t_Log "This is a C9 system. Snmpwal failing. Fix later. Skipping." 9 | t_CheckExitStatus 0 10 | exit $PASS 11 | fi 12 | 13 | t_Log "Running $0 - snmpv2c test" 14 | 15 | snmpwalk -v 2c -c public 127.0.0.1 > /dev/null 2>&1 16 | 17 | t_CheckExitStatus $? 18 | -------------------------------------------------------------------------------- /tests/p_network/network_device_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - Check if a least one network device is available." 5 | 6 | ifconfig | grep -q ether 7 | 8 | export eth_int=$(ip addr|grep -B 1 "link/ether"|head -n 1|awk '{print $2}'|tr -d ':') 9 | 10 | t_CheckExitStatus $? 11 | -------------------------------------------------------------------------------- /tests/p_network/networking_enabled_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - Check if networking is enabled." 5 | 6 | if [ "$centos_ver" -ge 7 ] ; then 7 | t_Log "CentOS $centos_ver -> SKIP" 8 | exit 0 9 | else 10 | grep -Eqi "NETWORKING=.*yes" /etc/sysconfig/network 11 | t_CheckExitStatus $? 12 | fi 13 | -------------------------------------------------------------------------------- /tests/p_nfs/0-install_nfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | # NFS 5 | t_InstallPackage nfs-utils 6 | 7 | if [ "$centos_ver" = "5" ] ; then 8 | t_serviceControl portmap restart 9 | else 10 | t_ServiceControl rpcbind restart 11 | fi 12 | 13 | if [ "$centos_ver" -ge 8 ] ; then 14 | t_ServiceControl nfs-server start 15 | else 16 | # Restart because usualy NFS is enabled by default on CentOS-5 17 | t_ServiceControl nfs restart 18 | fi 19 | -------------------------------------------------------------------------------- /tests/p_nmap/0_install_nmap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - install package nmap" 5 | t_InstallPackage nmap 6 | 7 | -------------------------------------------------------------------------------- /tests/p_nmap/nmap_test_eth0.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - nmap querys eth0 and checks for open ssh-port" 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_Log "Running in container -> SKIP" 8 | exit 0 9 | fi 10 | 11 | # Grabing IP of eth0 12 | IP=$(ip -f inet addr list eth0 | grep 'inet ') 13 | regex='.*inet\ (.*)\/.*' 14 | if [[ $IP =~ $regex ]] 15 | then 16 | t_Log "Found eth0 IP - starting nmap test" 17 | nmap ${BASH_REMATCH[1]} | grep -iq ssh 18 | fi 19 | 20 | t_CheckExitStatus $? 21 | -------------------------------------------------------------------------------- /tests/p_nmap/nmap_test_lo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | t_Log "Running $0 - nmap querys loopback and checks for open ssh port" 10 | 11 | nmap 127.0.0.1 | grep -qi ssh 12 | 13 | t_CheckExitStatus $? 14 | -------------------------------------------------------------------------------- /tests/p_ntp/0-install_ntp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | 4 | if [ "$centos_ver" -ge 8 ] ; then 5 | t_Log "no ntp in CentOS $centos_ver ... SKIP" 6 | exit 0 7 | fi 8 | # NTPd 9 | t_InstallPackage ntp 10 | -------------------------------------------------------------------------------- /tests/p_ntp/5-start-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | 4 | if [ "$centos_ver" -ge 8 ] ; then 5 | exit 0 6 | fi 7 | # Start NTPd services and confirm it's running. 8 | t_ServiceControl ntpd start 9 | 10 | NTPD_PID=$(pidof ntpd) 11 | 12 | [ "$NTPD_PID" ] || { t_Log "FAIL: couldn't find 'ntpd' in the process list."; exit $FAIL; } 13 | -------------------------------------------------------------------------------- /tests/p_ntp/ntp_centos_servers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Ref.: http://bugs.centos.org/view.php?id=4943 4 | 5 | if [ "$centos_ver" -ge 8 ] ; then 6 | exit 0 7 | fi 8 | t_Log "Running $0 - NTP is using CentOS server pool test." 9 | 10 | grep ".centos.pool.ntp.org" /etc/ntp.conf > /dev/null 2>&1 11 | 12 | t_CheckExitStatus $? 13 | -------------------------------------------------------------------------------- /tests/p_openssh/0-install_sshd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | # expect is needed by the test 5 | t_InstallPackage openssh-server openssh-clients expect 6 | t_ServiceControl sshd start 7 | -------------------------------------------------------------------------------- /tests/p_openssh/_helper_sshd_user_login-with-key.expect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | # Author: Athmane Madjoudj 3 | 4 | set timeout 2 5 | spawn ssh -o StrictHostKeyChecking=no sshtest@localhost /bin/cat ssh_test_file 6 | send -- "\r" 7 | expect eof 8 | -------------------------------------------------------------------------------- /tests/p_openssh/_helper_sshd_user_login.expect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | # Author: Athmane Madjoudj 3 | 4 | set timeout 2 5 | spawn ssh -o StrictHostKeyChecking=no sshtest@localhost /bin/ls 6 | match_max 6000 7 | expect "*?assword:*" 8 | send -- "sshtest\r" 9 | send -- "\r" 10 | expect eof 11 | -------------------------------------------------------------------------------- /tests/p_openssh/sshd_conn_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | # FIXME: Test is very basic 5 | 6 | t_Log "Running $0 - SSHD is listening test." 7 | 8 | >/dev/null 2>&1 >/dev/tcp/localhost/22 9 | 10 | t_CheckExitStatus $? 11 | -------------------------------------------------------------------------------- /tests/p_openssh/sshd_user_login.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | userdel -rf sshtest; useradd sshtest && echo sshtest | passwd --stdin sshtest 5 | 6 | # Create a test file 7 | touch /home/sshtest/ssh_test_file 8 | 9 | t_Log "Running $0 - SSH Interactive user login test." 10 | 11 | if [ "$CONTAINERTEST" -eq "1" ]; then 12 | t_Log "Running in container -> SKIP" 13 | exit 0 14 | fi 15 | 16 | if [ `egrep "^PasswordAuthentication" /etc/ssh/sshd_config | tail -n1 | egrep "\syes$" | wc -l ` -gt 0 ]; then 17 | ./tests/p_openssh/_helper_sshd_user_login.expect | grep "ssh_test_file" > /dev/null 2>&1 18 | t_CheckExitStatus $? 19 | userdel -rf sshtest 20 | else 21 | t_Log 'Skipped' 22 | fi 23 | -------------------------------------------------------------------------------- /tests/p_openssl/0_install_openssl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - attempting to install openssl." 5 | t_InstallPackage openssl 6 | 7 | -------------------------------------------------------------------------------- /tests/p_passwd/0_install_passwd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | # Ensure packages we use are installed 5 | t_Log "Running $0 installing required packages" 6 | t_InstallPackage passwd expect 7 | -------------------------------------------------------------------------------- /tests/p_passwd/10_passwd_basic_test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Author: Iain Douglas 3 | # 4 | t_Log "Running $0 - Basic passwd functionality checks" 5 | 6 | userdel -rf passtest; useradd passtest &>/dev/null 7 | echo passtest | passwd --stdin passtest &>/dev/null 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_passwd/TODO: -------------------------------------------------------------------------------- 1 | # I don't understand what -k is supposed to do. 2 | # Without changing the date and time I can't think of a way to test 3 | # that -x -w and -i are working 4 | -------------------------------------------------------------------------------- /tests/p_passwd/_user_password.expect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -d 2 | # Author: Iain Douglas 3 | 4 | set timeout 10 5 | match_max 6000 6 | spawn su passtest -c passwd 7 | expect -re "(UNIX|Current) password:" { send -- "passtest\r" } 8 | expect { 9 | "You must wait longer to change your password" 10 | { 11 | exit 2 12 | } 13 | "Authentication token manipulation error" 14 | { 15 | exit 3 16 | } 17 | "Current Password:" { 18 | send -- "passtest\r" 19 | expect { 20 | "Authentication token manipulation error" 21 | { 22 | exit 3 23 | } 24 | } 25 | } 26 | "password:" 27 | { 28 | send -- "ano24ther\r" 29 | expect "*?\[pP]assword:*" 30 | send -- "ano24ther\r" 31 | expect eof 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /tests/p_perf/00_install_perf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Carlos Rodriguez-Fernandez 3 | 4 | t_Log "Running $0 -installing perf" 5 | t_InstallPackage perf 6 | -------------------------------------------------------------------------------- /tests/p_perf/01_perf_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Carlos Rodriguez-Fernandez 3 | 4 | 5 | t_Log "Running $0" 6 | 7 | output_file=$(mktemp) 8 | trap "rm -f ${output_file}" EXIT 9 | 10 | if ! perf version > ${output_file} 2>&1; then 11 | cat ${output_file} 12 | t_CheckExitStatus 1 13 | fi 14 | 15 | t_CheckExitStatus 0 16 | -------------------------------------------------------------------------------- /tests/p_perf/02_perf_functionality.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Carlos Rodriguez-Fernandez 3 | 4 | 5 | t_Log "Running $0" 6 | 7 | output_file=$(mktemp) 8 | trap "rm -f ${output_file}; rm -f perf.data" EXIT 9 | 10 | t_Log "Running $0: perf record" 11 | if ! perf record -F 49 -a -g -- sleep 1 > ${output_file} 2>&1; then 12 | cat ${output_file} 13 | t_CheckExitStatus 1 14 | fi 15 | 16 | t_Log "Running $0: perf report" 17 | if ! perf report --stats > ${output_file} 2>&1; then 18 | cat ${output_file} 19 | t_CheckExitStatus 1 20 | fi 21 | 22 | t_CheckExitStatus 0 23 | -------------------------------------------------------------------------------- /tests/p_perl/0-install_perl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Madhurranjan Mohaan 3 | 4 | t_Log "Running $0 - installing perl" 5 | 6 | # Install perl 7 | t_InstallPackage perl 8 | -------------------------------------------------------------------------------- /tests/p_perl/10-test_perl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Madhurranjan Mohaan 3 | 4 | # Check perl installation 5 | 6 | t_Log "Running $0 - checking perl installation" 7 | 8 | perl --version &>/dev/null 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_perl/20-run_perl_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Madhurranjan Mohaan 4 | 5 | t_Log "Running $0 - Testing perl by running it against a basic file" 6 | 7 | echo 'print "helloworld perlpackage"' > testfile 8 | perl testfile | grep -q helloworld 9 | 10 | t_CheckExitStatus $? 11 | -------------------------------------------------------------------------------- /tests/p_php/0_install_php-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - attempting to install php-cli." 5 | t_SkipReleaseGreaterThan 7 'use module-aware tests instead' 6 | t_InstallPackage php-cli 7 | 8 | -------------------------------------------------------------------------------- /tests/p_php/10-php-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Author: Christoph Galuschka 4 | 5 | t_Log "Running $0 - php test: looking for Zend Engine in phpinfo()." 6 | t_SkipReleaseGreaterThan 7 'use module-aware tests instead' 7 | 8 | FILE='/var/tmp/php-test.php' 9 | 10 | cat > $FILE < 14 | EOF 15 | 16 | # setting timezone for phpinfo 17 | sed -i 's/\;date\.timezone\ \=/date\.timezone = \"Europe\/Berlin\"/' /etc/php.ini 18 | 19 | php $FILE | grep -q 'Zend Engine' 20 | 21 | t_CheckExitStatus $? 22 | 23 | #reversing changes 24 | /bin/rm $FILE 25 | sed -i 's/\date\.timezone\ \=\ \"Europe\/Berlin\"/\;date\.timezone\ \=/' /etc/php.ini 26 | -------------------------------------------------------------------------------- /tests/p_php_7.2/10_php_api.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | t_Log "Running $0 - verify PHP API in phpinfo()" 4 | t_SkipReleaseLessThan 8 'no modularity' 5 | 6 | API='20170718' 7 | 8 | if (t_GetPkgRel basesystem | grep -q el9) 9 | then 10 | t_Log "This is a C9 system. Php 7.2 module not present. Skipping." 11 | t_CheckExitStatus 0 12 | exit $PASS 13 | fi 14 | 15 | t_EnableModuleStream php:7.2 16 | 17 | t_InstallPackage php-cli 18 | 19 | t_Log "Executing phpinfo()" 20 | output=$(php -d 'date.timezone=UTC' -r 'phpinfo();') 21 | t_CheckExitStatus $? 22 | 23 | 24 | t_Log "Verifying PHP API matches $API" 25 | grep -q "PHP API => $API" <<< $output 26 | t_CheckExitStatus $? 27 | 28 | t_RemovePackage php-cli 29 | t_ResetModule php httpd nginx 30 | -------------------------------------------------------------------------------- /tests/p_php_7.3/10_php_api.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if (t_GetPkgRel basesystem | grep -q el9) 4 | then 5 | t_Log "This is a C9 system. Modular php not present. Skipping." 6 | t_CheckExitStatus 0 7 | exit $PASS 8 | fi 9 | 10 | t_Log "Running $0 - verify PHP API in phpinfo()" 11 | t_SkipReleaseLessThan 8 'no modularity' 12 | 13 | t_EnableModuleStream php:7.3 14 | t_InstallPackage php-cli 15 | 16 | t_Log "Executing phpinfo()" 17 | output=$(php -d 'date.timezone=UTC' -r 'phpinfo();') 18 | t_CheckExitStatus $? 19 | 20 | API='20180731' 21 | 22 | t_Log "Verifying PHP API matches $API" 23 | grep -q "PHP API => $API" <<< $output 24 | t_CheckExitStatus $? 25 | 26 | t_RemovePackage php-cli 27 | t_ResetModule php httpd nginx 28 | -------------------------------------------------------------------------------- /tests/p_podman/00_install_podman.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Carlos Rodriguez-Fernandez 3 | 4 | t_Log "Running $0 - installing podman." 5 | 6 | if [ "$centos_ver" -lt 8 ] ; then 7 | t_Log "SKIP $0: only install in centos stream 8 or greater" 8 | exit 0 9 | fi 10 | 11 | t_InstallPackage podman 12 | -------------------------------------------------------------------------------- /tests/p_postfix/0-install_postfix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - remove unused MTAs and install postfix" 5 | 6 | # Remove other MTAs 7 | t_ServiceControl sendmail stop 8 | t_ServiceControl exim stop 9 | sleep 3 10 | t_RemovePackage sendmail exim 11 | 12 | # Postfix 13 | t_InstallPackage postfix nc rsyslog 14 | t_ServiceControl postfix start 15 | t_ServiceControl rsyslog start 16 | 17 | -------------------------------------------------------------------------------- /tests/p_postfix/10_postfix_smtp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - Postfix SMTP test." 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_Log "Running in container -> SKIP" 8 | exit 0 9 | fi 10 | 11 | echo "helo test" | nc -w 3 127.0.0.1 25 | grep -q '250' 12 | 13 | t_CheckExitStatus $? 14 | -------------------------------------------------------------------------------- /tests/p_postgresql/0-install_postgresql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 3 | 4 | t_Log "Running $0 - initializing and starting PostgreSQL" 5 | 6 | t_Log "Initialize PostgreSQL DB " 7 | if [ $centos_ver -ge 8 ]; then 8 | postgresql-setup --initdb 9 | elif (t_GetPkgRel postgresql | grep -q el7) then 10 | postgresql-setup initdb 11 | elif (t_GetPkgRel postgresql | grep -q el6) then 12 | service postgresql initdb 13 | fi 14 | 15 | t_ServiceControl postgresql start 16 | sleep 15 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/p_postgresql/postgresql_create_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - PostgreSQL create database test" 5 | if (t_GetPkgRel basesystem | grep -q el9) 6 | then 7 | t_Log "This is a C9 system. Postgres needs to be initialized." 8 | /usr/bin/postgresql-setup --initdb 9 | fi 10 | 11 | su - postgres -c 'createdb pg_testdb' 12 | t_CheckExitStatus $? 13 | -------------------------------------------------------------------------------- /tests/p_postgresql/postgresql_create_user_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - PostgreSQL create user test" 5 | 6 | su - postgres -c 'createuser -S -R -D test_user' > /dev/null 2>&1 7 | 8 | 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_postgresql/postgresql_drop_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - PostgreSQL drop database test." 5 | su - postgres -c 'dropdb pg_testdb' > /dev/null 2>&1 6 | t_CheckExitStatus $? 7 | -------------------------------------------------------------------------------- /tests/p_postgresql/postgresql_drop_user_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - PostgreSQL drop user test" 5 | 6 | su - postgres -c 'dropuser test_user' > /dev/null 2>&1 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_procinfo/0-install_procinfo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | # Athmane Madjoudj 4 | # Christoph Galuschka 5 | 6 | t_Log "Running $0 - attempting to install procinfo" 7 | 8 | if [ "$centos_ver" -gt "5" ] ; then 9 | t_Log "It seems to be a CentOS $centos_ver system, this test will be disabled -> SKIP" 10 | exit 0 11 | else 12 | # ProcInfo Utility Package 13 | t_InstallPackage procinfo 14 | fi 15 | -------------------------------------------------------------------------------- /tests/p_procinfo/5-test_procinfo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | # Athmane Madjoudj 4 | # Christoph Galuschka 5 | 6 | t_Log "Running $0 - checking procinfo runs and returns non-zero exit status." 7 | 8 | if [ "$centos_ver" -gt "5" ] ; then 9 | t_Log "It seems to be a CentOS $centos_ver system, this test will be disabled -> SKIP" 10 | exit 0 11 | else 12 | if [ $SKIP_QA_HARNESS -eq 1 ]; then 13 | t_Log "Skip, seems to fail on CI ..." 14 | else 15 | 16 | PROCINFO=`which procinfo` 17 | 18 | $PROCINFO &>/dev/null 19 | 20 | t_CheckExitStatus $? 21 | fi 22 | fi 23 | -------------------------------------------------------------------------------- /tests/p_python-iniparse/0-install-python-iniparse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author Dries Verachtert 3 | 4 | # Install python-iniparse: required by yum so a quite important package in CentOS 5 | t_Log "Running $0 - installing python-iniparse." 6 | 7 | if [ "$centos_ver" -ge 8 ] ; then 8 | t_InstallPackage python3 python3-iniparse 9 | else 10 | t_InstallPackage python-iniparse 11 | fi 12 | -------------------------------------------------------------------------------- /tests/p_python/0-install-python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | # Install python 5 | t_Log "Running $0 - installing python." 6 | 7 | if [ "$centos_ver" -ge 8 ] ; then 8 | t_InstallPackage python3 9 | else 10 | t_InstallPackage python 11 | fi 12 | -------------------------------------------------------------------------------- /tests/p_python/10-test_python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | # Athmane Madjodj 4 | 5 | t_Log "Running $0 - python can print Hello World" 6 | 7 | if [ "$centos_ver" -ge 8 ] ; then 8 | PYTHON=python3 9 | else 10 | PYTHON=python 11 | fi 12 | 13 | # creating source file 14 | FILE='/var/tmp/python-test.py' 15 | 16 | cat > $FILE < SKIP" 7 | exit 0 8 | fi 9 | 10 | t_InstallPackage python3-mod_wsgi 11 | -------------------------------------------------------------------------------- /tests/p_python3-mod_wsgi/20-remove_python3-mod_wsgi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | t_Log "Running $0 - removing python3-mod_wsgi" 4 | 5 | if [[ $centos_ver -lt 8 ]]; then 6 | t_Log "python3-mod_wsgi doesn't exist before CentOS 8 -> SKIP" 7 | exit 0 8 | fi 9 | 10 | t_RemovePackage python3-mod_wsgi 11 | -------------------------------------------------------------------------------- /tests/p_python38-mod_wsgi/0-install_python38-mod_wsgi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | t_Log "Running $0 - installing python38-mod_wsgi" 4 | 5 | 6 | if (t_GetPkgRel basesystem | grep -q el9) 7 | then 8 | t_Log "This is a C9 system. python38-mod-wsgi not present. Skipping." 9 | t_CheckExitStatus 0 10 | exit $PASS 11 | fi 12 | 13 | 14 | if [[ $centos_ver -lt 8 ]]; then 15 | t_Log "python38-mod_wsgi doesn't exist before CentOS 8 -> SKIP" 16 | exit 0 17 | fi 18 | 19 | # TODO: remove after 8.2 rebuild 20 | if [[ $centos_stream == "no" ]]; then 21 | t_Log "python38-mod_wsgi is only in CentOS Stream -> SKIP" 22 | exit 0 23 | fi 24 | 25 | t_InstallPackage python38-mod_wsgi 26 | -------------------------------------------------------------------------------- /tests/p_python38-mod_wsgi/20-remove_python38-mod_wsgi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | if (t_GetPkgRel basesystem | grep -q el9) 5 | then 6 | t_Log "This is a C9 system. python38-mod_wsgi not present. Skipping." 7 | t_CheckExitStatus 0 8 | exit $PASS 9 | fi 10 | 11 | t_Log "Running $0 - removing python38-mod_wsgi" 12 | 13 | if [[ $centos_ver -lt 8 ]]; then 14 | t_Log "python38-mod_wsgi doesn't exist before CentOS 8 -> SKIP" 15 | exit 0 16 | fi 17 | 18 | # TODO: remove after 8.2 rebuild 19 | if [[ $centos_stream == "no" ]]; then 20 | t_Log "python38-mod_wsgi is only in CentOS Stream -> SKIP" 21 | exit 0 22 | fi 23 | 24 | t_RemovePackage python38-mod_wsgi 25 | -------------------------------------------------------------------------------- /tests/p_rootfiles/0-install-rootfiles: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "$0 - installing rootfiles" 5 | t_InstallPackage rootfiles 6 | -------------------------------------------------------------------------------- /tests/p_rootfiles/10-rootfiles: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "Running $0 test rootfiles exist" 5 | 6 | # 7 | # Simply test that the files in the package exist in /root 8 | # 9 | 10 | for file in .bash_logout .bash_profile .bashrc .cshrc .tcshrc 11 | do 12 | echo "Checking $file" 13 | [ -e /root/$file ] || { t_Log "FAIL: $file is missing"; exit $FAIL; } 14 | t_Log "PASS" 15 | done 16 | -------------------------------------------------------------------------------- /tests/p_rpm/rpm_remove_pkg_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - rpm remove package test." 5 | 6 | # Install zsh pkg 7 | t_InstallPackage zsh 8 | 9 | rpm -e zsh && \ 10 | rpm -q zsh | grep -q 'package zsh is not installed' 11 | 12 | t_CheckExitStatus $? 13 | 14 | t_Log "Clean yum metadata / cache" 15 | yum -y clean all 16 | -------------------------------------------------------------------------------- /tests/p_rrdtool/0-install_rrdtool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | # Athmane Madjoudj 4 | 5 | if [ $centos_ver -ge 6 ] 6 | then 7 | # Install rrdtool 8 | t_InstallPackage rrdtool 9 | else 10 | echo "Skipped on CentOS 5" 11 | fi 12 | 13 | -------------------------------------------------------------------------------- /tests/p_rsync/0-install-rsync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - installing rsync and xinetd." 5 | 6 | if [ "$centos_ver" -ge 8 ]; then 7 | t_InstallPackage rsync rsync-daemon 8 | else 9 | t_InstallPackage xinetd rsync 10 | fi 11 | 12 | # Restart in case previous tests allready installed xinetd 13 | if [ "$centos_ver" -ge 7 ]; then 14 | systemctl start rsyncd.service 15 | else 16 | # enable rsync in /etc/xinet.d/rsync 17 | sed -i 's/\(disable\s*=\ \)yes/\1no/' /etc/xinetd.d/rsync 18 | t_ServiceControl xinetd restart 19 | fi 20 | -------------------------------------------------------------------------------- /tests/p_ruby/0-install-ruby.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Nikhil Lanjewar 3 | # Author: Sahil Muthoo 4 | # Author: Sahil Aggarwal 5 | # Author: Saager Mhatre 6 | 7 | t_Log "Running $0 - attempting to install ruby, ruby-irb, ruby-ri and ruby-rdoc4" 8 | if [ "$centos_ver" -ge 8 ] ; then 9 | t_InstallPackage ruby ruby-irb rubygem-rdoc 10 | else 11 | t_InstallPackage ruby ruby-irb ruby-ri ruby-rdoc 12 | fi 13 | 14 | -------------------------------------------------------------------------------- /tests/p_ruby/10-ruby-installed-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Nikhil Lanjewar 3 | # Author: Sahil Muthoo 4 | # Author: Sahil Aggarwal 5 | # Author: Saager Mhatre 6 | 7 | t_Log "Running $0 - Check successful installation of ruby." 8 | ruby -v 9 | t_CheckExitStatus $? 10 | 11 | -------------------------------------------------------------------------------- /tests/p_ruby/20-ruby-version-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Nikhil Lanjewar 3 | # Author: Sahil Muthoo 4 | # Author: Sahil Aggarwal 5 | # Author: Saager Mhatre 6 | # Christoph Galuschka 7 | 8 | t_Log "Running $0 - Check version of ruby." 9 | 10 | if [ "$centos_ver" -ge 9 ] ; then 11 | ruby -v | grep -q '3.' 12 | ret_val=$? 13 | elif [ "$centos_ver" = "8" ] ; then 14 | ruby -v | grep -q '2.5' 15 | ret_val=$? 16 | elif [ "$centos_ver" = "7" ] ; then 17 | ruby -v | grep -q '2.0' 18 | ret_val=$? 19 | elif [ "$centos_ver" = "6" ] ; then 20 | ruby -v | grep -q '1.8.7' 21 | ret_val=$? 22 | else 23 | ruby -v | grep -q '1.8.5' 24 | ret_val=$? 25 | fi 26 | 27 | t_CheckExitStatus $ret_val 28 | 29 | -------------------------------------------------------------------------------- /tests/p_ruby/25_ruby_hello-world.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - ruby can run 'hello world'" 5 | 6 | # create ruby script 7 | FILE=/var/tmp/test.rb 8 | cat > $FILE < 3 | # Author: Sahil Muthoo 4 | # Author: Sahil Aggarwal 5 | # Author: Saager Mhatre 6 | # Christoph Galuschka 7 | 8 | t_Log "Running $0 - Check version of irb." 9 | 10 | #allready prepared just in case versions should change between C5 and C6 11 | if [ "$centos_ver" -ge "9" ] ; then 12 | irb -v | grep -q 'irb' 13 | ret_val=$? 14 | elif [ "$centos_ver" = "7" -o "$centos_ver" = "8" ] ; then 15 | irb -v | grep -q '0.9.6' 16 | ret_val=$? 17 | else 18 | irb -v | grep -q '0.9.5' 19 | ret_val=$? 20 | fi 21 | 22 | t_CheckExitStatus $ret_val 23 | -------------------------------------------------------------------------------- /tests/p_ruby/40-ri-version-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Nikhil Lanjewar 3 | # Author: Sahil Muthoo 4 | # Author: Sahil Aggarwal 5 | # Author: Saager Mhatre 6 | # Christoph Galuschka 7 | 8 | t_Log "Running $0 - Check version of ruby ri." 9 | 10 | #allready prepared just in case versions should change between C5 and C6 11 | if [ "$centos_ver" -ge "8" ] ; then 12 | ri -v | grep -q '6.' 13 | ret_val=$? 14 | elif [ "$centos_ver" = "7" ] ; then 15 | ri -v | grep -q '4.0' 16 | ret_val=$? 17 | else 18 | ri -v | grep -q '1.0.1' 19 | ret_val=$? 20 | fi 21 | 22 | t_CheckExitStatus $ret_val 23 | 24 | -------------------------------------------------------------------------------- /tests/p_ruby/50-rdoc-version-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Nikhil Lanjewar 3 | # Author: Sahil Muthoo 4 | # Author: Sahil Aggarwal 5 | # Author: Saager Mhatre 6 | # Christoph Galuschka 7 | 8 | t_Log "Running $0 - Check version of rdoc." 9 | 10 | #allready prepared just in case versions should change between C5 and C6 11 | if [ "$centos_ver" -ge 8 ] ; then 12 | rdoc -v | grep -q '6.' 13 | ret_val=$? 14 | elif [ "$centos_ver" = "7" ] ; then 15 | t_Log "CentOS $centos_ver rdoc has no version in cli -> SKIP" 16 | t_CheckExitStatus 0 17 | exit 0 18 | else 19 | rdoc -v | grep -q '1.0.1' 20 | ret_val=$? 21 | fi 22 | 23 | t_CheckExitStatus $ret_val 24 | 25 | -------------------------------------------------------------------------------- /tests/p_samba/0-install_samba.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | t_InstallPackage samba samba-client cifs-utils 10 | 11 | t_ServiceControl smb start 12 | -------------------------------------------------------------------------------- /tests/p_screen/0-install_screen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # GNU Screen 4 | t_Log "Running $0 - installing screen" 5 | if [ "$centos_ver" -ge 8 ] ; then 6 | t_Log "CentOS $centos_ver -> SKIP" 7 | exit 0 8 | fi 9 | t_InstallPackage screen 10 | -------------------------------------------------------------------------------- /tests/p_selinux/0_install_tools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Fabian Arrotin 3 | 4 | t_Log "Running $0 - install package selinux policycoreutils tools" 5 | if [ "$centos_ver" = "6" ] ; then 6 | t_InstallPackage policycoreutils-python 7 | elif [ "$centos_ver" -ge 8 ] ; then 8 | t_InstallPackage python3-libselinux 9 | else 10 | t_InstallPackage libselinux-python 11 | fi 12 | -------------------------------------------------------------------------------- /tests/p_selinux/selinux_alerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check for SELinux alerts (AVC)" 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_Log "Running in container -> SKIP" 8 | exit 0 9 | fi 10 | 11 | grep -v "AVC" /var/log/audit/audit.log > /dev/null 2>&1 12 | 13 | t_CheckExitStatus $? 14 | 15 | -------------------------------------------------------------------------------- /tests/p_selinux/selinux_enforce.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check if SELinux is in enforcing mode" 5 | 6 | if [ "$centos_ver" -ge 7 ] ; then 7 | selinux_file=/sys/fs/selinux/enforce 8 | else 9 | selinux_file=/selinux/enforce 10 | fi 11 | 12 | if [ "$SKIP_QA_HARNESS" = "1" ] ; then 13 | t_Log "Skipping this test ..." 14 | else 15 | cat $selinux_file | grep 1 > /dev/null 2>&1 16 | t_CheckExitStatus $? 17 | fi 18 | 19 | -------------------------------------------------------------------------------- /tests/p_selinux/selinux_policy_mismatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$centos_ver" -ge 8 ] ; then 4 | PYTHON=python3 5 | else 6 | PYTHON=python 7 | fi 8 | 9 | t_Log "Running $0 - Testing audit2why for policy mismatch ..." 10 | 11 | 12 | if [ "$CONTAINERTEST" -eq "1" ]; then 13 | t_Log "Running in container -> SKIP" 14 | exit 0 15 | fi 16 | 17 | cat << __EOF__ | $PYTHON - 18 | import sys 19 | import selinux.audit2why as audit2why 20 | 21 | try: 22 | audit2why.init() 23 | except: 24 | sys.exit(1) 25 | sys.exit(0) 26 | __EOF__ 27 | 28 | t_CheckExitStatus $? 29 | -------------------------------------------------------------------------------- /tests/p_sendmail/0-install_sendmail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - remove unused MTAs and install sendmail" 5 | 6 | t_InstallPackage sendmail nc 7 | 8 | # Remove other MTAs 9 | t_ServiceControl postfix stop 10 | t_ServiceControl exim stop 11 | sleep 3 12 | t_RemovePackage postfix exim 13 | 14 | t_ServiceControl sendmail start 15 | -------------------------------------------------------------------------------- /tests/p_sendmail/10_sendmail_smtp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | t_Log "Running $0 - Sendmail SMTP test." 10 | 11 | echo "helo test" | nc -4 -w 3 localhost 25 | grep -q '250' 12 | 13 | t_CheckExitStatus $? 14 | -------------------------------------------------------------------------------- /tests/p_sendmail/15-test-sendmail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - testing if /usr/sbin/sendmail for sendmail is sane." 5 | 6 | mta=$(ls -H /usr/sbin/sendmail) 7 | 8 | if [ $mta == '/usr/sbin/sendmail' ] 9 | then 10 | t_Log "link to sendmail seems to be sane" 11 | ret_val=0 12 | else 13 | t_Log "link to sendmail seems to be wrong" 14 | ret_val=1 15 | fi 16 | 17 | t_CheckExitStatus $ret_val 18 | -------------------------------------------------------------------------------- /tests/p_setup/group_file_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - group file sanity check." 5 | 6 | if [ "$centos_ver" -ge 8 ] ;then 7 | nobody_grpid="65534" 8 | else 9 | nobody_grpid="99" 10 | fi 11 | 12 | grep -q 'root:x:0' /etc/group && \ 13 | grep -q 'bin:x:1' /etc/group && \ 14 | grep -q 'daemon:x:2' /etc/group && \ 15 | grep -q "nobody:x:${nobody_grpid}" /etc/group 16 | 17 | 18 | t_CheckExitStatus $? 19 | -------------------------------------------------------------------------------- /tests/p_setup/passwd_file_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - passwd file sanity check." 5 | 6 | if [ "$centos_ver" -ge 8 ] ;then 7 | nobody_grpid="65534" 8 | else 9 | nobody_grpid="99" 10 | fi 11 | 12 | grep -q 'root:x:0' /etc/passwd && \ 13 | grep -q "nobody:x:${nobody_grpid}" /etc/passwd 14 | 15 | 16 | t_CheckExitStatus $? 17 | -------------------------------------------------------------------------------- /tests/p_setup/shells_file_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - shells file sanity check." 5 | 6 | grep -q 'bash' /etc/shells 7 | 8 | 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/0-install_shadow_utils: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | # Ensure the packages we require are available 4 | 5 | t_Log "Running $0 installing required packages" 6 | t_InstallPackage shadow-utils 7 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/10-basic_test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | # 4 | # Basic tests for the shadow utils package. Check that the /etc/default 5 | # directory and /etc/default/useradd files exist. 6 | 7 | t_Log "Running $0 Basic tests" 8 | 9 | echo "Check packace files exist" 10 | [[ -d /etc/default ]] || { t_Log "FAIL: /etc/default missing"; exit $FAIL; } 11 | [[ -e /etc/default/useradd ]] || { t_Log "FAIL: /etc/default/useradd missing"; exit $FAIL; } 12 | [[ -e /etc/login.defs ]] || { t_Log "FAIL: /etc/login.defs missing"; exit $FAIL; } 13 | t_Log "PASS" 14 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/11-useradd_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "Running $0" 5 | 6 | grep -q "^shadowuser" /etc/passwd && userdel -r shadowuser 7 | 8 | # Basic useradd tests 9 | echo "Add user shadowuser" 10 | useradd shadowuser 11 | t_CheckExitStatus $? 12 | echo "Check user was created" 13 | grep -q "^shadowuser" /etc/passwd 14 | t_CheckExitStatus $? -------------------------------------------------------------------------------- /tests/p_shadow-utils/12-usermod_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "Running $0 - Modify user shadowuser" 5 | 6 | usermod -c "Comment plugh" shadowuser 7 | t_CheckExitStatus $? 8 | echo "Check /etc/passwd was modified" 9 | grep "^shadowuser" /etc/passwd | grep -q "Comment plugh" 10 | t_CheckExitStatus $? 11 | 12 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/13-chpasswd_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "Running $0 - Checking chpasswd" 5 | 6 | chpasswd -e < 3 | 4 | t_Log "Running $0 - Testing newusers" 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_Log "Running in container -> SKIP" 8 | exit 0 9 | fi 10 | 11 | grep -q "^xyssy" /etc/passwd && { t_Log "FAIL: user xyssy alredy exists"; exit $FAIL; } 12 | newusers < 3 | 4 | t_Log "Running $0 - Checking lastlog" 5 | lastlog -u shadowuser | grep -q '**Never logged in**' 6 | t_CheckExitStatus $? 7 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/19-userdel_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "Running $0 - Delete user shadowuser" 5 | userdel -r shadowuser 6 | t_CheckExitStatus $? 7 | echo "Check user was deleted" 8 | grep -q "^shadowuser" /etc/passwd && { t_Log "FAIL: shadowuser not deletd"; exit $FAIL;} 9 | t_Log "PASS" 10 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/20-chage_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "Running $0" 5 | 6 | userdel -rf testshadow; useradd testshadow 7 | echo "testshadow" | passwd --stdin testshadow 8 | 9 | echo "Set last date passwd changed to 2013-01-01" 10 | chage -d 2013-01-01 testshadow 11 | t_CheckExitStatus $? 12 | 13 | echo "Check that last passwd change is reported correctly" 14 | chage -l testshadow | grep Last | grep -q "Jan 01, 2013" 15 | t_CheckExitStatus $? 16 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/30-groupadd_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | t_Log "Running $0 group add tests" 4 | 5 | # Delete any info from previous runs, use sed because we haven't yet tested 6 | # groupdel 7 | sed -i /testgroup/d /etc/group 8 | 9 | echo "Create a new group" 10 | groupadd -g 1010 testgroup 11 | t_CheckExitStatus $? 12 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/31-gpasswd_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | t_Log "Running $0 - gpasswd tests" 4 | 5 | echo "Add a user to testgroup and create /etc/gshadow" 6 | gpasswd -a testshadow testgroup 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/32-groupmems_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | [ $centos_ver == '5' ] && exit 4 | t_Log "Running $0 - group add tests" 5 | 6 | echo "Simple groupmems test" 7 | groupmems -g testgroup -l | grep -q "testshadow" 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/33-newgrp_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | # Check that the user can change their primary group. This relies on the 5 | # observation that the current primary group is printed first 6 | # 7 | t_Log "Running $0 - Basic newgrp test" 8 | groups testshadow | grep -q "testshadow testgroup" || { t_Log "FAIL: Default testshadow user group information incorrect"; exit $FAIL; } 9 | echo OK 10 | echo $( su - testshadow < 3 | 4 | t_Log "Running $0" 5 | 6 | # Check that the testgroup exists with GID 1010 7 | grep -q "testgroup:x:1010:testshadow" /etc/group || { t_Log "FAIL Test group doesn't exist"; exit $FAIL; } 8 | 9 | echo "Changing GID for group testgroup to 1011" 10 | groupmod -g 1011 testgroup 11 | t_CheckExitStatus $? 12 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/35-grpck-tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "Running $0" 5 | 6 | # If we're on C5 delete the group 990991 which was added by newusers 7 | if (( $centos_ver == 5 )) 8 | then 9 | sed -i /990991/d /etc/group 10 | fi 11 | echo "Testing valid files" 12 | [[ -e /etc/group ]] || { t_Log { "FAIL: /etc/group doesn't exist"; exit $FAIL; } 13 | #Check system files 14 | echo "Checking /etc files are correect" 15 | grpck 16 | t_CheckExitStatus $? 17 | echo "Checking malformed files are detected" 18 | 19 | echo "test:x::" >/var/tmp/gshadow 20 | echo ":test:x:0::" >/var/tmp/group 21 | grpck -r /var/tmp/group /var/tmp/gshadow && { t_Log "FAIL: Malformed files not detected"; exit $FAIL; } 22 | t_Log "PASS" 23 | rm /var/tmp/group /var/tmp/gshadow 24 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/36-groupdel-tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | t_Log "Running $0" 5 | 6 | # Check that we can delete the testgroup 7 | echo "Check we can delete the group 'testgroup'" 8 | 9 | grep -q testgroup /etc/group || { t_Log "FAIL: testgroup doesn't exist"; exit $FAIL; } 10 | groupdel testgroup 11 | t_CheckExitStatus $? 12 | 13 | # Try and remove the same group shoudl fail 14 | echo "Additional tests - non existent group" 15 | groupdel testgroup 16 | if (( $? == 6 )) 17 | then 18 | t_Log "PASS" 19 | else 20 | t_Log "Fail" 21 | exit $FAIL 22 | fi 23 | 24 | # Try and remove a user's primary group - should fail 25 | echo "Additional tests - users primary group" 26 | groupdel testshadow 27 | if (( $? == 8 )) 28 | then 29 | t_Log "PASS" 30 | else 31 | t_Log "Fail" 32 | exit $FAIL 33 | fi 34 | 35 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/39-sg_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | t_Log "Running $0 - Testing sg" 4 | sg testshadow "touch /var/tmp/sg" 5 | t_CheckExitStatus $? 6 | echo "Check sg worked" 7 | ls -l /var/tmp/sg | grep -q testshadow 8 | t_CheckExitStatus $? 9 | rm /var/tmp/sg 10 | -------------------------------------------------------------------------------- /tests/p_shadow-utils/99-cleanup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Iain Douglas 3 | 4 | # Have a go at cleaning up the temporary files and accounts etc 5 | userdel -r xyssy &>/dev/null 6 | userdel -r testshadow &>/dev/null 7 | rm -r /var/tmp/pwconv 8 | rm -r /var/tmp/grpconv 9 | rm -r /var/tmp/pwunconv 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/p_shim/01_shim_secureboot_signed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This test will verify that shim.efi is correctly signed with correct cert in the CA chain 3 | 4 | t_Log "Running $0 - Verifying that shim.efi is correctly signed with correct cert" 5 | 6 | if [[ "$centos_ver" = "7" && "$arch" = "x86_64" ]] ; then 7 | t_InstallPackage pesign shim 8 | pesign --show-signature --in /boot/efi/EFI/centos/shim.efi|grep -q 'Microsoft Windows UEFI Driver Publisher' 9 | t_CheckExitStatus $? 10 | elif [[ "$centos_ver" -ge "8" && "$arch" = "x86_64" ]] ; then 11 | t_InstallPackage pesign shim 12 | pesign --show-signature --in /boot/efi/EFI/centos/shimx64.efi |grep -q 'Microsoft Windows UEFI Driver Publisher' 13 | t_CheckExitStatus $? 14 | else 15 | t_Log "previous versions than CentOS 7 - or not x86_64 arch - aren't using shim/secureboot ... skipping" 16 | exit 0 17 | fi 18 | 19 | -------------------------------------------------------------------------------- /tests/p_spamassassin/0-install_spamassassin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_InstallPackage spamassassin 5 | 6 | -------------------------------------------------------------------------------- /tests/p_spamassassin/spamassassin_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check that spamassassin can detect spam." 5 | 6 | if [ "$centos_ver" -lt 8 ] ; then 7 | VERSION=-`t_GetPkgVer spamassassin` 8 | fi 9 | spamassassin --lint &&\ 10 | spamassassin < /usr/share/doc/spamassassin${VERSION}/sample-spam.txt | grep -q 'X-Spam-Flag: YES' 11 | 12 | t_CheckExitStatus $? 13 | -------------------------------------------------------------------------------- /tests/p_sqlite/0-install_sqlite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_InstallPackage sqlite 5 | 6 | -------------------------------------------------------------------------------- /tests/p_sqlite/sqlite_1-create_db_table.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check that sqlite can create database and tables." 5 | 6 | sqlite3 /tmp/tf_test.db 'drop table if exists tf_table;' 7 | sqlite3 /tmp/tf_test.db 'create table tf_table(text, id INTEGER);' 8 | 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_sqlite/sqlite_2-insert_table.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check that sqlite can insert into table." 5 | 6 | sqlite3 /tmp/tf_test.db "insert into tf_table values ('tf_sample_text',1);" 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_sqlite/sqlite_dump_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check that sqlite can dump database." 5 | 6 | sqlite3 /tmp/tf_test.db ".dump" | grep -q 'tf_sample_text' 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_sqlite/sqlite_select_table.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check that sqlite can select from table." 5 | 6 | sqlite3 /tmp/tf_test.db "select * from tf_table;" | grep -q 'tf_sample_text' 7 | 8 | t_CheckExitStatus $? 9 | -------------------------------------------------------------------------------- /tests/p_squid/0-install_squid.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "$0 - installing Squid" 5 | t_InstallPackage squid 6 | 7 | # Add host entry 8 | echo "127.0.0.1 `hostname`" >> /etc/hosts 9 | 10 | service squid restart 11 | t_CheckForPort 3128 12 | 13 | -------------------------------------------------------------------------------- /tests/p_squid/squid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - Squid test." 5 | 6 | if [ $SKIP_QA_HARNESS -eq 1 ]; then 7 | URL="http://mirror.centos.org/" 8 | CHECK_FOR="timestamp" 9 | else 10 | URL="http://repo.centos.qa/qa/" 11 | CHECK_FOR="ks_cfg" 12 | fi 13 | 14 | squidclient -T 2 ${URL} | grep "${CHECK_FOR}" >/dev/null 2>&1 15 | 16 | t_CheckExitStatus $? 17 | -------------------------------------------------------------------------------- /tests/p_squirrelmail/0-install_squirrelmail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | # NOTE: squirrelmail rpm has require: httpd php php-mbstring 5 | # Squirellmail has been removed from el6 6 | 7 | t_Log "Running $0 - install squirrelmail" 8 | if [ "$centos_ver" -gt "5" ] ;then 9 | t_Log "It seems to be a CentOS $centos_ver system, this test will be disabled -> SKIP" 10 | exit 0 11 | else 12 | t_InstallPackage squirrelmail 13 | t_ServiceControl httpd restart 14 | fi 15 | -------------------------------------------------------------------------------- /tests/p_squirrelmail/squirrelmail_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | t_Log "Running $0 - test SquirrelMail URL" 4 | 5 | if [ "$centos_ver" -gt "5" ] ;then 6 | t_Log "It seems to be a CentOS $centos_ver system, this test will be disabled -> SKIP" 7 | exit 0 8 | else 9 | curl -s http://localhost/webmail/src/login.php | grep 'SquirrelMail' > /dev/null 2>&1 10 | fi 11 | 12 | t_CheckExitStatus $? 13 | -------------------------------------------------------------------------------- /tests/p_strace/0-install_strace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | 4 | # Strace stack tracer package 5 | t_InstallPackage strace 6 | -------------------------------------------------------------------------------- /tests/p_strace/5-test_strace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | 4 | if [ "$CONTAINERTEST" -eq "1" ]; then 5 | t_Log "Running in container -> SKIP" 6 | exit 0 7 | fi 8 | 9 | t_Log "Running $0 - checking strace runs and returns non-zero exit status." 10 | 11 | STRACE=`which strace` 12 | 13 | [ "$STRACE" ] || { t_Log "Failed to find strace. Cannot continue."; exit $FAIL; } 14 | 15 | $STRACE ls &>/dev/null 16 | 17 | [ $? -eq 0 ] || { t_Log "Strace exited with non-zero status. That ain't good..."; exit $FAIL; } 18 | -------------------------------------------------------------------------------- /tests/p_subversion/0-install_subversion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Madhurranjan Mohaan 3 | 4 | t_Log "Running $0 - installing subversion" 5 | 6 | # Install subversion subversion 7 | t_InstallPackage subversion 8 | -------------------------------------------------------------------------------- /tests/p_subversion/10-test_subversion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Madhurranjan Mohaan 3 | 4 | # Check subversion installation 5 | 6 | t_Log "Running $0 - checking subversion installation" 7 | 8 | svn --version &>/dev/null 9 | t_CheckExitStatus $? 10 | -------------------------------------------------------------------------------- /tests/p_subversion/15-test_subversion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Madhurranjan Mohaan 4 | 5 | t_Log "Running $0 - testing a local subversion repository creation operation" 6 | 7 | temp_dir="/tmp/svnrepo" 8 | temp_repo="tmprepo" 9 | rm -rf $temp_dir/$temp_repo 10 | mkdir -p $temp_dir 11 | cd $temp_dir 12 | svnadmin create $temp_repo 13 | 14 | #verify repo using svnadmin 15 | if [ "svnadmin verify $temp_dir/$temp_repo | grep 'Verified revision 0'" ] 16 | then 17 | ret_val=0 18 | else 19 | ret_val=1 20 | fi 21 | t_CheckExitStatus $ret_val 22 | -------------------------------------------------------------------------------- /tests/p_syslog/syslog_logging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check if syslog deamon is working" 5 | 6 | logger "t_functional_logging_test" 7 | 8 | sleep 2 9 | 10 | if [ "$centos_ver" -ge 8 ]; then 11 | t_Log "Dumping journalctl to /var/log/maillog" 12 | journalctl >> /var/log/messages 13 | fi 14 | 15 | grep "t_functional_logging_test" /var/log/messages > /dev/null 2>&1 16 | 17 | t_CheckExitStatus $? 18 | 19 | -------------------------------------------------------------------------------- /tests/p_sysstat/00-install_sysstat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | 4 | # SysStat Performance Monitoring Tools for Linux 5 | t_InstallPackage sysstat 6 | 7 | if [ "$centos_ver" -lt 8 ] ; then 8 | t_InstallPackage psmisc 9 | fi 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/p_sysstat/20-pidstat-basic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Carlos Rodriguez-Fernandez 3 | 4 | t_Log "Running $0 - pidstat test" 5 | 6 | output_file=$(mktemp) 7 | trap "rm -f ${output_file}" EXIT 8 | 9 | if ! pidstat 1 1 > ${output_file} 2>&1; then 10 | cat ${output_file} 11 | exit 1 12 | fi 13 | -------------------------------------------------------------------------------- /tests/p_sysstat/25-sa-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Carlos Rodriguez-Fernandez 3 | 4 | t_Log "Running $0 - sa tests" 5 | 6 | tests_in_order=( 7 | "/usr/lib64/sa/sa1 --boot" 8 | "sar -u | grep -q -e 'LINUX RESTART'" 9 | "/usr/lib64/sa/sa1 1 1" 10 | "sleep 3 && /usr/lib64/sa/sa1 1 1 && sar -u | grep -q -e 'Average'" 11 | "/usr/lib64/sa/sa2 -A" 12 | ) 13 | 14 | output_file=$(mktemp) 15 | trap "rm -f ${output_file}" EXIT 16 | 17 | for cmd in "${tests_in_order[@]}"; do 18 | t_Log "Running $0 - sa test: ${cmd}" 19 | if ! eval "${cmd}" > ${output_file} 2>&1; then 20 | t_Log "FAIL: $0: sa test: ${cmd}" 21 | cat ${output_file} 22 | exit 1 23 | else 24 | t_Log "PASS: $0: sa test: ${cmd}" 25 | fi 26 | done 27 | -------------------------------------------------------------------------------- /tests/p_systemd/10-systemctl_list_services.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Rene Diepstraten 4 | 5 | t_Log "Running $0 - Checking if systemctl can check if a service is enabled" 6 | 7 | if [ "$CONTAINERTEST" -eq "1" ]; then 8 | t_Log "Running in container -> SKIP" 9 | exit 0 10 | fi 11 | 12 | [ ${centos_ver} -lt 7 ] && { t_Log "Systemd is part of el since el7, skipping systemd tests..." ; exit ; } 13 | 14 | # auditd is used as example because it's standard with minimal install 15 | 16 | systemctl is-enabled auditd.service > /dev/null 17 | 18 | t_CheckExitStatus $? -------------------------------------------------------------------------------- /tests/p_systemd/15-systemctl_list_non-native-services.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Rene Diepstraten 4 | 5 | if [ "$CONTAINERTEST" -eq "1" ]; then 6 | t_Log "Running in container -> SKIP" 7 | exit 0 8 | fi 9 | 10 | [ ${centos_ver} -lt 7 ] && exit 11 | t_Log "Running $0 - Checking if systemctl can check if a non-native service is enabled" 12 | 13 | systemctl is-enabled kdump.service 2> /dev/null | grep -q -E 'enabled|disabled' 14 | 15 | t_CheckExitStatus $? 16 | -------------------------------------------------------------------------------- /tests/p_systemd/20-systemctl_list-service-status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Rene Diepstraten 3 | 4 | [ ${centos_ver} -lt 7 ] && exit 5 | t_Log "Running $0 - checking if systemctl can check a service status" 6 | 7 | if [ "$CONTAINERTEST" -eq "1" ]; then 8 | t_Log "Running in container -> SKIP" 9 | exit 0 10 | fi 11 | 12 | systemctl is-active auditd.service > /dev/null 13 | 14 | t_CheckExitStatus $? -------------------------------------------------------------------------------- /tests/p_systemd/25-journalctl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Rene Diepstraten 3 | 4 | [ ${centos_ver} -lt 7 ] && exit 5 | t_Log "Running $0 - Testing journalctl for teststring" 6 | 7 | if [ "$CONTAINERTEST" -eq "1" ]; then 8 | t_Log "Running in container -> SKIP" 9 | exit 0 10 | fi 11 | 12 | teststring=098f6bcd4621d373cade4e832627b4f6 13 | timenow=$(date +'%T') 14 | echo ${teststring} > /dev/kmsg 15 | sleep 1 16 | journalctl --since ${timenow} | grep -q ${teststring} 17 | 18 | t_CheckExitStatus $? 19 | -------------------------------------------------------------------------------- /tests/p_tar/0_install_tar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - attempting to install tar." 5 | t_InstallPackage tar 6 | 7 | -------------------------------------------------------------------------------- /tests/p_tcl/0-install_tcl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Madhurranjan Mohaan 3 | 4 | t_Log "$0 - installing Tcl" 5 | t_InstallPackage tcl 6 | 7 | -------------------------------------------------------------------------------- /tests/p_tcl/10-test_tclsh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Madhurranjan Mohaan 4 | 5 | t_Log "Running $0 - Testing tclsh by running it with a basic file" 6 | 7 | echo 'puts "helloworld tclpackage"' > testfile 8 | tclsh testfile 9 | 10 | t_CheckExitStatus $? 11 | -------------------------------------------------------------------------------- /tests/p_tcpdump/00_install_tcpdump.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - install package tcpdump and psmisc" 5 | t_InstallPackage tcpdump psmisc 6 | 7 | -------------------------------------------------------------------------------- /tests/p_telnet/0-install_telnet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Madhurranjan Mohaan 3 | 4 | t_Log "Running $0 - installing telnet" 5 | 6 | # Install Telnet 7 | t_InstallPackage telnet 8 | -------------------------------------------------------------------------------- /tests/p_telnet/10-test_telnet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Madhurranjan Mohaan 4 | 5 | t_Log "Running $0 - testing telnet against ssh port" 6 | t_Log "Making sure port 22 is listening by calling ssh installer" 7 | 8 | t_InstallPackage openssh-server openssh-clients 9 | t_ServiceControl sshd start 10 | 11 | telnet_port_22=`telnet 127.0.0.1 22 << EOH 12 | EOH` 13 | echo $telnet_port_22 | grep "Escape character is '^]'" 14 | t_CheckExitStatus $? 15 | -------------------------------------------------------------------------------- /tests/p_tftp-server/0-install_tftp-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_InstallPackage tftp-server tftp 5 | if [ "$centos_ver" -le "8" ] ; then 6 | t_InstallPackage xinetd 7 | fi 8 | 9 | # Enable tftp 10 | if [ "$centos_ver" -ge "8" ] ; then 11 | cat <<__EOF__ >/etc/xinetd.d/tftp 12 | service tftp 13 | { 14 | socket_type = dgram 15 | protocol = udp 16 | wait = yes 17 | user = root 18 | server = /usr/sbin/in.tftpd 19 | server_args = -s /var/lib/tftpboot 20 | disable = no 21 | per_source = 11 22 | cps = 100 2 23 | flags = IPv4 24 | } 25 | __EOF__ 26 | else 27 | sed -i 's/\(disable\s*=\ \)yes/\1no/' /etc/xinetd.d/tftp 28 | fi 29 | 30 | if [ "$centos_ver" -le "8" ] ; then 31 | t_ServiceControl xinetd restart 32 | else 33 | service tftp start 34 | fi 35 | -------------------------------------------------------------------------------- /tests/p_tftp-server/10-tftp-server_get-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - tftp-server get file test." 5 | 6 | if [ "$centos_ver" -gt "5" ] ; then 7 | TFTP_DIR=/var/lib/tftpboot 8 | else 9 | TFTP_DIR=/tftpboot 10 | fi 11 | 12 | chmod 777 $TFTP_DIR 13 | echo "t_functional_test" > $TFTP_DIR/tftp_test 14 | tftp 127.0.0.1 -c get tftp_test 15 | 16 | cat tftp_test | grep -q 't_functional_test' 17 | ret_val=$? 18 | 19 | /bin/rm -f tftp_test 20 | 21 | t_CheckExitStatus $ret_val 22 | -------------------------------------------------------------------------------- /tests/p_tmpwatch/0-install_tmpwatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "$0 - Installing tmpwatch" 5 | t_InstallPackage tmpwatch 6 | 7 | -------------------------------------------------------------------------------- /tests/p_tmpwatch/tmpwatch_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - tmpwatch test." 5 | 6 | # create a junk file 7 | touch -t '200001010000' /tmp/tf_test 8 | 9 | tmpwatch 24 /tmp 10 | 11 | [ ! -f /tmp/tf_test ] 12 | 13 | t_CheckExitStatus $? 14 | -------------------------------------------------------------------------------- /tests/p_tomcat/0-install_tomcat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$centos_ver" -ge "8" ] ; then 5 | t_Log "Tomcat is not available in CentOS$centos_ver. SKIP" 6 | exit 0 7 | fi 8 | yum -y remove java\* 9 | 10 | if [ "$centos_ver" = "7" ] ;then 11 | tomcat_packages="tomcat tomcat-admin-webapps tomcat-webapps" 12 | elif [ "$centos_ver" = "6" ]; then 13 | tomcat_packages="tomcat6 tomcat6-admin-webapps tomcat6-webapps" 14 | else 15 | tomcat_packages="tomcat5 tomcat5-admin-webapps tomcat5-webapps" 16 | fi 17 | 18 | t_Log "$0 - installing Tomcat packages" 19 | t_InstallPackage ${tomcat_packages} 20 | -------------------------------------------------------------------------------- /tests/p_tomcat/tomcat_manager_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | if [ "$centos_ver" -ge "8" ] ; then 4 | exit 0 5 | fi 6 | #uname_arch=$(uname -m) 7 | #if [ "$uname_arch" == "i686" ] ; then 8 | #t_Log "Skipping $0 on $uname_arch" 9 | #exit 0 10 | #else 11 | t_Log "Running $0 - Tomcat Web Application Manager test." 12 | #fi 13 | curl -u admin:admin -s http://localhost:8080/manager/html | grep "Tomcat Web Application Manager" >/dev/null 2>&1 14 | 15 | t_CheckExitStatus $? 16 | -------------------------------------------------------------------------------- /tests/p_tomcat/tomcat_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | if [ "$centos_ver" -ge "8" ] ; then 5 | exit 0 6 | fi 7 | uname_arch=$(uname -m) 8 | #if [ "$uname_arch" == "i686" ] ; then 9 | #t_Log "Skipping $0 on $uname_arch" 10 | #exit 0 11 | #else 12 | t_Log "Running $0 - Tomcat basic test." 13 | #fi 14 | 15 | if [ "$centos_ver" = "7" ] ; then 16 | string_tosearch="you've successfully installed Tomcat. Congratulations!" 17 | else 18 | string_tosearch="you've setup Tomcat successfully. Congratulations!" 19 | fi 20 | 21 | curl -s http://localhost:8080/ | grep "${string_tosearch}" >/dev/null 2>&1 22 | 23 | t_CheckExitStatus $? 24 | -------------------------------------------------------------------------------- /tests/p_traceroute/0-install_traceroute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - installing package traceroute" 5 | t_InstallPackage traceroute 6 | 7 | -------------------------------------------------------------------------------- /tests/p_valac/0-install_valac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Lz 3 | 4 | if [ "$centos_ver" -ne "7" ];then 5 | t_Log "Package not included in CentOS $centos_ver => SKIP" 6 | exit 0 7 | fi 8 | 9 | t_Log "$0 - installing valac" 10 | t_InstallPackage vala 11 | 12 | -------------------------------------------------------------------------------- /tests/p_valac/10-test_valac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Lz 4 | 5 | if [ "$centos_ver" -ne "7" ];then 6 | t_Log "Package not included in CentOS $centos_ver => SKIP" 7 | exit 0 8 | fi 9 | 10 | t_Log "Running $0 - Testing valac by running it with a basic file" 11 | 12 | # creating source code 13 | FILE='/var/tmp/valac-test.vala' 14 | EXE='/var/tmp/valac-test' 15 | 16 | cat > $FILE < 3 | 4 | if [ $centos_ver -lt 7 ] 5 | then 6 | # Install vconfig 7 | t_InstallPackage vconfig 8 | else 9 | t_Log 'vconfig is only supported on C5 and C6, skipping' 10 | fi 11 | -------------------------------------------------------------------------------- /tests/p_vsftpd/0-install_vsftpd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - installing vsFTPd." 5 | t_InstallPackage vsftpd 6 | if [ "$centos_ver" -ge 8 ] ; then 7 | cp -fp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.tf_p_vsftpd 8 | sed -i 's/anonymous_enable=NO/anonymous_enable=YES/g' /etc/vsftpd/vsftpd.conf 9 | fi 10 | t_ServiceControl vsftpd restart 11 | if [ "$centos_ver" -ge 8 ] ; then 12 | mv -f /etc/vsftpd/vsftpd.conf.tf_p_vsftpd /etc/vsftpd/vsftpd.conf 13 | fi 14 | -------------------------------------------------------------------------------- /tests/p_vsftpd/vsftpd_anonymous_login.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - vsFTPd anonymous can login test." 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_Log "Running in container -> SKIP" 8 | exit 0 9 | fi 10 | 11 | echo -e "user anonymous\npass password\nquit" | nc localhost 21 | grep -q "230 Login successful." 12 | 13 | t_CheckExitStatus $? 14 | -------------------------------------------------------------------------------- /tests/p_vsftpd/vsftpd_localusers_login.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - vsFTPd local user can login test." 5 | 6 | if [ "$CONTAINERTEST" -eq "1" ]; then 7 | t_Log "Running in container -> SKIP" 8 | exit 0 9 | fi 10 | 11 | # Add a test ftp user 12 | { userdel -rf ftptest; useradd ftptest && echo ftptest | passwd --stdin ftptest; } &>/dev/null 13 | 14 | # Fix SELinux boolean 15 | setsebool ftp_home_dir 1 16 | 17 | echo -e "user ftptest\npass ftptest\nquit" | nc localhost 21 | grep -q "230 Login successful." 18 | 19 | t_CheckExitStatus $? 20 | 21 | userdel -rf ftptest 22 | -------------------------------------------------------------------------------- /tests/p_webalizer/0-install_webalizer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - attempting to install webalizer" 5 | 6 | if [ "$centos_ver" -ge 7 ] ; then 7 | t_Log "No webalizer package for CentOS $centos_ver -> SKIP" 8 | t_CheckExitStatus 0 9 | exit 0 10 | fi 11 | 12 | t_InstallPackage webalizer 13 | t_InstallPackage httpd 14 | t_ServiceControl httpd stop 15 | ps ax | grep -v grep | grep -q httpd 16 | if [ $? = 0 ] 17 | then 18 | t_Log "httpd still running - killing" 19 | killall -9 httpd 20 | fi 21 | sleep 1 22 | t_ServiceControl httpd start 23 | 24 | -------------------------------------------------------------------------------- /tests/p_webalizer/webalizer_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - Webalizer test." 5 | 6 | if [ "$centos_ver" -ge 7 ] ; then 7 | t_Log "No webalizer package for CentOS $centos_ver -> SKIP" 8 | t_CheckExitStatus 0 9 | exit 0 10 | fi 11 | 12 | # Run some requests 13 | for i in `seq 10` 14 | do 15 | curl http://localhost/ > /dev/null 2>&1 16 | done 17 | 18 | # Trigger webalizer cron manualy 19 | /etc/cron.daily/00webalizer 20 | 21 | # Run the test 22 | curl -s http://localhost/usage/ | grep 'Usage Statistics for' > /dev/null 2>&1 23 | 24 | t_CheckExitStatus $? 25 | -------------------------------------------------------------------------------- /tests/p_wget/0-install_wget.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "$0 - installing wget" 6 | t_InstallPackage wget 7 | -------------------------------------------------------------------------------- /tests/p_wget/wget_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - wget can access http-host and download index.html." 6 | FILE=/var/tmp/index.html 7 | 8 | 9 | if [ $SKIP_QA_HARNESS -eq 1 ]; then 10 | CHECK_FOR="timestamp" 11 | URL="http://mirror.centos.org/" 12 | else 13 | CHECK_FOR="CentOS" 14 | URL="http://repo.centos.qa/srv/CentOS/" 15 | fi 16 | 17 | t_Log "Querying ${URL}" 18 | wget -q --output-document=${FILE} ${URL} 19 | grep -q "${CHECK_FOR}" ${FILE} 20 | ret_val=$? 21 | 22 | /bin/rm ${FILE} 23 | t_CheckExitStatus $ret_val 24 | -------------------------------------------------------------------------------- /tests/p_which/0-install_which.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "$0 - installing which" 5 | t_InstallPackage which 6 | -------------------------------------------------------------------------------- /tests/p_which/which_basic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "Running $0 - Checking which can find itself" 5 | /usr/bin/which which | grep -E -q '^(/usr)?/bin/which$' 6 | t_CheckExitStatus $? 7 | -------------------------------------------------------------------------------- /tests/p_which/which_fail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Alice Kaerast 3 | 4 | t_Log "Running $0 - Checking which can fails on non-existing commands" 5 | which abc123 2> /dev/null 6 | [ $? -eq 1 ] || { t_Log "Which should have exited with 1 for a non-existing file"; exit $FAIL; } 7 | t_CheckExitStatus $? 8 | -------------------------------------------------------------------------------- /tests/p_xorg-x11-server/00_install-Xorg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - installing Xorg (base package)" 5 | t_InstallPackage xorg-x11-server-Xorg 6 | 7 | -------------------------------------------------------------------------------- /tests/p_xorg-x11-server/01_Xorg-centos-branding-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Athmane Madjoudj 3 | 4 | # Ref: http://bugs.centos.org/view.php?id=6809 5 | t_Log "Running $0 - Testing that Xorg has been patched to use CentOS bugtracker for support" 6 | 7 | if [ $centos_ver = 6 ] 8 | then 9 | X --wrong-arg 2>&1 | grep -q 'wiki.centos.org' 10 | else 11 | t_Log "CentOS 5 Xorg does not need checking" 12 | fi 13 | 14 | 15 | t_CheckExitStatus $? 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/p_yum-plugin-fastestmirror/0_install_yum-plugin-fastestmirror.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | t_Log "Running $0 - package should already be installed" 4 | 5 | if [ "$centos_ver" -ge "8" ] ; then 6 | t_Log "yum is replaced by dnf on el8. SKIP" 7 | exit 0 8 | fi 9 | rpm -qa | egrep -q 'yum-.*fastestmirror' 10 | t_CheckExitStatus $? 11 | 12 | t_Log "Running $0 - yum should have a hard Requires on yum-plugin-fastestmirror" 13 | rpm -q --requires yum | egrep -q 'yum-.*fastestmirror' 14 | t_CheckExitStatus $? 15 | -------------------------------------------------------------------------------- /tests/p_yum/yum_bugtracker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - Yum is using CentOS' bugtracker test." 5 | 6 | if [ "$centos_ver" -ge "8" ] ; then 7 | t_Log "CentOS$ver, SKIP" 8 | exit 0 9 | fi 10 | grep "http://bugs.centos.org" /etc/yum.conf >/dev/null 2>&1 11 | 12 | t_CheckExitStatus $? 13 | -------------------------------------------------------------------------------- /tests/p_yum/yum_distroverpkg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | t_Log "Running $0 - Yum configuration has the correct distroverpkg value test." 4 | 5 | if [ "$centos_ver" -ge "8" ] ; then 6 | t_Log "CentOS$ver, SKIP" 7 | exit 0 8 | fi 9 | #add centos-userland-release for armhfp 10 | uname_arch=$(uname -m) 11 | if [ "$uname_arch" == "armv7l" ]; then 12 | rel_string="centos-userland-release" 13 | else 14 | rel_string="centos-release" 15 | fi 16 | 17 | ProvierTag=$(grep distroverpkg /etc/yum.conf | cut -f2 -d'=') 18 | rpm -q --whatprovides ${ProvierTag} | grep "$rel_string" > /dev/null 19 | t_CheckExitStatus $? 20 | -------------------------------------------------------------------------------- /tests/p_yum/yum_remove_pkg_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - yum remove package test." 5 | 6 | # Install zsh pkg 7 | t_InstallPackage zsh 8 | 9 | yum -d0 -y remove zsh && \ 10 | rpm -q zsh | grep -q 'package zsh is not installed' 11 | 12 | t_CheckExitStatus $? 13 | -------------------------------------------------------------------------------- /tests/p_zip/0_install_zip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - attempting to install zip." 5 | t_InstallPackage zip unzip 6 | 7 | -------------------------------------------------------------------------------- /tests/r_check_mod_packages/c72-mod-packages.lst.aarch64: -------------------------------------------------------------------------------- 1 | PackageKit 2 | abrt 3 | apache-commons-net 4 | basesystem 5 | centos-indexhtml 6 | centos-logos 7 | centos-release 8 | dhcp 9 | firefox 10 | grub2 11 | httpd 12 | ipa-client 13 | kabi-yum-plugins 14 | kde-settings 15 | libreport 16 | ntp 17 | pcs 18 | scap-security-guide 19 | sos 20 | subscription-manager 21 | system-config-date 22 | system-config-kdump 23 | thunderbird 24 | xulrunner 25 | yum 26 | -------------------------------------------------------------------------------- /tests/r_check_mod_packages/c72-mod-packages.lst.armv7l: -------------------------------------------------------------------------------- 1 | PackageKit 2 | abrt 3 | apache-commons-net 4 | anaconda 5 | basesystem 6 | centos-indexhtml 7 | centos-logos 8 | centos-userland-release 9 | #compat-glibc (not available in armhfp) 10 | dhcp 11 | firefox 12 | #grub2 (not available yet in armhfp) 13 | httpd 14 | initial-setup 15 | ipa-client 16 | #kabi-yum-plugins (not available in armhfp) 17 | kde-settings 18 | libreport 19 | ntp 20 | #openssl098e (not available in armhfp) 21 | pcs 22 | plymouth 23 | redhat-rpm-config 24 | redhat-lsb 25 | scap-security-guide 26 | sos 27 | subscription-manager 28 | system-config-date 29 | system-config-kdump 30 | thunderbird 31 | #xulrunner (currently has the wrong disttag, will be fixed on the next update) 32 | yum 33 | -------------------------------------------------------------------------------- /tests/r_check_mod_packages/c72-mod-packages.lst.ppc64: -------------------------------------------------------------------------------- 1 | PackageKit 2 | abrt 3 | apache-commons-net 4 | anaconda 5 | basesystem 6 | centos-indexhtml 7 | centos-logos 8 | centos-release 9 | compat-glibc 10 | dhcp 11 | firefox 12 | grub2 13 | httpd 14 | initial-setup 15 | ipa-client 16 | kabi-yum-plugins 17 | kde-settings 18 | libreport 19 | ntp 20 | openssl098e 21 | plymouth 22 | redhat-rpm-config 23 | redhat-lsb 24 | scap-security-guide 25 | sos 26 | subscription-manager 27 | system-config-date 28 | system-config-kdump 29 | xulrunner 30 | yum 31 | -------------------------------------------------------------------------------- /tests/r_check_mod_packages/c72-mod-packages.lst.ppc64le: -------------------------------------------------------------------------------- 1 | PackageKit 2 | abrt 3 | apache-commons-net 4 | anaconda 5 | basesystem 6 | centos-indexhtml 7 | centos-logos 8 | centos-release 9 | dhcp 10 | firefox 11 | grub2 12 | httpd 13 | initial-setup 14 | ipa-client 15 | kabi-yum-plugins 16 | kde-settings 17 | libreport 18 | ntp 19 | pcs 20 | plymouth 21 | redhat-rpm-config 22 | redhat-lsb 23 | scap-security-guide 24 | sos 25 | subscription-manager 26 | system-config-date 27 | system-config-kdump 28 | thunderbird 29 | xulrunner 30 | yum 31 | -------------------------------------------------------------------------------- /tests/r_check_mod_packages/c72-mod-packages.lst.x86_64: -------------------------------------------------------------------------------- 1 | PackageKit 2 | abrt 3 | apache-commons-net 4 | anaconda 5 | basesystem 6 | centos-indexhtml 7 | centos-logos 8 | centos-release 9 | compat-glibc 10 | dhcp 11 | firefox 12 | grub2 13 | httpd 14 | initial-setup 15 | ipa-client 16 | kabi-yum-plugins 17 | kde-settings 18 | libreport 19 | ntp 20 | openssl098e 21 | pcs 22 | plymouth 23 | redhat-rpm-config 24 | redhat-lsb 25 | scap-security-guide 26 | sos 27 | subscription-manager 28 | system-config-date 29 | system-config-kdump 30 | thunderbird 31 | xulrunner 32 | yum 33 | -------------------------------------------------------------------------------- /tests/r_lamp/0_lamp_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Steve Barnes (steve@echo.id.au) 3 | # Christoph Galuschka 4 | 5 | t_Log "Running $0 - attempting to install LAMP stack." 6 | 7 | # MySQL 8 | # starting with 5.10, we have to differ between mysql55 and mysql 9 | if [ $centos_ver = 5 ] 10 | then 11 | t_InstallPackage mysql-server mysql55-mysql-server httpd php 12 | elif [ $centos_ver -ge 8 ] 13 | then 14 | t_InstallPackage mariadb-server httpd php php-cli 15 | else 16 | t_InstallPackage mysql-server httpd php 17 | fi 18 | 19 | t_ServiceControl httpd stop 20 | ps ax | grep -v grep | grep -q httpd 21 | if [ $? = 0 ] 22 | then 23 | t_Log "httpd still running - killing" 24 | killall -9 httpd 25 | fi 26 | sleep 1 27 | t_ServiceControl httpd start 28 | -------------------------------------------------------------------------------- /tests/r_lamp/package_deps: -------------------------------------------------------------------------------- 1 | # list of package names that this role def depends on 2 | # the tests here will only be triggered if one of these packages is built 3 | php 4 | mysql 5 | httpd 6 | -------------------------------------------------------------------------------- /tests/r_pdf/00_install_requirements.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - install package enscript, ghostscript and pdftotext" 5 | 6 | # Workarround for post scriptlet non-fatal errors 7 | yum -y remove bitstream-vera* liberation* 8 | # 9 | t_InstallPackage fontconfig @fonts 10 | t_InstallPackage enscript ghostscript poppler-utils 11 | 12 | -------------------------------------------------------------------------------- /tests/r_pdf/01_pdf-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Christoph Galuschka 3 | 4 | t_Log "Running $0 - Create PDF from postscript from text, and convert PDF back to text and check contents" 5 | 6 | if [ "$centos_ver" = "5" ] ;then 7 | FILE=/etc/redhat-release 8 | else 9 | FILE=/etc/centos-release 10 | fi 11 | FIND='CentOS' 12 | PS_FILE=/var/tmp/test.ps 13 | PDF_FILE=/var/tmp/test.pdf 14 | TEST_FILE=/var/tmp/result 15 | 16 | # generate postscript file 17 | enscript -q -p $PS_FILE $FILE 18 | 19 | # check-file 20 | t_Log 'Check created PS-File' 21 | grep -q $FIND $PS_FILE 22 | t_CheckExitStatus $? 23 | 24 | # convert to PDF 25 | ps2pdf $PS_FILE $PDF_FILE 26 | 27 | # read file and check 28 | pdftotext -q $PDF_FILE $TEST_FILE 29 | t_Log 'Check Textfile after conversion' 30 | grep -q $FIND $TEST_FILE 31 | t_CheckExitStatus $? 32 | 33 | #clean up 34 | rm -rf $PDF_FILE $TEST_FILE $PS_FILE 35 | -------------------------------------------------------------------------------- /tests/r_raid-0/package_deps: -------------------------------------------------------------------------------- 1 | kernel 2 | mdadm 3 | -------------------------------------------------------------------------------- /tests/z_cr_test/readme: -------------------------------------------------------------------------------- 1 | This test is disabled by default, but can be launched from the CDevQA provision script 2 | when we need to test the packages from the CR repository 3 | It will fetch packages names from the cr repo, install those packages from base+updates 4 | and then will try the update process. 5 | After that, all the usual functional tests will be launched 6 | -------------------------------------------------------------------------------- /tests/z_install-tree/install-tree_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - check if the packages tree is installable." 5 | 6 | yum --skip-broken -y install \* > /tmp/yum_install_tree.log 2>&1 7 | ret_val=$? 8 | # print the output of yum when it fails 9 | [ $ret_val -ne 0 ] && tail /tmp/yum_install_tree.log 10 | 11 | t_CheckExitStatus $ret_val 12 | -------------------------------------------------------------------------------- /tests/z_install-tree/readme: -------------------------------------------------------------------------------- 1 | This test was disabled because of disk space limitation 2 | chmod 755 to reenable 3 | -------------------------------------------------------------------------------- /tests/z_repoclosure/repoclosure_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Athmane Madjoudj 3 | 4 | t_Log "Running $0 - repoclosure test ." 5 | 6 | if [ "$centos_ver" -ge 8 ] ; then 7 | t_Log "Skip this test in versions greater than 8, because repoclosure doesn't work with modules enabled" 8 | else 9 | 10 | t_InstallPackage yum-utils 11 | 12 | t_Log "Running repoclosure test ..." 13 | 14 | repoclosure > /tmp/repoclosure.log 2>&1 15 | grep -q 'unresolved deps' /tmp/repoclosure.log 16 | if [ $? -eq 0 ] ; then 17 | ret_val=1 18 | else 19 | ret_val=0 20 | fi 21 | 22 | # print the output of repoclosure when it fails 23 | [ $ret_val -eq 1 ] && cat /tmp/repoclosure.log 24 | 25 | t_CheckExitStatus $ret_val 26 | fi 27 | -------------------------------------------------------------------------------- /tests/z_rpminfo/README: -------------------------------------------------------------------------------- 1 | Adding an rpminfo check override for a package can be done in 2 ways: 2 | - Modifying required_attrs in check-rpminfo.py 3 | - should be done for packages specified by name (i.e. overrides for _all_ versions of that package) 4 | - Adding an NVR line in special_overrides.txt 5 | - should be done for specific NVRs 6 | - in the form: --: 7 | 8 | Adding an attribute to check: 9 | - modify the required_attrs dict in check-rpminfo.py 10 | - the key is the name of the attribute to check 11 | - the value is a shell-style glob of what the attribute should be 12 | -------------------------------------------------------------------------------- /tests/z_rpminfo/check-rpminfo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: Brian Stinson 3 | # Runner script for checking rpminfo so we can fail gracefully on EL5 4 | 5 | if [ "$centos_ver" -ge "8" ]; then 6 | t_Log "check-rpminfo.py not python3/dnf ready on c8 => SKIP" 7 | exit 0 8 | fi 9 | 10 | if [[ $centos_ver != 5 ]] 11 | then 12 | python "$(dirname "$(readlink -f "$0")")/check-rpminfo.py" 13 | t_CheckExitStatus $? 14 | else 15 | echo "Skipped on CentOS 5" 16 | fi 17 | -------------------------------------------------------------------------------- /utils/README: -------------------------------------------------------------------------------- 1 | the utils dir contains helper scripts and metadata not actually used by the tests themselves. 2 | 3 | this includes scripts needed by the CI infrastructure etc 4 | -------------------------------------------------------------------------------- /utils/package-install-list.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # author: Christoph Galuschka 4 | # This script will create a file with all packages which get installed by the tests 5 | 6 | grep t_InstallPackage ../*/*/* | grep -v export | grep -v functions | egrep -v '.*\$.*' |\ 7 | cut -d ':' -f 2 | sed 's/^ *//g' | tr -s ' ' | sed 's/t_InstallPackage/yum\ install\ \-y\ \-d0/g' > /var/tmp/t_functional_packagelist 8 | 9 | # running the resulting file with '/bin/bash /var/tmp/t_functional_packagelist' will install all packages required by the current tests. 10 | --------------------------------------------------------------------------------