summaryrefslogtreecommitdiff
path: root/guile/email-key-rotation/tests.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guile/email-key-rotation/tests.scm')
-rw-r--r--guile/email-key-rotation/tests.scm56
1 files changed, 31 insertions, 25 deletions
diff --git a/guile/email-key-rotation/tests.scm b/guile/email-key-rotation/tests.scm
index f4eedd7..12dc729 100644
--- a/guile/email-key-rotation/tests.scm
+++ b/guile/email-key-rotation/tests.scm
@@ -7,6 +7,7 @@
#:use-module (ice-9 textual-ports)
#:use-module (ice-9 optargs)
#:use-module (ice-9 exceptions)
+ #:use-module (ice-9 i18n)
#:use-module (srfi srfi-26)
#:use-module (rnrs bytevectors)
#:use-module (sxml simple)
@@ -15,6 +16,8 @@
#:export (run-tests)
#:declarative? #t)
+(define (G_ msg) (gettext msg "email-key-rotation"))
+
(define (reload config)
(let* ((sxml (configuration->sxml config))
(xml (call-with-output-string
@@ -30,7 +33,7 @@
(make-exception-with-origin 'reload)
(make-exception-with-irritants (list config xml config-back))
(make-exception-with-message
- "cannot serialize and deserialize the configuration"))))
+ (G_ "cannot serialize and deserialize the configuration")))))
config-back))
(define (run-tests)
@@ -41,7 +44,7 @@
(make-error)
(make-exception-with-origin 'run-tests)
(make-exception-with-message
- "the tests failed:")
+ (G_ "the tests failed:"))
exn)))
(lambda ()
;; The process is:
@@ -57,7 +60,7 @@
(raise-exception
(make-exception
(make-exception-with-message
- "during the initialization phase:")
+ (G_ "during the initialization phase:"))
exn)))
(lambda ()
(set! current-config
@@ -92,18 +95,19 @@ Change \"dkimB._domainkey\" TXT record to value \"v=DKIM1; k=rsa; t=s; p=deleted
(make-exception-with-irritants
(list materialize-log-0 expected-log-0))
(make-exception-with-message
- "incorrect gandi livedns requests."))))
+ (G_ "incorrect gandi livedns requests.")))))
(unless (equal?
(call-with-input-file "srs-secrets.conf" get-string-all)
- "# GENERATED AUTOMATICALLY, DO NOT EDIT!\n
-srs key \"hexdatawithseed0\"\n")
+ (string-append
+ (G_ "# GENERATED AUTOMATICALLY, DO NOT EDIT!\n")
+ "srs key \"hexdatawithseed0\"\n"))
(raise-exception
(make-exception
(make-error)
(make-exception-with-irritants
(list "srs-secrets.conf"))
(make-exception-with-message
- "incorrect srs-secrets.conf content."))))
+ (G_ "incorrect srs-secrets.conf content.")))))
(unless (equal?
(call-with-input-file "current-dkim-selector.txt"
read-line)
@@ -114,7 +118,7 @@ srs key \"hexdatawithseed0\"\n")
(make-exception-with-irritants
(list "current-dkim-selector.txt"))
(make-exception-with-message
- "incorrect current-dkim-selector.txt content."))))
+ (G_ "incorrect current-dkim-selector.txt content.")))))
(unless (equal?
(call-with-input-file "current-dkim-key.key"
get-string-all)
@@ -125,13 +129,13 @@ srs key \"hexdatawithseed0\"\n")
(make-exception-with-irritants
(list "current-dkim-key.key"))
(make-exception-with-message
- "incorrect current-dkim-key.key content.")))))))
+ (G_ "incorrect current-dkim-key.key content."))))))))
(with-exception-handler
(lambda (exn)
(raise-exception
(make-exception
(make-exception-with-message
- "during the first rotation:")
+ (G_ "during the first rotation:"))
exn)))
(lambda ()
(set! current-config
@@ -161,19 +165,20 @@ Change \"dkimA._domainkey\" TXT record to value \"v=DKIM1; k=rsa; t=s; p=blah bl
(make-exception-with-irritants
(list materialize-log-1 expected-log-1))
(make-exception-with-message
- "incorrect gandi livedns requests."))))
+ (G_ "incorrect gandi livedns requests.")))))
(unless (equal?
(call-with-input-file "srs-secrets.conf" get-string-all)
- "# GENERATED AUTOMATICALLY, DO NOT EDIT!\n
-srs key \"hexdatawithseed1\"
-srs key backup \"hexdatawithseed0\"\n")
+ (string-append
+ (G_ "# GENERATED AUTOMATICALLY, DO NOT EDIT!\n")
+ "srs key \"hexdatawithseed1\"
+srs key backup \"hexdatawithseed0\"\n"))
(raise-exception
(make-exception
(make-error)
(make-exception-with-irritants
(list "srs-secrets.conf"))
(make-exception-with-message
- "incorrect srs-secrets.conf content."))))
+ (G_ "incorrect srs-secrets.conf content.")))))
(unless (equal?
(call-with-input-file "current-dkim-selector.txt"
read-line)
@@ -184,7 +189,7 @@ srs key backup \"hexdatawithseed0\"\n")
(make-exception-with-irritants
(list "current-dkim-selector.txt"))
(make-exception-with-message
- "incorrect current-dkim-selector.txt content."))))
+ (G_ "incorrect current-dkim-selector.txt content.")))))
(unless (equal?
(call-with-input-file "current-dkim-key.key"
get-string-all)
@@ -195,13 +200,13 @@ srs key backup \"hexdatawithseed0\"\n")
(make-exception-with-irritants
(list "current-dkim-key.key"))
(make-exception-with-message
- "incorrect current-dkim-key.key content.")))))))
+ (G_ "incorrect current-dkim-key.key content."))))))))
(with-exception-handler
(lambda (exn)
(raise-exception
(make-exception
(make-exception-with-message
- "during the second rotation:")
+ (G_ "during the second rotation:"))
exn)))
(lambda ()
(set! current-config
@@ -231,19 +236,20 @@ Change \"dkimB._domainkey\" TXT record to value \"v=DKIM1; k=rsa; t=s; p=blah bl
(make-exception-with-irritants
(list materialize-log-2 expected-log-2))
(make-exception-with-message
- "incorrect gandi livedns requests."))))
+ (G_ "incorrect gandi livedns requests.")))))
(unless (equal?
(call-with-input-file "srs-secrets.conf" get-string-all)
- "# GENERATED AUTOMATICALLY, DO NOT EDIT!\n
-srs key \"hexdatawithseed2\"
-srs key backup \"hexdatawithseed1\"\n")
+ (string-append
+ (G_ "# GENERATED AUTOMATICALLY, DO NOT EDIT!\n")
+ "srs key \"hexdatawithseed2\"
+srs key backup \"hexdatawithseed1\"\n"))
(raise-exception
(make-exception
(make-error)
(make-exception-with-irritants
(list "srs-secrets.conf"))
(make-exception-with-message
- "incorrect srs-secrets.conf content."))))
+ (G_ "incorrect srs-secrets.conf content.")))))
(unless (equal?
(call-with-input-file "current-dkim-selector.txt"
read-line)
@@ -254,7 +260,7 @@ srs key backup \"hexdatawithseed1\"\n")
(make-exception-with-irritants
(list "current-dkim-selector.txt"))
(make-exception-with-message
- "incorrect current-dkim-selector.txt content."))))
+ (G_ "incorrect current-dkim-selector.txt content.")))))
(unless (equal?
(call-with-input-file "current-dkim-key.key"
get-string-all)
@@ -265,4 +271,4 @@ srs key backup \"hexdatawithseed1\"\n")
(make-exception-with-irritants
(list "current-dkim-key.key"))
(make-exception-with-message
- "incorrect current-dkim-key.key content."))))))))))
+ (G_ "incorrect current-dkim-key.key content.")))))))))))