1 2 3 4 5 6 7 8 9 10 11 12 13 14 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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
# Testing targets.
#
# Oracle Linux DTrace.
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
# Core testing targets, running the DTrace testsuite runner runtest.sh.
# -verbose in a target name means to report even tests that pass and
# those that are expected to fail;
# -installed in a target name means to test an installed /usr/sbin/dtrace
# rather than a copy in the build tree;
# -stress in a target name means to skip tests that may fail inappropriately
# when the system is under load.
# -internal in a target name means that this is an internal implementation
# detail and should not be run directly.
# Specialist targets for QA, check-qa-*, all of which run against the installed
# DTrace:
# check-qa-smoke: Runs the smoke testsuite.
ifndef always-installed
git_version=.git-version
RUNTEST=./runtest.sh
RUNTESTFLAGS=
installed_internals=
else
git_version=
RUNTEST=$(TESTDIR)/runtest.sh
RUNTESTFLAGS=--use-installed
DTRACE=/usr/sbin/dtrace
installed_internals=internals,
endif
help::
@printf "Checking targets (as root):\n\n" >&2
@printf "check Test the built DTrace.\n" >&2
@printf "check-verbose Report successes too.\n" >&2
@printf "check-installed Check the installed DTrace.\n" >&2
@printf "check-installed-verbose Report successes too.\n" >&2
@printf "check-stress Run testsuites while the system is under stress.\n" >&2
@printf "check-verbose-stress Report successes too.\n" >&2
@printf "check-installed-stress Check the installed DTrace.\n" >&2
@printf "check-installed-verbose-stress Report successes too.\n" >&2
@printf "check-quick Run tests that take only a short time.\n" >&2
@printf "check-verbose-quick Report successes too.\n" >&2
@printf "check-installed-quick Quickly check the installed DTrace.\n" >&2
@printf "check-installed-verbose-quick Report successes too.\n" >&2
@printf "check-module-loading Check that all modules load.\n" >&2
@printf "check-installed-module-loading Check that all modules load, using\n">&2
@printf " the installed DTrace for autoinstallation.\n" >&2
@printf "check-probe-all-syscalls Probe all syscalls, forever.\n" >&2
@printf "check-qa-smoke Smoke-test the installed DTrace.\n" >&2
@printf "\n" >&2
check: check-verbose
check: RUNTESTFLAGS+=--quiet
check-verbose: all $(git_version)
$(RUNTEST) $(RUNTESTFLAGS)
check-installed check-installed-stress check-installed-quick check-installed-verbose check-installed-verbose-stress check-installed-verbose-quick:
$(MAKE) _DTRACE_CHECK_INSTALLED=t DTRACE=/usr/sbin/dtrace $@-internal
check-installed-internal: check-installed-verbose-internal
check-installed-internal: RUNTESTFLAGS+=--quiet
check-installed-verbose-internal: external-triggers $(git_version)
$(RUNTEST) --use-installed --testsuites=unittest,$(installed_internals)stress,demo,smoke $(RUNTESTFLAGS)
check-stress: check
check-stress: RUNTESTFLAGS+=--testsuites=unittest,internals,demo,smoke --no-comparison
check-verbose-stress: check-verbose
check-verbose-stress: RUNTESTFLAGS+=--testsuites=unittest,internals,demo,smoke --no-comparison
check-quick: check
check-quick: RUNTESTFLAGS+=--skip-longer
check-verbose-quick: check-verbose
check-verbose-quick: RUNTESTFLAGS+=--skip-longer
check-installed-stress-internal: check-installed-internal
check-installed-stress-internal: RUNTESTFLAGS+=--testsuites=unittest,$(installed_internals)demo,smoke --no-comparison
check-installed-verbose-stress-internal: check-installed-verbose-internal
check-installed-verbose-stress-internal: RUNTESTFLAGS+=--testsuites=unittest,$(installed_internals)demo,smoke --no-comparison
check-installed-quick-internal: check-installed-internal
check-installed-quick-internal: RUNTESTFLAGS+=--skip-longer
check-installed-verbose-quick-internal: check-installed-verbose-internal
check-installed-verbose-quick-internal: RUNTESTFLAGS+=--skip-longer
# QA targets.
check-qa-smoke:
$(MAKE) _DTRACE_CHECK_INSTALLED=t DTRACE=/usr/sbin/dtrace $@-internal
check-qa-smoke-internal: $(git_version)
$(RUNTEST) $(RUNTESTFLAGS) --use-installed --testsuites=smoke --quiet
# Load the DTrace modules (installing them if necessary), and do nothing else.
# Useful for testing the impact of inactive DTrace.
check-module-loading:
@if [[ "x$$(id -u)" = "x0" ]]; then \
$(RUNTEST) $(RUNTESTFLAGS) --load-modules-only; \
else \
echo "Error: cannot load modules as non-root." >&2; \
false; \
fi
check-installed-module-loading:
@if [[ "x$$(id -u)" = "x0" ]]; then \
$(RUNTEST) $(RUNTESTFLAGS) --use-installed --load-modules-only; \
else \
echo "Error: cannot load modules as non-root." >&2; \
false; \
fi
# Trace all syscalls, forever, and throw the results away.
# The modules are loaded during this process but are not unloaded afterwards.
check-probe-all-syscalls: all check-module-loading check-probe-all-syscalls-internal
ifndef always-installed
check-probe-all-syscalls: DTRACE=$(objdir)/dtrace
check-probe-all-syscalls: export DTRACE_OPT_SYSLIBDIR=$(objdir)/dtrace/dlibs
check-probe-all-syscalls: export LD_LIBRARY_PATH=$(objdir)
endif
# Likewise, using /usr/sbin/dtrace rather than a copy in the build tree.
check-installed-probe-all-syscalls: check-installed-module-loading check-probe-all-syscalls-internal
check-installed-probe-all-syscalls: export DTRACE=/usr/sbin/dtrace
check-probe-all-syscalls-internal:
$(DTRACE) -qm 'syscall: {}'
@true
PHONIES += check check-verbose check-installed check-installed-verbose
PHONIES += check-stress check-verbose-stress check-installed-stress
PHONIES += check-installed-verbose-stress check-quick check-verbose-quick
PHONIES += check-verbose-quick check-installed-quick check-installed-verbose-quick
PHONIES += check-module-loading check-installed-module-loading
PHONIES += check-probe-all-syscalls check-installed-probe-all-syscalls
PHONIES += check-probe-all-syscalls-internal
PHONIES += check-installed-internal check-installed-stress-internal
PHONIES += check-installed-verbose-internal
PHONIES += check-installed-verbose-stress-internal
|