From d969662c35fee0bebce8cae285750e0c8848713e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 22 Aug 2026 08:38:35 +0200 Subject: Test: include identity ref in local-identity events --- main/Test.hs | 2 +- test/attach.et | 6 +++--- test/contact.et | 6 ++++-- test/storage.et | 10 +++++----- test/sync.et | 12 +++++++----- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/main/Test.hs b/main/Test.hs index b06ed61..84cce1a 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -856,7 +856,7 @@ cmdWatchLocalIdentity = do out <- asks tiOutput w <- liftIO $ watchHeadWith h headLocalIdentity $ \idt -> do - outLine out $ unwords $ "local-identity" : map (maybe "" T.unpack . idName) (unfoldOwners idt) + outLine out $ unwords $ "local-identity" : show (refDigest $ storedRef $ idExtData idt) : map (maybe "" T.unpack . idName) (unfoldOwners idt) modify $ \s -> s { tsWatchedLocalIdentity = Just w } cmdWatchSharedIdentity :: Command diff --git a/test/attach.et b/test/attach.et index 9163730..f5a6906 100644 --- a/test/attach.et +++ b/test/attach.et @@ -34,11 +34,11 @@ test Attach: send "start-server services $services" to p1 send "start-server services $services" to p2 expect from p1: - /local-identity Device1 Owner/ + /local-identity $refpat Device1 Owner/ /peer 1 addr ${p2.node.ip} 29665/ /peer 1 id Device2/ expect from p2: - /local-identity Device2/ + /local-identity $refpat Device2/ /peer 1 addr ${p1.node.ip} 29665/ /peer 1 id Device1 Owner/ @@ -65,7 +65,7 @@ test Attach: send "attach-accept 1" to p2 expect /attach-request-done 1/ from p1 expect /attach-response-done 1/ from p2 - expect /local-identity Device2 Owner/ from p2 + expect /local-identity $refpat Device2 Owner/ from p2 expect /peer 1 id Device2 Owner/ from p1 diff --git a/test/contact.et b/test/contact.et index 0f967a6..4bb99a4 100644 --- a/test/contact.et +++ b/test/contact.et @@ -1,5 +1,7 @@ module contact +import common + test Contact: let services = "attach,contact,sync" @@ -93,7 +95,7 @@ test Contact: # Attach peer 4 to Owner1 send "watch-local-identity" to p4 - expect /local-identity Device4/ from p4 + expect /local-identity $refpat Device4/ from p4 send "attach-to $peer4_1" to p4 local: @@ -105,7 +107,7 @@ test Contact: send "attach-accept $peer4_1" to p4 expect /attach-request-done $peer1_4/ from p1 expect /attach-response-done $peer4_1/ from p4 - expect /local-identity Device4 Owner1/ from p4 + expect /local-identity $refpat Device4 Owner1/ from p4 expect /peer $peer1_4 id Device4 Owner1/ from p1 expect /peer $peer2_4 id Device4 Owner1/ from p2 expect /peer $peer3_4 id Device4 Owner1/ from p3 diff --git a/test/storage.et b/test/storage.et index ee19e6e..a374bca 100644 --- a/test/storage.et +++ b/test/storage.et @@ -396,11 +396,11 @@ test SharedStateWatcher: send "start-server services $services" to p1 send "start-server services $services" to p2 expect from p1: - /local-identity Device1 Owner/ + /local-identity $refpat Device1 Owner/ /peer 1 addr ${p2.node.ip} 29665/ /peer 1 id Device2/ expect from p2: - /local-identity Device2/ + /local-identity $refpat Device2/ /peer 1 addr ${p1.node.ip} 29665/ /peer 1 id Device1 Owner/ @@ -414,7 +414,7 @@ test SharedStateWatcher: send "attach-accept 1" to p2 expect /attach-request-done 1/ from p1 expect /attach-response-done 1/ from p2 - expect /local-identity Device2 Owner/ from p2 + expect /local-identity $refpat Device2 Owner/ from p2 expect /peer 1 id Device2 Owner/ from p1 for i in [1..5]: @@ -440,7 +440,7 @@ test LocalStateKeepUnknown: with p: send "create-identity Device" send "watch-local-identity" - expect /local-identity Device/ + expect /local-identity $refpat Device/ send "local-state-get" expect /local-state-get ($refpat)/ capture s1 @@ -465,7 +465,7 @@ test LocalStateKeepUnknown: expect /local-state-get $s2/ send "update-local-identity Device2" - expect /local-identity Device2/ + expect /local-identity $refpat Device2/ send "local-state-get" expect /local-state-get ($refpat)/ capture s3 diff --git a/test/sync.et b/test/sync.et index f98b527..be6250d 100644 --- a/test/sync.et +++ b/test/sync.et @@ -1,5 +1,7 @@ module sync +import common + test Sync: let services = "attach,sync" @@ -14,12 +16,12 @@ test Sync: send "start-server services $services" to p1 send "start-server services $services" to p2 expect from p1: - /local-identity Device1 Owner/ + /local-identity $refpat Device1 Owner/ /shared-identity Owner/ /peer 1 addr ${p2.node.ip} 29665/ /peer 1 id Device2/ expect from p2: - /local-identity Device2/ + /local-identity $refpat Device2/ /peer 1 addr ${p1.node.ip} 29665/ /peer 1 id Device1 Owner/ @@ -33,7 +35,7 @@ test Sync: send "attach-accept 1" to p2 expect /attach-request-done 1/ from p1 expect /attach-response-done 1/ from p2 - expect /local-identity Device2 Owner/ from p2 + expect /local-identity $refpat Device2 Owner/ from p2 expect /shared-identity Owner/ from p2 expect /peer 1 id Device2 Owner/ from p1 @@ -66,7 +68,7 @@ test Sync: send "peer-add ${p1.node.ip}" expect: - /local-identity Device3/ + /local-identity $refpat Device3/ /peer 1 addr ${p1.node.ip} 29665/ /peer 1 id Device1 NewOwner3/ @@ -83,7 +85,7 @@ test Sync: send "attach-accept 2" to p1 send "attach-accept 1" to p3 - expect /local-identity Device3 NewOwner3/ from p3 + expect /local-identity $refpat Device3 NewOwner3/ from p3 expect /shared-identity NewOwner3/ from p3 send "update-shared-identity NewOwner4" to p3 -- cgit v1.2.3