chiark / gitweb /
test: Send initial confirmation byte, and wait for some rx
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 11 Oct 2019 19:09:29 +0000 (20:09 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 12 Oct 2019 22:29:26 +0000 (23:29 +0100)
Now this hangs indefinitely because we don't send a packet.  That
comes next.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
test/invoke

index 2f8835e7742c9119adebf63fdc80c30dabb44f2f..592053243caa036d7110f62f1b7f7522a538ae47 100755 (executable)
@@ -45,6 +45,7 @@ exec <$pipefp.t
 exec 3<&-
 exec cat
 "
+    close $fakeuh
     set cfg "
        netlink userv-ipif {
            name \"netlink\";
@@ -90,6 +91,7 @@ exec cat
 }
 
 proc spawn-secnet {which} {
+    global netlinkfh
     upvar #0 pids($which) pid
     set cf test/$which.conf
     set ch [open $cf w]
@@ -100,7 +102,26 @@ proc spawn-secnet {which} {
     if {!$pid} {
        execl ./secnet $argl
     }
+    puts -nonewline $netlinkfh($which.t) "\xc0"
+}
+
+proc netlink-readable {which} {
+    global ok
+    upvar #0 netlinkfh($which.r) fh
+    read $fh; # empty the buffer
+    switch -exact $which {
+       outside {
+           puts OK
+           set ok 1; # what a bodge
+           return
+       }
+       inside {
+           error "inside rx'd!"
+       }
+    }
 }
 
 spawn-secnet inside
 spawn-secnet outside
+
+vwait ok