diff --git a/testing/btest/Baseline/plugins.bifs-and-scripts-install-delete-source/output b/testing/btest/Baseline/plugins.bifs-and-scripts-install-delete-source/output new file mode 100644 index 0000000000..f8a6f55807 --- /dev/null +++ b/testing/btest/Baseline/plugins.bifs-and-scripts-install-delete-source/output @@ -0,0 +1,11 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +Demo::Foo - (dynamic, version 0.1.0) + [Function] hello_plugin_world + [Event] plugin_event + +=== +plugin: automatically loaded at startup +=== +plugin: automatically loaded at startup +plugin: manually loaded +calling bif, Hello from the plugin! diff --git a/testing/btest/plugins/bifs-and-scripts-install-delete-source.sh b/testing/btest/plugins/bifs-and-scripts-install-delete-source.sh new file mode 100644 index 0000000000..11c0f7412d --- /dev/null +++ b/testing/btest/plugins/bifs-and-scripts-install-delete-source.sh @@ -0,0 +1,47 @@ +# @TEST-DOC: Create a plugin, build it, copy its tgz file, delete the source tree, install via the tgz. This ensures the tgz is self-contained and does not have anything pointing back to the source. +# @TEST-EXEC: ${DIST}/auxil/zeek-aux/plugin-support/init-plugin -u the-plugin Demo Foo +# @TEST-EXEC: bash %INPUT +# @TEST-EXEC: cd ./the-plugin && ./configure --zeek-dist=${DIST} --install-root=`pwd`/test-install && make +# @TEST-EXEC: cp -H ./the-plugin/build/Demo_Foo.tgz . +# @TEST-EXEC: rm -rf ./the-plugin +# @TEST-EXEC: ${DIST}/cmake/zeek-plugin-install-package.sh Demo_Foo `pwd`/test-install +# @TEST-EXEC: ZEEK_PLUGIN_PATH=`pwd`/test-install zeek -NN Demo::Foo >>output +# @TEST-EXEC: echo "===" >>output +# @TEST-EXEC: ZEEK_PLUGIN_PATH=`pwd`/test-install zeek -r $TRACES/empty.trace >>output +# @TEST-EXEC: echo "===" >>output +# @TEST-EXEC: ZEEK_PLUGIN_PATH=`pwd`/test-install zeek Demo/Foo -r $TRACES/empty.trace >>output +# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff output + +mkdir -p the-plugin/scripts/Demo/Foo/base/ + +cat >the-plugin/scripts/__load__.zeek <the-plugin/scripts/Demo/Foo/__load__.zeek <the-plugin/scripts/Demo/Foo/manually.zeek <the-plugin/scripts/Demo/Foo/base/at-startup.zeek <the-plugin/src/foo.bif <("Hello from the plugin!"); + %} + +event plugin_event%(foo: count%); +EOF