From c96ecfc133ad561ad8992a00508bfa9eaaeaf31a Mon Sep 17 00:00:00 2001 From: Marion Guthmuller Date: Sun, 18 Nov 2012 19:46:18 +0100 Subject: [PATCH] model-checker : add tesh for bugged1_liveness and chord_neverjoin --- buildtools/Cmake/AddTests.cmake | 2 + examples/msg/mc/bugged1_liveness.tesh | 60 ++++++++++++++++++++++ examples/msg/mc/chord/chord_neverjoin.tesh | 31 +++++++++++ 3 files changed, 93 insertions(+) create mode 100644 examples/msg/mc/bugged1_liveness.tesh create mode 100644 examples/msg/mc/chord/chord_neverjoin.tesh diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index 8f6ea34ecf..224e0dc9c5 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -522,6 +522,8 @@ if(NOT enable_memcheck) ADD_TEST(mc-bugged1-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh) ADD_TEST(mc-bugged2-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh) ADD_TEST(mc-centralized-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc centralized.tesh) + ADD_TEST(mc-bugged1-liveness-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh) + ADD_TEST(mc-chord-neverjoin-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/chord chord_neverjoin.tesh) endif() if(HAVE_RAWCTX) ADD_TEST(mc-bugged1-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh) diff --git a/examples/msg/mc/bugged1_liveness.tesh b/examples/msg/mc/bugged1_liveness.tesh new file mode 100644 index 0000000000..5f1d3da5a7 --- /dev/null +++ b/examples/msg/mc/bugged1_liveness.tesh @@ -0,0 +1,60 @@ +#! ./tesh + +! expect signal SIGABRT +! timeout 60 +$ ${bindir:=.}/bugged1_liveness --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 0.000000] (0:@) Configuration change: Set 'model-check' to '1' +> [ 0.000000] (0:@) type in variable = 2 +> [ 0.000000] (0:@) Check the liveness property promela_bugged1_liveness +> [ 0.000000] (2:client@Fafard) Ask the request +> [ 0.000000] (3:client@Boivin) Ask the request +> [ 0.000000] (2:client@Fafard) Propositions changed : r=1, cs=0 +> [ 0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly +> [ 0.000000] (3:client@Boivin) 2 got the answer. Sleep a bit and release it +> [ 0.000000] (1:coordinator@Tremblay) CS release. resource now idle +> [ 4.000000] (3:client@Boivin) Ask the request +> [ 0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly +> [ 4.000000] (3:client@Boivin) 2 got the answer. Sleep a bit and release it +> [ 0.000000] (1:coordinator@Tremblay) CS release. resource now idle +> [ 8.000000] (3:client@Boivin) Ask the request +> [ 0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly +> [ 0.000000] (0:@) Next pair (depth = 33, 2 interleave) already reached ! +> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* +> [ 0.000000] (0:@) | ACCEPTANCE CYCLE | +> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* +> [ 0.000000] (0:@) Counter-example that violates formula : +> [ 0.000000] (0:@) [(1)coordinator] iRecv (dst=coordinator, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(2)client] iSend (src=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)coordinator] Wait (comm=(verbose only) [(2)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(1)coordinator] iRecv (dst=coordinator, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(2)client] Wait (comm=(verbose only) [(2)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(2)client] iRecv (dst=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)client] iSend (src=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)coordinator] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(1)coordinator] iSend (src=coordinator, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)client] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(3)client] iRecv (dst=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)coordinator] Wait (comm=(verbose only) [(1)coordinator -> (3)client]) +> [ 0.000000] (0:@) [(1)coordinator] iRecv (dst=coordinator, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)client] Wait (comm=(verbose only) [(1)coordinator -> (3)client]) +> [ 0.000000] (0:@) [(3)client] iSend (src=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)coordinator] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(1)coordinator] iRecv (dst=coordinator, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)client] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(3)client] iSend (src=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)coordinator] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(1)coordinator] iSend (src=coordinator, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)client] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(3)client] iRecv (dst=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)coordinator] Wait (comm=(verbose only) [(1)coordinator -> (3)client]) +> [ 0.000000] (0:@) [(1)coordinator] iRecv (dst=coordinator, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)client] Wait (comm=(verbose only) [(1)coordinator -> (3)client]) +> [ 0.000000] (0:@) [(3)client] iSend (src=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)coordinator] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(1)coordinator] iRecv (dst=coordinator, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)client] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) [(3)client] iSend (src=client, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)coordinator] Wait (comm=(verbose only) [(3)client -> (1)coordinator]) +> [ 0.000000] (0:@) Expanded pairs = 34 +> [ 0.000000] (0:@) Visited pairs = 32 +> [ 0.000000] (0:@) Expanded / Visited = 0.941176 diff --git a/examples/msg/mc/chord/chord_neverjoin.tesh b/examples/msg/mc/chord/chord_neverjoin.tesh new file mode 100644 index 0000000000..ea12ba5cc3 --- /dev/null +++ b/examples/msg/mc/chord/chord_neverjoin.tesh @@ -0,0 +1,31 @@ +#! ./tesh + +! expect signal SIGABRT +! timeout 60 +$ ${bindir:=.}/chord_liveness --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 0.000000] (0:@) Configuration change: Set 'model-check' to '1' +> [ 0.000000] (0:@) type in variable = 2 +> [ 0.000000] (0:@) Check the liveness property promela_chord_liveness +> [ 0.000000] (1:node@Jean_Yves) Joining the ring with id 14, knowing node 1 +> [ 0.000000] (2:node@Boivin) Joining the ring with id 8, knowing node 1 +> [ 0.000000] (3:node@Jacquelin) A transfer has occured +> [ 0.000000] (3:node@Jacquelin) The task was successfully received by node 1 +> [ 0.000000] (1:node@Jean_Yves) Node 14 joined the ring +> [ 0.000000] (0:@) Next pair (depth = 11, 2 interleave) already reached ! +> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* +> [ 0.000000] (0:@) | ACCEPTANCE CYCLE | +> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* +> [ 0.000000] (0:@) Counter-example that violates formula : +> [ 0.000000] (0:@) [(1)node] iSend (src=node, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(2)node] iSend (src=node, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)node] iRecv (dst=node, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)node] Wait (comm=(verbose only) [(1)node -> (3)node]) +> [ 0.000000] (0:@) [(1)node] iRecv (dst=node, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(3)node] Test TRUE (comm=(verbose only) [(1)node -> (3)node]) +> [ 0.000000] (0:@) [(3)node] iSend (src=node, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)node] Wait (comm=(verbose only) [(3)node -> (1)node]) +> [ 0.000000] (0:@) [(1)node] iRecv (dst=node, buff=(verbose only), size=(verbose only)) +> [ 0.000000] (0:@) [(1)node] Test FALSE (comm=(verbose only)) +> [ 0.000000] (0:@) Expanded pairs = 14 +> [ 0.000000] (0:@) Visited pairs = 10 +> [ 0.000000] (0:@) Expanded / Visited = 0.714286 \ No newline at end of file -- 2.20.1