New test.
[mono.git] / mcs / class / Mono.Security / Test / tools / npgsql / README
1 * Setup instructions
2
3
4 1. Download the latest PostgreSQL source and uncompress them.
5
6         http://www.postgresql.org/ftp/source/v8.0.1/
7
8
9 2. Compile PostgreSQL with SSL support.
10
11         ./configure --with-openssl
12         make
13         make install
14
15
16 3. Put your postgresqlprefix/bin and lib in your path.
17
18
19 4. Initialize the database.
20
21         initdb <path to where you want to initialize data>
22
23
24 5. Create the SSL certificate.
25
26    Go to <path to where you want to initialize data> and execute:
27
28         openssl req -new -text -out server.req
29         openssl rsa -in privkey.pem -out server.key
30         rm privkey.pem
31         openssl req -x509 -in server.req -text -key server.key -out server.crt
32         chmod og-rwx server.key
33
34    Reference: http://www.postgresql.org/docs/7.4/static/ssl-tcp.html
35
36
37 6. Start the server
38
39         pg_ctl -o "-i" -D <path to where you want to initialize data> start
40
41
42 7. Create the test database
43
44         createdb npgsql_tests
45
46
47 8. Create npgsql_tests user
48
49         createuser -NP npgsql_tests
50
51    and answer the questions - use npgsql_tests for the password
52
53         Enter password for new user:
54         Enter it again:
55         Shall the new user be allowed to create databases? (y/n) y
56         Shall the new user be allowed to create more new users? (y/n) y
57         CREATE USER
58
59 8. Run the script to create some data.
60
61         sh makewords.sh 338
62
63    This will insert 338 rows to a table called wordlist created by script
64    above.
65
66
67 9. Compile the test tool (npdbtest.cs)
68
69         make
70
71
72 * Notes
73
74 Many thanks to Francisco Figueiredo Jr. to have supplied me the instructions
75 and the original sample code.