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

« back to all changes in this revision

Viewing changes to libdb/test/env004.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
 
# TEST  env004
9
 
# TEST  Test multiple data directories.  Do a bunch of different opens
10
 
# TEST  to make sure that the files are detected in different directories.
11
 
proc env004 { } {
12
 
        source ./include.tcl
13
 
 
14
 
        set method "hash"
15
 
        set omethod [convert_method $method]
16
 
        set args [convert_args $method ""]
17
 
 
18
 
        puts "Env004: Multiple data directory test."
19
 
 
20
 
        env_cleanup $testdir
21
 
        file mkdir $testdir/data1
22
 
        file mkdir $testdir/data2
23
 
        file mkdir $testdir/data3
24
 
 
25
 
        puts "\tEnv004.a: Multiple data directories in DB_CONFIG file"
26
 
 
27
 
        # Create a config file
28
 
        set cid [open $testdir/DB_CONFIG w]
29
 
        puts $cid "set_data_dir ."
30
 
        puts $cid "set_data_dir data1"
31
 
        puts $cid "set_data_dir data2"
32
 
        puts $cid "set_data_dir data3"
33
 
        close $cid
34
 
 
35
 
        # Now get pathnames
36
 
        set curdir [pwd]
37
 
        cd $testdir
38
 
        set fulldir [pwd]
39
 
        cd $curdir
40
 
 
41
 
        set e [berkdb_env -create -private -home $testdir]
42
 
        error_check_good dbenv [is_valid_env $e] TRUE
43
 
        ddir_test $fulldir $method $e $args
44
 
        error_check_good env_close [$e close] 0
45
 
 
46
 
        puts "\tEnv004.b: Multiple data directories in berkdb_env call."
47
 
        env_cleanup $testdir
48
 
        file mkdir $testdir/data1
49
 
        file mkdir $testdir/data2
50
 
        file mkdir $testdir/data3
51
 
 
52
 
        # Now call dbenv with config specified
53
 
        set e [berkdb_env -create -private \
54
 
            -data_dir . -data_dir data1 -data_dir data2 \
55
 
            -data_dir data3 -home $testdir]
56
 
        error_check_good dbenv [is_valid_env $e] TRUE
57
 
        ddir_test $fulldir $method $e $args
58
 
        error_check_good env_close [$e close] 0
59
 
 
60
 
        env_cleanup $testdir
61
 
}
62
 
 
63
 
proc ddir_test { fulldir method e args } {
64
 
        source ./include.tcl
65
 
 
66
 
        set args [convert_args $args]
67
 
        set omethod [convert_method $method]
68
 
 
69
 
        # Now create one file in each directory
70
 
        set db1 [eval {berkdb_open -create \
71
 
            -truncate -mode 0644 $omethod -env $e} $args {data1/datafile1.db}]
72
 
        error_check_good dbopen1 [is_valid_db $db1] TRUE
73
 
 
74
 
        set db2 [eval {berkdb_open -create \
75
 
            -truncate -mode 0644 $omethod -env $e} $args {data2/datafile2.db}]
76
 
        error_check_good dbopen2 [is_valid_db $db2] TRUE
77
 
 
78
 
        set db3 [eval {berkdb_open -create \
79
 
            -truncate -mode 0644 $omethod -env $e} $args {data3/datafile3.db}]
80
 
        error_check_good dbopen3 [is_valid_db $db3] TRUE
81
 
 
82
 
        # Close the files
83
 
        error_check_good db_close1 [$db1 close] 0
84
 
        error_check_good db_close2 [$db2 close] 0
85
 
        error_check_good db_close3 [$db3 close] 0
86
 
 
87
 
        # Now, reopen the files without complete pathnames and make
88
 
        # sure that we find them.
89
 
 
90
 
        set db1 [berkdb_open -env $e $fulldir/data1/datafile1.db]
91
 
        error_check_good dbopen1 [is_valid_db $db1] TRUE
92
 
 
93
 
        set db2 [berkdb_open -env $e $fulldir/data2/datafile2.db]
94
 
        error_check_good dbopen2 [is_valid_db $db2] TRUE
95
 
 
96
 
        set db3 [berkdb_open -env $e $fulldir/data3/datafile3.db]
97
 
        error_check_good dbopen3 [is_valid_db $db3] TRUE
98
 
 
99
 
        # Finally close all the files
100
 
        error_check_good db_close1 [$db1 close] 0
101
 
        error_check_good db_close2 [$db2 close] 0
102
 
        error_check_good db_close3 [$db3 close] 0
103
 
}