1 # See the file LICENSE for redistribution information.
3 # Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
8 # TEST Test the operations on a transaction in a CDS environment.
9 # TEST These are the operations we test:
14 # TEST $txn setname name
17 # TEST $txn set_timeout
18 # TEST In these operations, we only support the following:
26 puts "Env021: Test operations on a transaction in a CDS environment."
29 puts "\tEnv021.$indx: Test DB_ENV->cdsgroup_begin in\
30 an environment without DB_INIT_CDB configured"
31 file mkdir $testdir/envdir$indx
32 set env1 [berkdb_env_noerr -create -home $testdir/envdir$indx \
33 -lock -log -txn -mode 0644]
34 error_check_good is_valid_env [is_valid_env $env1] TRUE
35 set txn1 [catch {eval $env1 cdsgroup} res]
36 error_check_good env_without_cdb [expr \
37 [is_substr $res "requires"] && [is_substr $res "DB_INIT_CDB"]] 1
38 error_check_good env_close [$env1 close] 0
44 {"prepare" "prepare env021gid1" 0}
45 {"setname" "setname env021txn1" 0}
46 {"getname" "getname" 0}
47 {"discard" "discard" 0}
48 {"set_timeout" "set_timeout 1000" 0}
51 foreach param $env021parms {
52 set testname [lindex $param 0]
53 set cmd [lindex $param 1]
54 set success [lindex $param 2]
56 puts "\tEnv021.$indx: Test DB_TXN->$testname"
57 file mkdir $testdir/envdir$indx
58 set env1 [berkdb_env_noerr -create -home $testdir/envdir$indx \
60 error_check_good is_valid_env [is_valid_env $env1] TRUE
61 set txn1 [$env1 cdsgroup]
62 error_check_good is_valid_txn [is_valid_txn $txn1 $env1] TRUE
63 set ret [catch {eval $txn1 $cmd} res]
65 error_check_bad "$txn1 $cmd" \
66 [is_substr $res "CDS groups do not support"] 1
68 error_check_good "$txn1 $cmd" \
69 [is_substr $res "CDS groups do not support"] 1
71 set ret [catch {$txn1 commit} res]
74 txn_commit [is_substr $res "invalid command name"] 1
76 error_check_good env_close [$env1 close] 0