# BST-TIMEOUT: 120 # MEASURED: see the Self-Test Record in the BRINTOS-933 # # design doc. Nothing here can block: every SCTP call ends # # at socket(2) returning EPROTONOSUPPORT immediately, the # # probe carries its own alarm(30), and the CLI cases are # # five short-lived forks. 120 is headroom for a loaded # # nightly host, not a reflection of any slow case. # # . "$BST_LIB" is the first executable line; everything above it is the # reader's brief. # lksctp-tools 1.0.19+git -- the lksctp project's userspace half (meta-networking # recipes-support/lksctp-tools). What ships is /usr/lib/libsctp.a, # /usr/lib/lksctp-tools/libwithsctp.a, /usr/include/netinet/sctp.h, # /usr/lib/pkgconfig/libsctp.pc, five tools in /usr/bin (checksctp, sctp_test, # sctp_status, sctp_darn, withsctp) and one probe under # /usr/libexec/lksctp-tools-tests. # # --------------------------------------------------------------------------- # THIS LIBRARY IMPLEMENTS NO PROTOCOL, AND THAT IS THE WHOLE DESIGN PROBLEM. # # libsctp is a thin veneer: sctp_bindx and sctp_connectx tunnel through # setsockopt(2), sctp_sendmsg/sctp_recvmsg through sendmsg/recvmsg with SCTP # ancillary data, sctp_getladdrs/getpaddrs through a getsockopt the kernel # answers. SCTP itself is entirely in the kernel. # # arch/wasm32/configs/wasm32_defconfig sets CONFIG_NET=y and CONFIG_INET=y and # carries NO CONFIG_IP_SCTP line, so the protocol is never registered and # socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP) returns EPROTONOSUPPORT. Every # entry point that needs an SCTP socket therefore fails at its first syscall. # That gap is the brintos.io issue named in ATTRIB below; every red here is # attributed to it, and the ticket named exactly this outcome as acceptable. # # The naive suite writes itself and is worthless. Run checksctp, watch it fail, # attribute it, ship. A libsctp.a MISCOMPILED INTO RUBBLE WOULD FAIL THE SAME # WAY, because not one of those failures would have reached a line of library # code that does anything -- the libkcapi and libsocketcan lesson, in a third # subsystem. So this file scores four groups that the naive one conflates: # # PACKAGING -- the archives, header, .pc and the five tools are present and # the tools EXECUTE. `sctp_test -h` is not a formality: it is a # consumer of the very archive under test, so a tool that prints its # usage banner has demonstrably linked and run library code without # needing a kernel. It also pins the exit-127 lesson from BRINTOS-739 # -- a tool that was never built and a tool that fails are different # findings, and only the exit status tells them apart. # # A group -- THE ARCHIVE IS ALIVE. Entry points that reach no kernel, or reach # one every image has: sctp_getaddrlen() is pure computation; # sctp_bindx() runs its flags switch and its address walk and returns # EINVAL before issuing a syscall; and with both valid it reaches # setsockopt(2) and comes back EBADF on a closed fd. sctp_connectx() # is in this group for a second reason -- see THE PATCH below. # NOTHING HERE MAY BE RED, today or after the kernel gap closes. # # N group -- THE NULL CONTROL, and the reason the K group means anything at # all. The probe opens AF_INET/SOCK_STREAM, AF_INET/SOCK_DGRAM and # AF_UNIX in the SAME PROCESS, moments before the SCTP socket. They # must succeed. Without them "SCTP is unsupported" is equally # consistent with a broken socket layer, a broken libc, or a sandbox # refusing every socket -- all port defects wearing the platform gap's # clothes. With them, the failure is pinned to ONE protocol number. # # K group -- the kernel path, including the ticket's stated self-test: a # one-to-one association between two sockets on 127.0.0.1, a message # out through sctp_sendmsg() and back through sctp_recvmsg(), checking # the payload AND the stream number. Expected red on this image, each # case attributed. The discrimination that matters is the ERRNO: only # EPROTONOSUPPORT means "the library composed a correct call and the # kernel has no such protocol". Any other errno is scored as a genuine # port defect, in different words. # # THE PATCH. sctp_connectx() has no C definition upstream at all -- it exists # only as ELF version aliases (.symver), which WebAssembly cannot express and # whose directive its assembler rejects outright. This port patches # src/lib/connectx.c to give the @@-default implementation the public name. # lksctp-tools/a-connectx is therefore not a routine API case: it is the # assertion that the patch took. It cannot go red quietly -- the probe links # against libsctp.a at BUILD time, so a patch that stopped working fails the # build rather than this suite. # # --------------------------------------------------------------------------- # WHY THE K GROUP IS `not ok` AND NOT `skip`. # # `skip` means the subject is legitimately ABSENT. lksctp-tools is present, it # is installed, and its tools run -- what is absent is a KERNEL OPTION, and it # is one defconfig line away (net/sctp/ is entirely in the tree, so this is a # config gap and not missing code). Scoring these `skip` would retire the only # signal anyone has that the image ships an SCTP library on a kernel with no # SCTP. They are red, attributed, and they turn green by themselves the day the # kernel grows CONFIG_IP_SCTP. # # The round-trip ASSERTIONS are different and are `skip`: an association that # was never established produces no payload and no stream number, and an # unexecuted comparison has no verdict. They begin asserting correctness with no # edit to this file the day the protocol appears -- which is why they ship now. . "$BST_LIB" R=${BST_ROOT:-} PROBE=$R/usr/libexec/lksctp-tools-tests/lksctp-probe ARCHIVE=$R/usr/lib/libsctp.a WITHLIB=$R/usr/lib/lksctp-tools/libwithsctp.a PCFILE=$R/usr/lib/pkgconfig/libsctp.pc HDR=$R/usr/include/netinet/sctp.h BIN=$R/usr/bin # The brintos.io issue every red below is attributed to. One variable, so the # attribution cannot drift between cases. ATTRIB="PLATFORM-NO-SCTP (brintos/linux#90)" # The version the recipe pins. Asserted rather than read back, so a recipe # bumped without revisiting this suite is a red here instead of a silent change # of subject. WANT_VERSION=1.0.19 # The round trip's fixture, and it must agree with lksctp_probe.c. Stream 3, not # 0: a stream number that survived only because everything defaults to zero # would prove nothing. Measured on x86-64 against a real SCTP kernel, where this # same probe reports stream=3 and the payload byte-for-byte -- the first cut # asserted the stream number WITHOUT enabling sctp_data_io_event and produced a # false MISMATCH on a kernel where SCTP works perfectly. WANT_MSG="brintos-lksctp-roundtrip" WANT_STREAM=3 WANT_PPID=6c6b7370 if [ ! -f "$ARCHIVE" ]; then bst_skip lksctp-tools/present "lksctp-tools not installed on this image" exit 0 fi bst_ok lksctp-tools/present # --- the package is whole ----------------------------------------------------- check lksctp-tools/staticlib test -s "$ARCHIVE" check lksctp-tools/withsctp-staticlib test -s "$WITHLIB" check lksctp-tools/pkgconfig test -s "$PCFILE" check lksctp-tools/hdr-main test -s "$HDR" # Shape, not absence: this arm converts to shared libraries per recipe # (BRINTOS-1740), so a .so here is a conversion, not a policy breach. bst_lib_shape lksctp-tools/no-shared "$R/usr/lib/libsctp.so" "$R/usr/lib/libsctp.so.1" pcver=$(sed -n 's/^Version: *//p' "$PCFILE" 2>/dev/null | head -1) check_eq lksctp-tools/pkgconfig-version "$WANT_VERSION" "$pcver" check_out lksctp-tools/pkgconfig-libs "-lsctp" cat "$PCFILE" # The generated header carries the public prototypes. sctp_connectx's presence # here is what the patch's forward declaration takes its type from, so a header # that lost it would turn a type mismatch into a silently wrong alias. for d in sctp_bindx sctp_connectx sctp_sendmsg sctp_recvmsg sctp_getladdrs \ sctp_getpaddrs sctp_opt_info sctp_peeloff; do if grep -q "$d" "$HDR" 2>/dev/null; then bst_ok "lksctp-tools/hdr-$d" else bst_notok "lksctp-tools/hdr-$d" "$d is not declared in $HDR" fi done # The archive carries the API. grep rather than nm: the image ships no binutils # nm, and the names are present as plain bytes. -a where the grep supports it -- # on this arm the archive members are LLVM IR bitcode (ThinLTO), so a grep that # suppresses matches in a file containing NULs reports nothing; GNU grep needs # -a, busybox grep as shipped does not. if echo x | grep -aq x 2>/dev/null; then _grepq="grep -aq"; else _grepq="grep -q"; fi for sym in sctp_bindx sctp_connectx sctp_sendmsg sctp_recvmsg sctp_getladdrs \ sctp_getpaddrs sctp_freeladdrs sctp_freepaddrs sctp_opt_info \ sctp_peeloff sctp_getaddrlen; do if $_grepq "$sym" "$ARCHIVE" 2>/dev/null; then bst_ok "lksctp-tools/sym-$sym" else bst_notok "lksctp-tools/sym-$sym" "$sym absent from $ARCHIVE" fi done # --- the tools ---------------------------------------------------------------- # Presence and execution are scored separately: a tool that is absent and a tool # that is present-and-broken are different findings. for t in checksctp sctp_test sctp_status sctp_darn withsctp; do if [ -x "$BIN/$t" ]; then bst_ok "lksctp-tools/tool-$t" else bst_notok "lksctp-tools/tool-$t" "$BIN/$t absent or not executable" fi done # THE EXIT-127 CASE, and the strongest kernel-free evidence in the file: # sctp_test links libsctp.a (it is the one tool that calls sctp_connectx), so a # usage banner means the archive linked, relocated and ran. A tool that was # never built exits 127 with nothing, which is a different finding. if [ -x "$BIN/sctp_test" ]; then out=$("$BIN/sctp_test" -h 2>&1); rc=$? if bst_execfail "$out"; then bst_unrun lksctp-tools/runs-sctp_test "$out" elif [ "$rc" -eq 127 ]; then bst_notok lksctp-tools/runs-sctp_test "sctp_test exited 127 -- present in the image but not executable as built" elif echo "$out" | grep -q "usage:"; then bst_ok lksctp-tools/runs-sctp_test else bst_notok lksctp-tools/runs-sctp_test "sctp_test -h printed no usage banner (rc=$rc): $(_bst_1line "$(echo "$out" | head -c 200)")" fi else bst_skip lksctp-tools/runs-sctp_test "sctp_test not installed" fi # sctp_darn refuses without a local host and says so, on stderr, rc 1. Measured # on x86-64 rather than assumed -- and it needs no kernel to get there. if [ -x "$BIN/sctp_darn" ]; then out=$("$BIN/sctp_darn" 2>&1); rc=$? if bst_execfail "$out"; then bst_unrun lksctp-tools/runs-sctp_darn "$out" elif [ "$rc" -eq 127 ]; then bst_notok lksctp-tools/runs-sctp_darn "sctp_darn exited 127 -- present in the image but not executable as built" elif echo "$out" | grep -q "Usage:"; then bst_ok lksctp-tools/runs-sctp_darn else bst_notok lksctp-tools/runs-sctp_darn "sctp_darn printed no usage (rc=$rc): $(_bst_1line "$(echo "$out" | head -c 200)")" fi else bst_skip lksctp-tools/runs-sctp_darn "sctp_darn not installed" fi # --- checksctp: the ticket's named first test -------------------------------- # It opens socket(PF_INET, SOCK_STREAM, 132) and nothing else, so it IS the # protocol-presence question in one program. On a kernel with SCTP it prints # "SCTP supported" on stderr and exits 0; here it perror()s and exits 1. The # errno text is what separates the platform gap from a port defect. if [ -x "$BIN/checksctp" ]; then out=$("$BIN/checksctp" 2>&1); rc=$? if bst_execfail "$out"; then bst_unrun lksctp-tools/checksctp "$out" elif [ "$rc" -eq 0 ] && echo "$out" | grep -q "SCTP supported"; then bst_ok lksctp-tools/checksctp elif [ "$rc" -eq 127 ]; then bst_notok lksctp-tools/checksctp "checksctp exited 127 -- present in the image but not executable as built" elif echo "$out" | grep -qiE "Protocol not supported|EPROTONOSUPPORT"; then bst_notok lksctp-tools/checksctp \ "$ATTRIB: checksctp cannot open an SCTP socket -- socket(PF_INET, SOCK_STREAM, 132) returns EPROTONOSUPPORT because wasm32_defconfig carries no CONFIG_IP_SCTP line, so the protocol is never registered. A kernel CONFIG gap, not missing code (net/sctp/ is in the tree) and not an lksctp-tools defect: $(_bst_1line "$out")" else bst_notok lksctp-tools/checksctp \ "checksctp failed in an unexpected way (rc=$rc) -- this is NOT the known platform gap: $(_bst_1line "$(echo "$out" | head -c 200)")" fi else bst_skip lksctp-tools/checksctp "checksctp not installed" fi # --- withsctp: shipped, and unusable here for TWO independent reasons --------- # It is a shell wrapper that LD_PRELOADs libwithsctp.so., which a # --disable-shared image does not build -- so it could not work on this arm even # on a kernel that carries SCTP. But that is not why it fails today: the script # runs checksctp first and exits on its failure, before the preload could # matter. The two are scored apart because they are different findings and a # future image could fix one alone. if [ -e "$R/usr/lib/lksctp-tools/libwithsctp.so.$WANT_VERSION" ]; then bst_notok lksctp-tools/withsctp-preload-absent "a shared libwithsctp exists on a static-only distro" else bst_ok lksctp-tools/withsctp-preload-absent fi if [ -x "$BIN/withsctp" ]; then out=$("$BIN/withsctp" /bin/true 2>&1); rc=$? if [ "$rc" -eq 0 ]; then bst_ok lksctp-tools/withsctp-runs # ...but exiting 0 is NOT the same as having interposed. Measured in a # chroot on x86-64 with a real SCTP kernel: with libwithsctp.so absent the # loader prints "cannot be preloaded: ignored" and runs the command anyway, # so withsctp exits 0 having done NOTHING it exists to do. On this arm it # cannot do it at all -- static-only, no dynamic loader, LD_PRELOAD is # inert -- so the case is `skip`, never a pass. Scoring it on the exit # status alone is exactly the false green this suite is built to refuse. bst_skip lksctp-tools/withsctp-interposes \ "withsctp ran the command but its LD_PRELOAD shim was not in effect: this arm is --disable-shared and builds no libwithsctp.so for the loader to preload" elif echo "$out" | grep -qiE "Protocol not supported|EPROTONOSUPPORT"; then bst_notok lksctp-tools/withsctp-runs \ "$ATTRIB: withsctp gates on checksctp and exits (rc=$rc) because the kernel registers no SCTP. Note it ALSO has no libwithsctp.so to preload on this static-only arm -- see withsctp-preload-absent -- but that is not the failure observed here: $(_bst_1line "$out")" else bst_notok lksctp-tools/withsctp-runs \ "withsctp failed in an unexpected way (rc=$rc) -- this is NOT the known platform gap: $(_bst_1line "$(echo "$out" | head -c 200)")" fi # The command never got as far as the shim on either failing branch, so the # interposition question is unexecuted rather than answered. Emitted here too # so the case appears in every run and cannot vanish from the count. if [ "$rc" -ne 0 ]; then bst_skip lksctp-tools/withsctp-interposes \ "withsctp exited before running the command, so its LD_PRELOAD shim was never reached ($ATTRIB); this arm also builds no libwithsctp.so for the loader to preload" fi else bst_skip lksctp-tools/withsctp-runs "withsctp not installed" bst_skip lksctp-tools/withsctp-interposes "withsctp not installed" fi # --- the probe ---------------------------------------------------------------- if [ ! -x "$PROBE" ]; then if [ -f "$PROBE" ]; then bst_notok lksctp-tools/probe-runs "$PROBE is present but not executable" else bst_skip lksctp-tools/probe-runs "$PROBE absent from the image" fi exit 0 fi tmp=${TMPDIR:-/tmp} pout=$tmp/bst-lksctp-out.$$ "$PROBE" > "$pout" 2>&1 prc=$? if [ "$prc" -eq 0 ]; then bst_ok lksctp-tools/probe-runs elif bst_execfail "$(head -c 200 "$pout" 2>/dev/null)"; then bst_unrun lksctp-tools/probe-runs "$(head -c 200 "$pout" 2>/dev/null)" rm -f "$pout" exit 0 else bst_notok lksctp-tools/probe-runs "probe exited $prc: $(_bst_1line "$(head -c 300 "$pout")")" fi # PROBE-END is the terminator. Without it a probe killed partway through would # leave every unreached case reporting its default and the suite would score a # truncated run as a clean one. if grep -q '^PROBE-END$' "$pout" 2>/dev/null; then bst_ok lksctp-tools/probe-complete else bst_notok lksctp-tools/probe-complete "probe output has no PROBE-END terminator (last line: $(tail -1 "$pout" 2>/dev/null))" fi # ONE awk pass over the probe's output, turning every `key=value` line into a # shell variable V_. This is the whole of the process cost of scoring the # probe half -- variables, not a fork per case. eval "$(awk -F= ' function q(v) { gsub(/'"'"'/, "'"'"'\\'"'"''"'"'", v); return "'"'"'" v "'"'"'" } /^[a-z][a-z0-9_]*=/ && seen[$1]++ == 0 { id = $1; v = substr($0, index($0, "=") + 1); print "V_" id "=" q(v) } ' "$pout")" # --- A group: the archive is alive ------------------------------------------- # These need no SCTP. If any is red the port is broken, and every # EPROTONOSUPPORT below becomes uninterpretable -- so they are scored first and # read first. check_eq lksctp-tools/a-getaddrlen-inet 16 "$V_a_getaddrlen_inet" check_eq lksctp-tools/a-getaddrlen-inet6 28 "$V_a_getaddrlen_inet6" check_eq lksctp-tools/a-getaddrlen-bogus 0 "$V_a_getaddrlen_bogus" # sctp_bindx's own flags switch and address walk, each rejecting before any # syscall is issued -- real library code, no kernel of any kind involved. check_eq lksctp-tools/a-bindx-badflags "-1/EINVAL" "$V_a_bindx_badflags" check_eq lksctp-tools/a-bindx-badfamily "-1/EINVAL" "$V_a_bindx_badfamily" # ...and with both valid, the same call reaches setsockopt(2), which answers # EBADF for a closed fd. This is the case that says library code got all the way # to the syscall boundary on an image with no SCTP at all. check_eq lksctp-tools/a-bindx-ebadf "-1/EBADF" "$V_a_bindx_ebadf" # THE PATCH'S OWN CASE -- see THE PATCH in the brief above. check_eq lksctp-tools/a-connectx "-1/EBADF" "$V_a_connectx_ebadf" # --- N group: the null control ----------------------------------------------- # Opened by the PROBE, in the same process and moments before the SCTP socket. # These are what make the K group a statement about ONE protocol rather than # about sockets, libc or the sandbox. If any is red, DO NOT read the K group as # a kernel-SCTP finding -- read it as an unknown. for n in af_inet_stream af_inet_dgram af_unix; do eval "v=\$V_n_$n" case "$v" in open) bst_ok "lksctp-tools/control-$(echo "$n" | tr '_' '-')" ;; *) bst_notok "lksctp-tools/control-$(echo "$n" | tr '_' '-')" \ "$n could not be opened in the probe's own process ($v) -- the SCTP cases below are NOT evidence of a kernel gap while this is red" ;; esac done # --- K group: the SCTP kernel path ------------------------------------------- # One scorer, so the wording of the attribution cannot drift between cases. score_sctp_socket() { _case=$1; _val=$2; _what=$3 case "$_val" in open) bst_ok "$_case" ;; *EPROTONOSUPPORT*) bst_notok "$_case" \ "$ATTRIB: $_what returns EPROTONOSUPPORT ($_val) while AF_INET stream, AF_INET datagram and AF_UNIX all open in the same process -- wasm32_defconfig carries no CONFIG_IP_SCTP line, so the protocol is never registered. A kernel CONFIG gap, not missing code (net/sctp/ is in the tree) and not an lksctp-tools defect" ;; '') bst_notok "$_case" "$_what produced no line in the probe output -- the probe did not reach it" ;; *) bst_notok "$_case" "$_what failed in an unexpected way: '$_val' -- this is NOT the known platform gap and should be read as a port defect" ;; esac } score_sctp_socket lksctp-tools/sctp-socket-stream "$V_k_sctp_stream_raw" "socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)" score_sctp_socket lksctp-tools/rt-server-socket "$V_k_rt_server_socket" "the round trip's listening socket" # THE ONE-TO-MANY SOCKET ANSWERS A DIFFERENT ERRNO, AND THAT IS THE GAP TOO -- # scored on its own because assuming otherwise cost this suite a false "port # defect" verdict on its first real run. # # net/ipv4/af_inet.c:inet_create() sets err = -ESOCKTNOSUPPORT BEFORE walking # inetsw[sock->type], and only downgrades it to -EPROTONOSUPPORT inside the loop # body -- so an EMPTY list for that socket type never reaches the downgrade. # inetsw[SOCK_SEQPACKET] has exactly one registrant in the whole tree, # net/sctp/protocol.c's sctp_seqpacket_protosw, whereas inetsw[SOCK_STREAM] # always has TCP. So with no SCTP: # # SOCK_STREAM -> the list has TCP, no entry matches protocol 132 # -> EPROTONOSUPPORT (93) # SOCK_SEQPACKET -> the list is EMPTY, the loop body never runs # -> ESOCKTNOSUPPORT (94) # # Two errnos, one missing CONFIG_IP_SCTP. Both are accepted here and NOTHING # else is: EPROTONOSUPPORT would mean some other protocol had registered the # type, which is still not a port defect but is worth seeing. case "$V_k_sctp_seqpacket_raw" in open) bst_ok lksctp-tools/sctp-socket-seqpacket ;; *ESOCKTNOSUPPORT*) bst_notok lksctp-tools/sctp-socket-seqpacket \ "$ATTRIB: socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP) returns ESOCKTNOSUPPORT ($V_k_sctp_seqpacket_raw), not EPROTONOSUPPORT, because inetsw[SOCK_SEQPACKET] is EMPTY -- SCTP is its only registrant in the tree, so inet_create() never reaches the per-protocol check. The same missing CONFIG_IP_SCTP as the stream case, refused one step earlier; not an lksctp-tools defect" ;; *EPROTONOSUPPORT*) bst_notok lksctp-tools/sctp-socket-seqpacket \ "$ATTRIB: socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP) returns EPROTONOSUPPORT ($V_k_sctp_seqpacket_raw) -- so something now registers inetsw[SOCK_SEQPACKET] and it is not SCTP. Still the same kernel gap, not a port defect, but worth reading: this kernel differs from the one measured on 2026-08-18" ;; '') bst_notok lksctp-tools/sctp-socket-seqpacket "the one-to-many socket produced no line in the probe output -- the probe did not reach it" ;; *) bst_notok lksctp-tools/sctp-socket-seqpacket "socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP) failed in an unexpected way: '$V_k_sctp_seqpacket_raw' -- this is NOT the known platform gap and should be read as a port defect" ;; esac # --- the ticket's stated self-test ------------------------------------------- # An association that was never established produces no payload, no stream # number and no association state, and an UNEXECUTED COMPARISON HAS NO VERDICT # -- so these are `skip` with the reason rather than `ok` or `not ok`. They start # asserting correctness with no edit to this file on the first image whose # kernel registers SCTP, which is the point of shipping them now. Verified # end-to-end on x86-64 against a real SCTP kernel, where this same probe reports # payload_match=match, stream=3 and ppid=6c6b7370. score_rt() { _case=$1; _val=$2; _want=$3; _what=$4 if [ -z "$_val" ]; then bst_skip "$_case" "$_what never ran -- no SCTP association could be established ($ATTRIB)" elif [ "$_val" = "$_want" ]; then bst_ok "$_case" else bst_notok "$_case" "$_what: got '$_val', want '$_want'" fi } score_rt lksctp-tools/rt-bindx "$V_k_rt_bindx" "ok" "sctp_bindx on the listening socket" score_rt lksctp-tools/rt-connect "$V_k_rt_connect" "ok" "the one-to-one connect" score_rt lksctp-tools/rt-accept "$V_k_rt_accept" "ok" "accept of the association" score_rt lksctp-tools/rt-payload "$V_k_rt_payload_match" "match" "the sctp_sendmsg/sctp_recvmsg payload" score_rt lksctp-tools/rt-stream "$V_k_rt_stream_match" "match" "the stream number the message arrived on" score_rt lksctp-tools/rt-ppid "$V_k_rt_ppid" "$WANT_PPID" "the payload protocol identifier" score_rt lksctp-tools/rt-opt-info "$V_k_rt_opt_info" "ok" "sctp_opt_info(SCTP_STATUS) on the association" # sctp_sendmsg/sctp_recvmsg must move exactly the fixture's length. Scored # apart from the payload comparison: a short read and a corrupted read are # different defects. _want_len=$(printf '%s' "$WANT_MSG" | wc -c | tr -d ' ') score_rt lksctp-tools/rt-sendmsg-len "$V_k_rt_sendmsg" "$_want_len" "sctp_sendmsg's byte count" score_rt lksctp-tools/rt-recvmsg-len "$V_k_rt_recvmsg" "$_want_len" "sctp_recvmsg's byte count" # The address-list entry points marshal a kernel reply into a malloc'd array. # The COUNT is host-dependent (it is however many addresses the guest has), so # assert only that the call succeeded and returned at least one. for a in getladdrs getpaddrs; do eval "v=\$V_k_rt_$a" if [ -z "$v" ]; then bst_skip "lksctp-tools/rt-$a" "sctp_$a never ran -- no SCTP association could be established ($ATTRIB)" else case "$v" in ''|*[!0-9]*) bst_notok "lksctp-tools/rt-$a" "sctp_$a failed: $v" ;; 0) bst_notok "lksctp-tools/rt-$a" "sctp_$a returned 0 addresses on an established association" ;; *) bst_ok "lksctp-tools/rt-$a" ;; esac fi done rm -f "$pout"