From 5594d377ac73d37c06bbad1798e87a65f9a12e07 Mon Sep 17 00:00:00 2001 From: Chrissie Caulfield Date: Fri, 25 Nov 2022 07:38:20 +0000 Subject: [PATCH 01/19] ipc: Retry receiving credentials if the the message is short (#476) ipc: Retry receiving credentials if the the message is short rhbz#2111711 refers --- lib/ipc_setup.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ipc_setup.c b/lib/ipc_setup.c index 0ef9bb6b..0de71150 100644 --- a/lib/ipc_setup.c +++ b/lib/ipc_setup.c @@ -473,11 +473,15 @@ qb_ipcc_us_setup_connect(struct qb_ipcc_connection *c, return 0; } +#define AUTH_RECV_MAX_RETRIES 10 +#define AUTH_RECV_SLEEP_TIME_US 100 + /* Called from ipcc_connect_continue() when async connect socket is active */ int qb_ipcc_setup_connect_continue(struct qb_ipcc_connection *c, struct qb_ipc_connection_response *r) { struct ipc_auth_data *data; int32_t res; + int retry_count = 0; #ifdef QB_LINUX int off = 0; #endif @@ -486,8 +490,14 @@ int qb_ipcc_setup_connect_continue(struct qb_ipcc_connection *c, struct qb_ipc_c qb_ipcc_us_sock_close(c->setup.u.us.sock); return -ENOMEM; } - +retry: res = qb_ipc_us_recv_msghdr(data); + if (res == -EAGAIN && ++retry_count < AUTH_RECV_MAX_RETRIES) { + struct timespec ts = {0, AUTH_RECV_SLEEP_TIME_US*QB_TIME_NS_IN_USEC}; + struct timespec ts_left = {0, 0}; + nanosleep(&ts, &ts_left); + goto retry; + } #ifdef QB_LINUX setsockopt(c->setup.u.us.sock, SOL_SOCKET, SO_PASSCRED, &off, From fde729e137c9ead354ea59a289f0728209757427 Mon Sep 17 00:00:00 2001 From: Chrissie Caulfield Date: Thu, 5 Jan 2023 14:45:22 +0000 Subject: [PATCH 02/19] timer: Move state check to before time check (#479) A timer in QB_POLL_ENTRY_JOBLIST doesn't necessarily have a t->timerlist_handle so that deref can segv. Also the comment assumes the timers are threaded - which as we have decided is definitely not true. So it's safe to move the check earlier. In the tests, I've adjusted the timeouts so that they definitely happen at different times. On some architectures they can fire concurrently and in the wrong order. --- lib/loop_timerlist.c | 11 +++-------- tests/check_loop.c | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/loop_timerlist.c b/lib/loop_timerlist.c index 9aef348a..0396b951 100644 --- a/lib/loop_timerlist.c +++ b/lib/loop_timerlist.c @@ -326,10 +326,11 @@ qb_loop_timer_expire_time_remaining(struct qb_loop * lp, qb_loop_timer_handle th if (res != 0) { return 0; } + if (t->state != QB_POLL_ENTRY_ACTIVE) { + return 0; + } struct timerlist_timer *timer = (struct timerlist_timer *)t->timerlist_handle; - - if (timer->is_absolute_timer) { current_ns = qb_util_nano_from_epoch_get(); } @@ -337,12 +338,6 @@ qb_loop_timer_expire_time_remaining(struct qb_loop * lp, qb_loop_timer_handle th current_ns = qb_util_nano_current_get(); } uint64_t timer_ns = timerlist_expire_time(&s->timerlist, t->timerlist_handle); - /* since time estimation is racy by nature, I'll try to check the state late, - * and try to understand that no matter what, the timer might have expired in the mean time - */ - if (t->state != QB_POLL_ENTRY_ACTIVE) { - return 0; - } if (timer_ns < current_ns) { return 0; // respect the "expired" contract } diff --git a/tests/check_loop.c b/tests/check_loop.c index 4f9fe27d..84539a7d 100644 --- a/tests/check_loop.c +++ b/tests/check_loop.c @@ -425,10 +425,10 @@ START_TEST(test_loop_timer_basic) res = qb_loop_timer_add(l, QB_LOOP_LOW, 7*QB_TIME_NS_IN_MSEC, l, reset_one_shot_tmo, &reset_th); ck_assert_int_eq(res, 0); - res = qb_loop_timer_add(l, QB_LOOP_HIGH, 20*QB_TIME_NS_IN_MSEC, l, check_time_left, &test_th2); + res = qb_loop_timer_add(l, QB_LOOP_HIGH, 50*QB_TIME_NS_IN_MSEC, l, check_time_left, &test_th2); ck_assert_int_eq(res, 0); - res = qb_loop_timer_add(l, QB_LOOP_LOW, 60*QB_TIME_NS_IN_MSEC, l, job_stop, &test_th); + res = qb_loop_timer_add(l, QB_LOOP_LOW, 100*QB_TIME_NS_IN_MSEC, l, job_stop, &test_th); ck_assert_int_eq(res, 0); qb_loop_run(l); From e038f59c52efac1e636d49e8b19c8299a4b31dde Mon Sep 17 00:00:00 2001 From: Chrissie Caulfield Date: Fri, 6 Jan 2023 13:30:51 +0000 Subject: [PATCH 03/19] tests: Close race condition in check_loop (#480) Start the "check_time_left" timer before the "stop_job" timer so that we can be sure that it exists when "check_time_left" is run. --- tests/check_loop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/check_loop.c b/tests/check_loop.c index 84539a7d..b20cd85f 100644 --- a/tests/check_loop.c +++ b/tests/check_loop.c @@ -361,7 +361,7 @@ static void check_time_left(void *data) ck_assert(abs_time > 0ULL); ck_assert(rel_time > 0ULL); ck_assert(abs_time > rel_time); - ck_assert(rel_time <= 60*QB_TIME_NS_IN_MSEC); + ck_assert(rel_time <= 500*QB_TIME_NS_IN_MSEC); } @@ -425,10 +425,10 @@ START_TEST(test_loop_timer_basic) res = qb_loop_timer_add(l, QB_LOOP_LOW, 7*QB_TIME_NS_IN_MSEC, l, reset_one_shot_tmo, &reset_th); ck_assert_int_eq(res, 0); - res = qb_loop_timer_add(l, QB_LOOP_HIGH, 50*QB_TIME_NS_IN_MSEC, l, check_time_left, &test_th2); + res = qb_loop_timer_add(l, QB_LOOP_LOW, 500*QB_TIME_NS_IN_MSEC, l, job_stop, &test_th); ck_assert_int_eq(res, 0); - res = qb_loop_timer_add(l, QB_LOOP_LOW, 100*QB_TIME_NS_IN_MSEC, l, job_stop, &test_th); + res = qb_loop_timer_add(l, QB_LOOP_HIGH, 5*QB_TIME_NS_IN_MSEC, l, check_time_left, &test_th2); ck_assert_int_eq(res, 0); qb_loop_run(l); @@ -471,10 +471,10 @@ START_TEST(test_loop_timer_threads) res = qb_loop_timer_add(l, QB_LOOP_LOW, 7*QB_TIME_NS_IN_MSEC, l, reset_one_shot_tmo, &reset_th); ck_assert_int_eq(res, 0); - res = qb_loop_timer_add(l, QB_LOOP_HIGH, 20*QB_TIME_NS_IN_MSEC, l, check_time_left, &test_th2); + res = qb_loop_timer_add(l, QB_LOOP_LOW, 500*QB_TIME_NS_IN_MSEC, l, job_stop, &test_th); ck_assert_int_eq(res, 0); - res = qb_loop_timer_add(l, QB_LOOP_LOW, 60*QB_TIME_NS_IN_MSEC, l, job_stop, &test_th); + res = qb_loop_timer_add(l, QB_LOOP_HIGH, 5*QB_TIME_NS_IN_MSEC, l, check_time_left, &test_th2); ck_assert_int_eq(res, 0); qb_loop_run(l); From 83a4e66d33467dd4d44b7063d38fa81876d64920 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 9 Mar 2023 08:47:50 +0000 Subject: [PATCH 04/19] testing - add Jenkinsfile --- Jenkinsfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100755 index 00000000..cd4417c7 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,30 @@ +#!/bin/bash + +base=`basename $(pwd)` +CONFIG_OPTS="" + +# Make sure we build corosync with systemd so that pcs works +if [ "$base" = "corosync" ] +then + CONFIG_OPTS+="--enable-systemd" + CONFIG_OPTS+="--enable-rust-bindings" +fi + +# Build knet Rust bindings +if [ "$base" = "kronosnet" ] +then + CONFIG_OPTS+="--enable-rust-bindings" +fi + +# Need gnutls for pacemaker-remote (I am not making this up) +if [ "$base" = "corosync" ] +then + CONFIG_OPTS+="--with-gnutls" +fi + +git clean -dxf +sh autogen.sh +./configure "$@" $CONFIG_OPTS +make +make check +make distcheck From c9cc3222d46a265c3bdbbbf052fd8b064f14a840 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 9 Mar 2023 09:28:48 +0000 Subject: [PATCH 05/19] Fix script portability --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cd4417c7..25e1bbe0 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ #!/bin/bash -base=`basename $(pwd)` +base=$(basename $(pwd)) CONFIG_OPTS="" # Make sure we build corosync with systemd so that pcs works From 2e2dd5196f3687f73572d3b63f526de8af0ada2c Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 9 Mar 2023 09:36:00 +0000 Subject: [PATCH 06/19] Proper jenkinsfile? --- Jenkinsfile | 54 +++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 25e1bbe0..3e7701a7 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,26 @@ -#!/bin/bash +pipeline { + agent any -base=$(basename $(pwd)) -CONFIG_OPTS="" - -# Make sure we build corosync with systemd so that pcs works -if [ "$base" = "corosync" ] -then - CONFIG_OPTS+="--enable-systemd" - CONFIG_OPTS+="--enable-rust-bindings" -fi - -# Build knet Rust bindings -if [ "$base" = "kronosnet" ] -then - CONFIG_OPTS+="--enable-rust-bindings" -fi - -# Need gnutls for pacemaker-remote (I am not making this up) -if [ "$base" = "corosync" ] -then - CONFIG_OPTS+="--with-gnutls" -fi - -git clean -dxf -sh autogen.sh -./configure "$@" $CONFIG_OPTS -make -make check -make distcheck + stages { + stage('Build') { + steps { + echo 'Building..' + sh sh autogen.sh + sh ./configure + sh make + } + } + stage('Test') { + steps { + echo 'Testing..' + sh make check + } + } + stage('Deploy') { + steps { + echo 'Deploying....' + sh make distcheck + } + } + } +} From 4006ac2993f446730cf2201fc79feff426df405a Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 9 Mar 2023 09:39:23 +0000 Subject: [PATCH 07/19] quotes --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3e7701a7..3ee2a497 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,22 +5,22 @@ pipeline { stage('Build') { steps { echo 'Building..' - sh sh autogen.sh - sh ./configure - sh make + sh 'sh autogen.sh' + sh './configure' + sh 'make' } } stage('Test') { steps { echo 'Testing..' - sh make check + sh 'make check' } } stage('Deploy') { steps { echo 'Deploying....' - sh make distcheck + sh 'make distcheck' } } } -} +} \ No newline at end of file From b65b8d95beb2287cd093f624a09ce6513f1e38eb Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 9 Mar 2023 09:53:26 +0000 Subject: [PATCH 08/19] Add artifacts --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 3ee2a497..f439223d 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,6 +14,7 @@ pipeline { steps { echo 'Testing..' sh 'make check' + archiveArtifacts artifacts: 'tests/test-suite.log', fingerprint: true } } stage('Deploy') { From 6d61567d3c832d050393131e2ab2cdbe1b311072 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 9 Mar 2023 11:04:02 +0000 Subject: [PATCH 09/19] Parallel --- Jenkinsfile | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f439223d..97c714b3 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,25 +1,30 @@ pipeline { - agent any + agent none stages { - stage('Build') { + stage('Build Debian') { + agent { + label "debian" + } steps { echo 'Building..' sh 'sh autogen.sh' sh './configure' sh 'make' - } - } - stage('Test') { - steps { - echo 'Testing..' sh 'make check' - archiveArtifacts artifacts: 'tests/test-suite.log', fingerprint: true + sh 'make distcheck' } } - stage('Deploy') { + stage('Build Fedora') { + agent { + label "fedora" + } steps { - echo 'Deploying....' + echo 'Building..' + sh 'sh autogen.sh' + sh './configure' + sh 'make' + sh 'make check' sh 'make distcheck' } } From f172d1fbd53067da9134656f84e14932639003cf Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 9 Mar 2023 11:12:51 +0000 Subject: [PATCH 10/19] proper Parallel (last one ran serial) --- Jenkinsfile | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 97c714b3..33b85649 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,30 +2,34 @@ pipeline { agent none stages { - stage('Build Debian') { - agent { - label "debian" - } - steps { - echo 'Building..' - sh 'sh autogen.sh' - sh './configure' - sh 'make' - sh 'make check' - sh 'make distcheck' - } - } - stage('Build Fedora') { - agent { - label "fedora" - } - steps { - echo 'Building..' - sh 'sh autogen.sh' - sh './configure' - sh 'make' - sh 'make check' - sh 'make distcheck' + stage('Build') { + parallel { + stage ('Build on Debian') { + agent { + label "debian" + } + steps { + echo 'Building..' + sh 'sh autogen.sh' + sh './configure' + sh 'make' + sh 'make check' + sh 'make distcheck' + } + } + stage ('Build on Fedora') { + agent { + label "fedora" + } + steps { + echo 'Building..' + sh 'sh autogen.sh' + sh './configure' + sh 'make' + sh 'make check' + sh 'make distcheck' + } + } } } } From d17d11859991b33f9d69be92826dc1cf67049534 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 9 Mar 2023 13:39:45 +0000 Subject: [PATCH 11/19] Try matrix build --- Jenkinsfile | 59 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33b85649..bac2aae5 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,36 +1,35 @@ pipeline { agent none - stages { - stage('Build') { - parallel { - stage ('Build on Debian') { - agent { - label "debian" - } - steps { - echo 'Building..' - sh 'sh autogen.sh' - sh './configure' - sh 'make' - sh 'make check' - sh 'make distcheck' - } - } - stage ('Build on Fedora') { - agent { - label "fedora" - } - steps { - echo 'Building..' - sh 'sh autogen.sh' - sh './configure' - sh 'make' - sh 'make check' - sh 'make distcheck' - } - } + stage('Build and Test') { + matrix { + agent { + label "${PLATFORM}" + } + axes { + axis { + name 'PLATFORM' + values 'fedora', 'debian' + } + } + stages { + stage('Build & Test') { + steps { + echo "Do Build and Test for ${PLATFORM}" + sh 'sh autogen.sh' + sh './configure' + sh 'make' + sh 'make check' + sh 'make distcheck' + } + } + } + post { + always { + archiveArtifacts artifacts: 'tests/test-suite.log', fingerprint: true + } + } } } } -} \ No newline at end of file +} From 2897c19246a33c12d854f82fd54bc342f8e266dc Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Wed, 15 Mar 2023 11:12:32 +0000 Subject: [PATCH 12/19] Try using a library --- Jenkinsfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bac2aae5..26d9e7b2 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,5 @@ +@Library('CCtestLib') _ + pipeline { agent none stages { @@ -15,13 +17,8 @@ pipeline { stages { stage('Build & Test') { steps { - echo "Do Build and Test for ${PLATFORM}" - sh 'sh autogen.sh' - sh './configure' - sh 'make' - sh 'make check' - sh 'make distcheck' - } + runstuff(project:"CCTest", branch:"main") + } } } post { From 2cb9575096413401b3822535c02f2fdc18aed2e6 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Wed, 15 Mar 2023 13:01:43 +0000 Subject: [PATCH 13/19] getting audacious now --- Jenkinsfile | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 26d9e7b2..fd347ee2 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,32 +1,5 @@ @Library('CCtestLib') _ pipeline { - agent none - stages { - stage('Build and Test') { - matrix { - agent { - label "${PLATFORM}" - } - axes { - axis { - name 'PLATFORM' - values 'fedora', 'debian' - } - } - stages { - stage('Build & Test') { - steps { - runstuff(project:"CCTest", branch:"main") - } - } - } - post { - always { - archiveArtifacts artifacts: 'tests/test-suite.log', fingerprint: true - } - } - } - } - } + runpipes(project:"libqb", branch:"main") } From b2a4c549bd47c99463561acd3cfe3db6e7dc7dc8 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Wed, 15 Mar 2023 13:36:30 +0000 Subject: [PATCH 14/19] nope, not a clue --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd347ee2..4e0ee660 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,8 @@ @Library('CCtestLib') _ pipeline { - runpipes(project:"libqb", branch:"main") + agent none + stages { + runpipes(project:"libqb", branch:"main") + } } From 1e136171c80039b7a0e1878ee6b626dc50968181 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Wed, 15 Mar 2023 13:37:48 +0000 Subject: [PATCH 15/19] Nah --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4e0ee660..657d8a7b 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,8 @@ pipeline { agent none stages { - runpipes(project:"libqb", branch:"main") + stage('general') { + runpipes(project:"libqb", branch:"main") + } } } From 68d90f86736fdc4092bd99418dc4134626e0b74b Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Wed, 15 Mar 2023 13:38:51 +0000 Subject: [PATCH 16/19] Huh? --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 657d8a7b..5ad74026 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,9 @@ pipeline { agent none stages { stage('general') { - runpipes(project:"libqb", branch:"main") + steps { + runpipes(project:"libqb", branch:"main") + } } } } From f939c5247339c0299fdb3f9ab8a33c4d271cee74 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Wed, 15 Mar 2023 13:40:17 +0000 Subject: [PATCH 17/19] nah --- Jenkinsfile | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5ad74026..2520cde1 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,12 +1,3 @@ @Library('CCtestLib') _ -pipeline { - agent none - stages { - stage('general') { - steps { - runpipes(project:"libqb", branch:"main") - } - } - } -} +runpipes(project:"libqb", branch:"main") From 9f488dd800ce559f7acecee264785e19e133f99e Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 13 Apr 2023 10:13:47 +0100 Subject: [PATCH 18/19] Try a conditional pipeline --- Jenkinsfile | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2520cde1..f56e853b 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,42 @@ -@Library('CCtestLib') _ - -runpipes(project:"libqb", branch:"main") +pipeline { + agent fedora37 + environment { + when { + environment name: 'MODE', value: 'development' + } + CONFIG_FLAGS = '' + } + environment { + when { + environment name: 'MODE', value: 'production' + } + CONFIG_FLAGS = '--enable-debug' + } + stages { + stage('Build and test') { + stages { + stage('Prep') { + steps { + sh 'sh autogen.sh' + sh './configure' + } + } + stage('Build') { + steps { + sh 'make $CONFIG_FLAGS' + } + } + stage('Test') { + steps { + sh 'make check' + } + } + stage('Dist Check') { + steps { + sh 'make distcheck' + } + } + } + } + } +} From 57763c8a760d8e3db384d5d65be3e46619b079cb Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 13 Apr 2023 11:17:22 +0100 Subject: [PATCH 19/19] test param --- Jenkinsfile | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f56e853b..68483ef1 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,42 +1 @@ -pipeline { - agent fedora37 - environment { - when { - environment name: 'MODE', value: 'development' - } - CONFIG_FLAGS = '' - } - environment { - when { - environment name: 'MODE', value: 'production' - } - CONFIG_FLAGS = '--enable-debug' - } - stages { - stage('Build and test') { - stages { - stage('Prep') { - steps { - sh 'sh autogen.sh' - sh './configure' - } - } - stage('Build') { - steps { - sh 'make $CONFIG_FLAGS' - } - } - stage('Test') { - steps { - sh 'make check' - } - } - stage('Dist Check') { - steps { - sh 'make distcheck' - } - } - } - } - } -} +@Library('CCtestLib${BUILDTYPE}) _