monotone

monotone Mtn Source Tree

Root/tests/t_genkey.at

1# -*- Autoconf -*-
2
3AT_SETUP([generating and extracting keys and certs])
4
5MONOTONE_SETUP
6
7TKEY=happy@bogus.com
8
9# generate a new key
10AT_CHECK(MONOTONE genkey $TKEY, [], [ignore], [ignore])
11
12# check key exists
13AT_CHECK(MONOTONE ls keys, [], [stdout])
14AT_CHECK(grep $TKEY stdout, [], [ignore])
15
16# check globbing on name works
17AT_CHECK(MONOTONE ls keys happy\*, [], [stdout])
18AT_CHECK(grep $TKEY stdout, [], [ignore])
19
20# check globbing on bogus name misses key
21AT_CHECK(MONOTONE ls keys burp\*, [], [stdout], [ignore])
22AT_CHECK(grep $TKEY stdout, [1], [])
23
24
25# second section, check making certs with this key
26
27AT_DATA(input.txt, [blah blah blah
28])
29
30TSHA=`SHA1(input.txt)`
31AT_CHECK(MONOTONE add input.txt, [], [ignore], [ignore])
32AT_CHECK(MONOTONE --branch=testbranch commit 'blah blah', [], [ignore], [ignore])
33AT_CHECK(MONOTONE --key=$TKEY cert file $TSHA color pink, [], [ignore], [ignore])
34AT_CHECK(MONOTONE ls certs file $TSHA, [], [stdout])
35AT_CHECK(grep pink stdout, [], [ignore])
36
37AT_DATA(cert-data, [yellow
38])
39AT_CHECK(MONOTONE --key=$TKEY cert file $TSHA color < cert-data, [], [ignore], [ignore])
40AT_CHECK(MONOTONE ls certs file $TSHA, [], [stdout], [ignore])
41AT_CHECK(grep pink stdout, [], [ignore])
42AT_CHECK(grep yellow stdout, [], [ignore])
43
44AT_CLEANUP

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status