Skip to content

Commit

Permalink
br: acceptance setcap on test run (#3284)
Browse files Browse the repository at this point in the history
Currently, braccept needs capabilities that are set during acceptance
test setup. Thus every time we do 'make', we get a new binary that
needs capabilities.

This change moves setting the capabilities to the acceptance test run,
allowing to rebuild braccept without having to teardown->setup the
acceptance test every time.
  • Loading branch information
sgmonroy authored Oct 28, 2019
1 parent 8746950 commit f95f51c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions acceptance/brutil/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ BR_TOML=$TEST_ARTIFACTS_DIR/conf/$BR_TOML_FN
test_setup() {
set -e

# XXX(kormat): This is conditional on the binary existing, because when
# running on CI 'setup' is run on the host, where the binary doesn't exist.
[ -e $BRACCEPT ] && make -s setcap

test_config

local disp_dir="/run/shm/dispatcher"
Expand Down Expand Up @@ -64,6 +60,15 @@ test_config() {

test_run() {
set -e

# XXX(sgmonroy): this sets capabilities on the braccept binary.
# Initially this was done during setup and effectively a NOOP in CI given that there is no
# bracecpt binary when doing setup in the CI host. Instead capabilities are set when generating
# the container.
# This change allows to rebuild braccept binary without having to teardown/setup a test, at the cost
# of setting the capabilities twice on CI.
make -s setcap

$BRACCEPT -testName "${TEST_NAME:?}" -keysDirPath "$TEST_ARTIFACTS_DIR/conf/keys" "$@"
}

Expand Down

0 comments on commit f95f51c

Please sign in to comment.