~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/test/txnscript.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# See the file LICENSE for redistribution information.
2
 
#
3
 
# Copyright (c) 1996-2002
4
 
#       Sleepycat Software.  All rights reserved.
5
 
#
6
 
# $Id$
7
 
#
8
 
# Txn003 script - outstanding child prepare script
9
 
# Usage: txnscript envcmd dbcmd gidf key data
10
 
# envcmd: command to open env
11
 
# dbfile: name of database file
12
 
# gidf: name of global id file
13
 
# key: key to use
14
 
# data: new data to use
15
 
 
16
 
source ./include.tcl
17
 
source $test_path/test.tcl
18
 
source $test_path/testutils.tcl
19
 
 
20
 
set usage "txnscript envcmd dbfile gidfile key data"
21
 
 
22
 
# Verify usage
23
 
if { $argc != 5 } {
24
 
        puts stderr "FAIL:[timestamp] Usage: $usage"
25
 
        exit
26
 
}
27
 
 
28
 
# Initialize arguments
29
 
set envcmd [ lindex $argv 0 ]
30
 
set dbfile [ lindex $argv 1 ]
31
 
set gidfile [ lindex $argv 2 ]
32
 
set key [ lindex $argv 3 ]
33
 
set data [ lindex $argv 4 ]
34
 
 
35
 
set dbenv [eval $envcmd]
36
 
error_check_good envopen [is_valid_env $dbenv] TRUE
37
 
 
38
 
set usedb 1
39
 
set db [berkdb_open -auto_commit -env $dbenv $dbfile]
40
 
error_check_good dbopen [is_valid_db $db] TRUE
41
 
 
42
 
puts "\tTxnscript.a: begin parent and child txn"
43
 
set parent [$dbenv txn]
44
 
error_check_good parent [is_valid_txn $parent $dbenv] TRUE
45
 
set child [$dbenv txn -parent $parent]
46
 
error_check_good parent [is_valid_txn $child $dbenv] TRUE
47
 
 
48
 
puts "\tTxnscript.b: Modify data"
49
 
error_check_good db_put [$db put -txn $child $key $data] 0
50
 
 
51
 
set gfd [open $gidfile w+]
52
 
set gid [make_gid txnscript:$parent]
53
 
puts $gfd $gid
54
 
puts "\tTxnscript.c: Prepare parent only"
55
 
error_check_good txn_prepare:$parent [$parent prepare $gid] 0
56
 
close $gfd
57
 
 
58
 
puts "\tTxnscript.d: Check child handle"
59
 
set stat [catch {$child abort} ret]
60
 
error_check_good child_handle $stat 1
61
 
error_check_good child_h2 [is_substr $ret "invalid command name"] 1
62
 
 
63
 
#
64
 
# We do not close the db or env, but exit with the txns outstanding.
65
 
#
66
 
puts "\tTxnscript completed successfully"
67
 
flush stdout