gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] branch master updated: tests/file-sharing: Test response


From: gnunet
Subject: [gnunet-scheme] branch master updated: tests/file-sharing: Test response-loc-signature round-tripping.
Date: Sun, 02 Jul 2023 20:23:36 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

The following commit(s) were added to refs/heads/master by this push:
     new 058ac50  tests/file-sharing: Test response-loc-signature 
round-tripping.
058ac50 is described below

commit 058ac504c53a5128cddbc07ec6b93e367d720ba7
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Jul 2 20:21:26 2023 +0200

    tests/file-sharing: Test response-loc-signature round-tripping.
    
    * tests/file-sharing.scm
    (construct-response-loc-signature*,$peer-identity,$signature): New 
variables.
    ("analyse + construct round-trips (response-loc-signature)"): New test.
---
 tests/file-sharing.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/file-sharing.scm b/tests/file-sharing.scm
index fc3839e..ad3e4a4 100644
--- a/tests/file-sharing.scm
+++ b/tests/file-sharing.scm
@@ -1,5 +1,5 @@
 ;; This file is part of scheme-GNUnet, a partial Scheme port of GNUnet.
-;; Copyright © 2022 GNUnet e.V.
+;; Copyright © 2022, 2023 GNUnet e.V.
 ;;
 ;; scheme-GNUnet is free software: you can redistribute it and/or modify it
 ;; under the terms of the GNU Affero General Public License as published
@@ -18,11 +18,14 @@
 (define-module (test-file-sharing))
 (import (gnu gnunet fs client)
        (srfi srfi-64)
+       (gnu gnunet crypto struct)
        (gnu gnunet fs client)
        (gnu gnunet fs network)
        (gnu gnunet fs quickcheck)
        (gnu gnunet fs uri)
        (gnu gnunet hashcode)
+       (gnu gnunet utils bv-slice-quickcheck)
+       (gnu gnunet netstruct syntactic)
        (quickcheck arbitrary)
        (ice-9 match)
        (tests utils))
@@ -42,10 +45,17 @@
 (define (construct-request-loc-signature* x y z w)
   (construct-request-loc-signature x y z #:purpose w))
 
+(define (construct-response-loc-signature* x y z w)
+  (construct-response-loc-signature x y z #:purpose w))
+
 ;; Network messages
 (define $file-length $natural) ; TODO bounds
 (define $purpose $natural) ; TODO bounds
 (define $expiration-time $natural) ; TODO bounds
+(define $peer-identity
+  ($sized-bytevector-slice/read-write (sizeof /peer-identity '())))
+(define $signature
+  ($sized-bytevector-slice/read-write (sizeof /eddsa-signature '())))
 
 (test-roundtrip "analyse + construct round-trips (request-loc-signature)"
                analyse-request-loc-signature construct-request-loc-signature*
@@ -55,6 +65,14 @@
                (expiration-time $expiration-time)
                (purpose $purpose))
 
+(test-roundtrip "analyse + construct round-trips (response-loc-signature)"
+               analyse-response-loc-signature construct-response-loc-signature*
+               normalise
+               (expiration-time $expiration-time)
+               (signature $signature)
+               (peer-identity $peer-identity)
+               (purpose $purpose))
+
 
 ;; Standard service tests
 (test-assert "close, not connected --> all fibers stop, no callbacks called"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]