mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-28 07:37:32 +00:00
Skip plugins list/load/tests for MUSL_OPTIMIZED_BUILD
When MUSL_OPTIMIZED_BUILD is specified, falco is statically linked under musl, and can't dlopen() files: see https://inbox.vuxu.org/musl/20200423162406.GV11469@brightrain.aerifal.cx/T/ So skip listing/loading/testing plugins when MUSL_OPTIMIZED_BUILD is specified. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
parent
9f53089bcb
commit
cb51522423
@ -292,6 +292,7 @@ jobs:
|
|||||||
BUILD_DIR: "/build-static"
|
BUILD_DIR: "/build-static"
|
||||||
BUILD_TYPE: "release"
|
BUILD_TYPE: "release"
|
||||||
SKIP_PACKAGES_TESTS: "true"
|
SKIP_PACKAGES_TESTS: "true"
|
||||||
|
SKIP_PLUGINS_TESTS: "true"
|
||||||
steps:
|
steps:
|
||||||
- setup_remote_docker
|
- setup_remote_docker
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
|
@ -20,6 +20,7 @@ set -euo pipefail
|
|||||||
SCRIPT=$(readlink -f $0)
|
SCRIPT=$(readlink -f $0)
|
||||||
SCRIPTDIR=$(dirname "$SCRIPT")
|
SCRIPTDIR=$(dirname "$SCRIPT")
|
||||||
SKIP_PACKAGES_TESTS=${SKIP_PACKAGES_TESTS:-false}
|
SKIP_PACKAGES_TESTS=${SKIP_PACKAGES_TESTS:-false}
|
||||||
|
SKIP_PLUGINS_TESTS=${SKIP_PLUGINS_TESTS:-false}
|
||||||
TRACE_FILES_BASE_URL=${TRACE_FILES_BASE_URL:-"https://download.falco.org/fixtures/trace-files/"}
|
TRACE_FILES_BASE_URL=${TRACE_FILES_BASE_URL:-"https://download.falco.org/fixtures/trace-files/"}
|
||||||
|
|
||||||
# Trace file tarballs are now versioned. Any time a substantial change
|
# Trace file tarballs are now versioned. Any time a substantial change
|
||||||
@ -99,12 +100,16 @@ function run_tests() {
|
|||||||
# as we're watching the return status when running avocado.
|
# as we're watching the return status when running avocado.
|
||||||
set +e
|
set +e
|
||||||
TEST_RC=0
|
TEST_RC=0
|
||||||
suites=($SCRIPTDIR/falco_traces.yaml $SCRIPTDIR/falco_tests.yaml $SCRIPTDIR/falco_k8s_audit_tests.yaml $SCRIPTDIR/falco_tests_psp.yaml $SCRIPTDIR/falco_tests_exceptions.yaml $SCRIPTDIR/falco_tests_plugins.yaml)
|
suites=($SCRIPTDIR/falco_traces.yaml $SCRIPTDIR/falco_tests.yaml $SCRIPTDIR/falco_k8s_audit_tests.yaml $SCRIPTDIR/falco_tests_psp.yaml $SCRIPTDIR/falco_tests_exceptions.yaml)
|
||||||
|
|
||||||
if [ "$SKIP_PACKAGES_TESTS" = false ] ; then
|
if [ "$SKIP_PACKAGES_TESTS" = false ] ; then
|
||||||
suites+=($SCRIPTDIR/falco_tests_package.yaml)
|
suites+=($SCRIPTDIR/falco_tests_package.yaml)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$SKIP_PLUGINS_TESTS" = false ] ; then
|
||||||
|
suites+=($SCRIPTDIR/falco_tests_plugins.yaml)
|
||||||
|
fi
|
||||||
|
|
||||||
XUNIT_DIR="${OPT_BUILD_DIR}/integration-tests-xunit"
|
XUNIT_DIR="${OPT_BUILD_DIR}/integration-tests-xunit"
|
||||||
mkdir -p "${XUNIT_DIR}"
|
mkdir -p "${XUNIT_DIR}"
|
||||||
|
|
||||||
|
@ -137,8 +137,8 @@ static void usage()
|
|||||||
" -l <rule> Show the name and description of the rule with name <rule> and exit.\n"
|
" -l <rule> Show the name and description of the rule with name <rule> and exit.\n"
|
||||||
" --list [<source>] List all defined fields. If <source> is provided, only list those fields for\n"
|
" --list [<source>] List all defined fields. If <source> is provided, only list those fields for\n"
|
||||||
" the source <source>. Current values for <source> are \"syscall\", \"k8s_audit\"\n"
|
" the source <source>. Current values for <source> are \"syscall\", \"k8s_audit\"\n"
|
||||||
|
#ifndef MUSL_OPTIMIZED_BUILD
|
||||||
" --list-plugins Print info on all loaded plugins and exit.\n"
|
" --list-plugins Print info on all loaded plugins and exit.\n"
|
||||||
#ifndef MINIMAL_BUILD
|
|
||||||
" -m <url[,marathon_url]>, --mesos-api <url[,marathon_url]>\n"
|
" -m <url[,marathon_url]>, --mesos-api <url[,marathon_url]>\n"
|
||||||
" Enable Mesos support by connecting to the API server\n"
|
" Enable Mesos support by connecting to the API server\n"
|
||||||
" specified as argument. E.g. \"http://admin:password@127.0.0.1:5050\".\n"
|
" specified as argument. E.g. \"http://admin:password@127.0.0.1:5050\".\n"
|
||||||
@ -556,7 +556,9 @@ int falco_init(int argc, char **argv)
|
|||||||
{"k8s-api", required_argument, 0, 'k'},
|
{"k8s-api", required_argument, 0, 'k'},
|
||||||
{"k8s-node", required_argument, 0},
|
{"k8s-node", required_argument, 0},
|
||||||
{"list", optional_argument, 0},
|
{"list", optional_argument, 0},
|
||||||
|
#ifndef MUSL_OPTIMIZED_BUILD
|
||||||
{"list-plugins", no_argument, 0},
|
{"list-plugins", no_argument, 0},
|
||||||
|
#endif
|
||||||
{"mesos-api", required_argument, 0, 'm'},
|
{"mesos-api", required_argument, 0, 'm'},
|
||||||
{"option", required_argument, 0, 'o'},
|
{"option", required_argument, 0, 'o'},
|
||||||
{"pidfile", required_argument, 0, 'P'},
|
{"pidfile", required_argument, 0, 'P'},
|
||||||
@ -749,10 +751,12 @@ int falco_init(int argc, char **argv)
|
|||||||
list_flds_source = optarg;
|
list_flds_source = optarg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifndef MUSL_OPTIMIZED_BUILD
|
||||||
else if (string(long_options[long_index].name) == "list-plugins")
|
else if (string(long_options[long_index].name) == "list-plugins")
|
||||||
{
|
{
|
||||||
list_plugins = true;
|
list_plugins = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (string(long_options[long_index].name) == "stats-interval")
|
else if (string(long_options[long_index].name) == "stats-interval")
|
||||||
{
|
{
|
||||||
stats_interval = atoi(optarg);
|
stats_interval = atoi(optarg);
|
||||||
@ -942,12 +946,17 @@ int falco_init(int argc, char **argv)
|
|||||||
std::list<std::shared_ptr<sinsp_plugin>> extractor_plugins;
|
std::list<std::shared_ptr<sinsp_plugin>> extractor_plugins;
|
||||||
for(auto &p : config.m_plugins)
|
for(auto &p : config.m_plugins)
|
||||||
{
|
{
|
||||||
|
std::shared_ptr<sinsp_plugin> plugin;
|
||||||
|
#ifdef MUSL_OPTIMIZED_BUILD
|
||||||
|
throw std::invalid_argument(string("Can not load/use plugins with musl optimized build"));
|
||||||
|
#else
|
||||||
falco_logger::log(LOG_INFO, "Loading plugin (" + p.m_name + ") from file " + p.m_library_path + "\n");
|
falco_logger::log(LOG_INFO, "Loading plugin (" + p.m_name + ") from file " + p.m_library_path + "\n");
|
||||||
|
|
||||||
std::shared_ptr<sinsp_plugin> plugin = sinsp_plugin::register_plugin(inspector,
|
plugin = sinsp_plugin::register_plugin(inspector,
|
||||||
p.m_library_path,
|
p.m_library_path,
|
||||||
(p.m_init_config.empty() ? NULL : (char *)p.m_init_config.c_str()),
|
(p.m_init_config.empty() ? NULL : (char *)p.m_init_config.c_str()),
|
||||||
plugin_filter_checks);
|
plugin_filter_checks);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(plugin->type() == TYPE_SOURCE_PLUGIN)
|
if(plugin->type() == TYPE_SOURCE_PLUGIN)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user