mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
channels: Fix test for introductory commit signer.
Until now the test would always succeed because it would return 'failed, which has truth value. The exercise 'verify-introductory-commit', we need to add a second commit beyond the introductory commit, which is what we do here. * tests/channels.scm ("authenticate-channel, wrong first commit signer"): Add a second commit and authenticate up to that one. Change 'message?' to 'message-condition?'.
This commit is contained in:
parent
1ad332b367
commit
a18d02def9
1 changed files with 8 additions and 3 deletions
|
@ -403,7 +403,8 @@ (define (find-commit* message)
|
||||||
'(#f "tag-for-first-news-entry")))))))
|
'(#f "tag-for-first-news-entry")))))))
|
||||||
|
|
||||||
(unless (gpg+git-available?) (test-skip 1))
|
(unless (gpg+git-available?) (test-skip 1))
|
||||||
(test-assert "authenticate-channel, wrong first commit signer"
|
(test-equal "authenticate-channel, wrong first commit signer"
|
||||||
|
#t
|
||||||
(with-fresh-gnupg-setup (list %ed25519-public-key-file
|
(with-fresh-gnupg-setup (list %ed25519-public-key-file
|
||||||
%ed25519-secret-key-file
|
%ed25519-secret-key-file
|
||||||
%ed25519bis-public-key-file
|
%ed25519bis-public-key-file
|
||||||
|
@ -422,9 +423,13 @@ (define (find-commit* message)
|
||||||
(add "signer.key" ,(call-with-input-file %ed25519-public-key-file
|
(add "signer.key" ,(call-with-input-file %ed25519-public-key-file
|
||||||
get-string-all))
|
get-string-all))
|
||||||
(commit "first commit"
|
(commit "first commit"
|
||||||
|
(signer ,(key-fingerprint %ed25519-public-key-file)))
|
||||||
|
(add "random" ,(random-text))
|
||||||
|
(commit "second commit"
|
||||||
(signer ,(key-fingerprint %ed25519-public-key-file))))
|
(signer ,(key-fingerprint %ed25519-public-key-file))))
|
||||||
(with-repository directory repository
|
(with-repository directory repository
|
||||||
(let* ((commit1 (find-commit repository "first"))
|
(let* ((commit1 (find-commit repository "first"))
|
||||||
|
(commit2 (find-commit repository "second"))
|
||||||
(intro ((@@ (guix channels) make-channel-introduction)
|
(intro ((@@ (guix channels) make-channel-introduction)
|
||||||
(commit-id-string commit1)
|
(commit-id-string commit1)
|
||||||
(openpgp-public-key-fingerprint
|
(openpgp-public-key-fingerprint
|
||||||
|
@ -434,11 +439,11 @@ (define (find-commit* message)
|
||||||
(channel (channel (name 'example)
|
(channel (channel (name 'example)
|
||||||
(url (string-append "file://" directory))
|
(url (string-append "file://" directory))
|
||||||
(introduction intro))))
|
(introduction intro))))
|
||||||
(guard (c ((message? c)
|
(guard (c ((message-condition? c)
|
||||||
(->bool (string-contains (condition-message c)
|
(->bool (string-contains (condition-message c)
|
||||||
"initial commit"))))
|
"initial commit"))))
|
||||||
(authenticate-channel channel directory
|
(authenticate-channel channel directory
|
||||||
(commit-id-string commit1)
|
(commit-id-string commit2)
|
||||||
#:keyring-reference-prefix "")
|
#:keyring-reference-prefix "")
|
||||||
'failed))))))
|
'failed))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue