From aaf21f1f994e7abf518d5f895d2f06537185b6d7 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Tue, 1 Oct 2019 20:25:19 -0700 Subject: [PATCH] ph: port all azimuth tests to imps --- pkg/arvo/imp/ph/breach-hi-cousin.hoon | 22 ++++++++++++++++++++++ pkg/arvo/imp/ph/breach-hi.hoon | 18 ++++++++++++++++++ pkg/arvo/imp/ph/breach-multiple.hoon | 22 ++++++++++++++++++++++ pkg/arvo/imp/ph/breach-sudden.hoon | 21 +++++++++++++++++++++ pkg/arvo/imp/ph/breach-sync.hoon | 21 +++++++++++++++++++++ pkg/arvo/imp/ph/hi-az.hoon | 14 ++++++++++++++ pkg/arvo/imp/ph/moon-az.hoon | 22 ++++++++++++++++++++++ pkg/arvo/lib/ph/io.hoon | 24 ++++++++++++++++++++++++ 8 files changed, 164 insertions(+) create mode 100644 pkg/arvo/imp/ph/breach-hi-cousin.hoon create mode 100644 pkg/arvo/imp/ph/breach-hi.hoon create mode 100644 pkg/arvo/imp/ph/breach-multiple.hoon create mode 100644 pkg/arvo/imp/ph/breach-sudden.hoon create mode 100644 pkg/arvo/imp/ph/breach-sync.hoon create mode 100644 pkg/arvo/imp/ph/hi-az.hoon create mode 100644 pkg/arvo/imp/ph/moon-az.hoon diff --git a/pkg/arvo/imp/ph/breach-hi-cousin.hoon b/pkg/arvo/imp/ph/breach-hi-cousin.hoon new file mode 100644 index 000000000..7b923867e --- /dev/null +++ b/pkg/arvo/imp/ph/breach-hi-cousin.hoon @@ -0,0 +1,22 @@ +/- spider +/+ ph-io +=, thread=thread:spider +^- imp:spider +|= =bowl:mall +=/ m (thread ,~) +;< ~ bind:m start-azimuth:ph-io +;< ~ bind:m (spawn:ph-io ~bud) +;< ~ bind:m (spawn:ph-io ~dev) +;< ~ bind:m (spawn:ph-io ~marbud) +;< ~ bind:m (spawn:ph-io ~mardev) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (real-ship:ph-io ~dev) +;< ~ bind:m (real-ship:ph-io ~marbud) +;< ~ bind:m (real-ship:ph-io ~mardev) +;< ~ bind:m (send-hi:ph-io ~marbud ~mardev) +;< ~ bind:m (breach-and-hear:ph-io ~mardev ~marbud) +;< ~ bind:m (send-hi-not-responding:ph-io ~marbud ~mardev) +;< ~ bind:m (real-ship:ph-io ~mardev) +;< ~ bind:m (wait-for-output:ph-io ~marbud "hi ~mardev successful") +;< ~ bind:m end-azimuth:ph-io +(pure:m ~) diff --git a/pkg/arvo/imp/ph/breach-hi.hoon b/pkg/arvo/imp/ph/breach-hi.hoon new file mode 100644 index 000000000..354cec0fa --- /dev/null +++ b/pkg/arvo/imp/ph/breach-hi.hoon @@ -0,0 +1,18 @@ +/- spider +/+ ph-io +=, thread=thread:spider +^- imp:spider +|= =bowl:mall +=/ m (thread ,~) +;< ~ bind:m start-azimuth:ph-io +;< ~ bind:m (spawn:ph-io ~bud) +;< ~ bind:m (spawn:ph-io ~dev) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (real-ship:ph-io ~dev) +;< ~ bind:m (send-hi:ph-io ~bud ~dev) +;< ~ bind:m (breach-and-hear:ph-io ~dev ~bud) +;< ~ bind:m (send-hi-not-responding:ph-io ~bud ~dev) +;< ~ bind:m (real-ship:ph-io ~dev) +;< ~ bind:m (wait-for-output:ph-io ~bud "hi ~dev successful") +;< ~ bind:m end-azimuth:ph-io +(pure:m ~) diff --git a/pkg/arvo/imp/ph/breach-multiple.hoon b/pkg/arvo/imp/ph/breach-multiple.hoon new file mode 100644 index 000000000..16cf91657 --- /dev/null +++ b/pkg/arvo/imp/ph/breach-multiple.hoon @@ -0,0 +1,22 @@ +/- spider +/+ ph-io +=, thread=thread:spider +^- imp:spider +|= =bowl:mall +=/ m (thread ,~) +;< ~ bind:m start-azimuth:ph-io +;< ~ bind:m (spawn:ph-io ~bud) +;< ~ bind:m (spawn:ph-io ~marbud) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (real-ship:ph-io ~marbud) +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< ~ bind:m (check-file-touched:ph-io ~marbud %home file) +;< ~ bind:m (breach-and-hear:ph-io ~bud ~marbud) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (breach-and-hear:ph-io ~marbud ~bud) +;< ~ bind:m (real-ship:ph-io ~marbud) +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< ~ bind:m (check-file-touched:ph-io ~marbud %home file) +;< ~ bind:m end-azimuth:ph-io +(pure:m ~) diff --git a/pkg/arvo/imp/ph/breach-sudden.hoon b/pkg/arvo/imp/ph/breach-sudden.hoon new file mode 100644 index 000000000..a0173f468 --- /dev/null +++ b/pkg/arvo/imp/ph/breach-sudden.hoon @@ -0,0 +1,21 @@ +/- spider +/+ ph-io +=, thread=thread:spider +^- imp:spider +|= =bowl:mall +=/ m (thread ,~) +;< ~ bind:m start-azimuth:ph-io +;< ~ bind:m (spawn:ph-io ~bud) +;< ~ bind:m (spawn:ph-io ~marbud) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (real-ship:ph-io ~marbud) +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< ~ bind:m (check-file-touched:ph-io ~marbud %home file) +;< ~ bind:m (breach:ph-io ~bud) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (dojo:ph-io ~bud "|merge %base ~marbud %kids, =gem %this") +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< ~ bind:m (check-file-touched:ph-io ~marbud %home file) +;< ~ bind:m end-azimuth:ph-io +(pure:m ~) diff --git a/pkg/arvo/imp/ph/breach-sync.hoon b/pkg/arvo/imp/ph/breach-sync.hoon new file mode 100644 index 000000000..54d771cb7 --- /dev/null +++ b/pkg/arvo/imp/ph/breach-sync.hoon @@ -0,0 +1,21 @@ +/- spider +/+ ph-io +=, thread=thread:spider +^- imp:spider +|= =bowl:mall +=/ m (thread ,~) +;< ~ bind:m start-azimuth:ph-io +;< ~ bind:m (spawn:ph-io ~bud) +;< ~ bind:m (spawn:ph-io ~marbud) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (real-ship:ph-io ~marbud) +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< ~ bind:m (check-file-touched:ph-io ~marbud %home file) +;< ~ bind:m (breach-and-hear:ph-io ~bud ~marbud) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (dojo:ph-io ~bud "|merge %base ~marbud %kids, =gem %this") +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< file=@t bind:m (touch-file:ph-io ~bud %base) +;< ~ bind:m (check-file-touched:ph-io ~marbud %home file) +;< ~ bind:m end-azimuth:ph-io +(pure:m ~) diff --git a/pkg/arvo/imp/ph/hi-az.hoon b/pkg/arvo/imp/ph/hi-az.hoon new file mode 100644 index 000000000..c2cd3f419 --- /dev/null +++ b/pkg/arvo/imp/ph/hi-az.hoon @@ -0,0 +1,14 @@ +/- spider +/+ ph-io +=, thread=thread:spider +^- imp:spider +|= =bowl:mall +=/ m (thread ,~) +;< ~ bind:m start-azimuth:ph-io +;< ~ bind:m (spawn:ph-io ~bud) +;< ~ bind:m (spawn:ph-io ~dev) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (real-ship:ph-io ~dev) +;< ~ bind:m (send-hi:ph-io ~bud ~dev) +;< ~ bind:m end-azimuth:ph-io +(pure:m ~) diff --git a/pkg/arvo/imp/ph/moon-az.hoon b/pkg/arvo/imp/ph/moon-az.hoon new file mode 100644 index 000000000..a8dc9a4b6 --- /dev/null +++ b/pkg/arvo/imp/ph/moon-az.hoon @@ -0,0 +1,22 @@ +/- spider +/+ ph-io +=, thread=thread:spider +^- imp:spider +|= =bowl:mall +=/ m (thread ,~) +;< ~ bind:m start-azimuth:ph-io +;< ~ bind:m (spawn:ph-io ~bud) +;< ~ bind:m (spawn:ph-io ~marbud) +;< ~ bind:m (spawn:ph-io ~linnup-torsyx) +;< ~ bind:m (spawn:ph-io ~dev) +;< ~ bind:m (real-ship:ph-io ~bud) +;< ~ bind:m (real-ship:ph-io ~marbud) +;< ~ bind:m (real-ship:ph-io ~linnup-torsyx) +;< ~ bind:m (real-ship:ph-io ~linnup-torsyx-linnup-torsyx) +;< ~ bind:m (send-hi:ph-io ~bud ~linnup-torsyx-linnup-torsyx) +;< ~ bind:m (send-hi:ph-io ~linnup-torsyx-linnup-torsyx ~marbud) +;< ~ bind:m (real-ship:ph-io ~dev) +;< ~ bind:m (send-hi:ph-io ~linnup-torsyx-linnup-torsyx ~dev) +;< ~ bind:m (send-hi:ph-io ~dev ~linnup-torsyx-linnup-torsyx) +;< ~ bind:m end-azimuth:ph-io +(pure:m ~) diff --git a/pkg/arvo/lib/ph/io.hoon b/pkg/arvo/lib/ph/io.hoon index 75b1f24fb..41bd7cc8c 100644 --- a/pkg/arvo/lib/ph/io.hoon +++ b/pkg/arvo/lib/ph/io.hoon @@ -96,6 +96,22 @@ =/ =vase !>([%aqua-eyre-azimuth %azimuth-command !>([%spawn ship])]) (poke-our %spider %spider-imput vase) :: +++ breach + |= who=ship + =/ m (thread ,~) + ~& > "breaching {}" + =/ =vase + !>([%aqua-eyre-azimuth %azimuth-command !>([%breach who])]) + (poke-our %spider %spider-imput vase) +:: +++ breach-and-hear + |= [who=ship her=ship] + =/ m (thread ,~) + ~& > "breaching {} for {}" + =/ =vase + !>([%aqua-eyre-azimuth %azimuth-command !>([%breach-and-hear who her])]) + (poke-our %spider %spider-imput vase) +:: ++ real-ship |= =ship =/ m (thread ,~) @@ -156,6 +172,14 @@ ;< ~ bind:m (dojo from "|hi {(scow %p to)}") (wait-for-output from "hi {(scow %p to)} successful") :: +:: Send "|hi" and wait for "not responding" message +:: +++ send-hi-not-responding + |= [from=@p to=@p] + =/ m (thread ,~) + ;< ~ bind:m (dojo from "|hi {(scow %p to)}") + (wait-for-output from "{(scow %p to)} not responding still trying") +:: :: Mount a desk. :: ++ mount