gdp / apps / rest-test / README @ master
History | View | Annotate | Download (3.05 KB)
1 | 04ad7859 | Rick Pratt | To run the *.js tests: |
---|---|---|---|
2 | ---------------------- |
||
3 | 543e9f25 | Siqi Lin | |
4 | Copy all the .js and .html files to the root directory of your webserver |
||
5 | Configure SCGI and gdp-rest |
||
6 | |||
7 | TODO: |
||
8 | |||
9 | Allow running tests without user interaction |
||
10 | 04ad7859 | Rick Pratt | |
11 | To run the the gdp-rest-testcases.py tests: |
||
12 | ------------------------------------------- |
||
13 | |||
14 | # The gdp-rest-01.eecs.berkeley.edu host is servicing real GDP |
||
15 | # requests on the /gdp/v1/gcl URI using installed gdp binaries, but |
||
16 | # also supports development work. HTTP requests on the /gdp/v2/gcl URI |
||
17 | # are directed to development binaries in a developer's git workspace, |
||
18 | # when properly configured to do so (see below). |
||
19 | |||
20 | # The gdp-rest-01.eecs.berkeley.edu host is not serving as a permanent |
||
21 | a555e771 | Rick Pratt | # home for GCLs. For development and test purposes, gdplogd2 is |
22 | # started before the test suite is run, but is always stopped at the |
||
23 | # end of each test run, after which all GCLs are cleaned off |
||
24 | # gdp-rest-01! Since active keys will be on gdp-rest-01 permanently, |
||
25 | # care should be taken to only clean up test keys! Note that the |
||
26 | # gdp-rest-01 gdplogd2-wrapper.sh script has been customized such that |
||
27 | # gdplogd2 prefers connecting to gdp-01, causing RESTful unit tests to |
||
28 | # travel from gdp-rest-01 out through the first default router |
||
29 | # (usually gdp-03), then through gdp-01, before reaching gdp-rest-01's |
||
30 | # gdplogd2 test instance. |
||
31 | 04ad7859 | Rick Pratt | |
32 | # |
||
33 | # gdp-rest-01 development testbed |
||
34 | # |
||
35 | |||
36 | # if the following file already exists, then simply edit to suit instead! |
||
37 | $ cp /usr/sbin/gdp-rest-wrapper.sh /usr/sbin/gdp-rest-wrapper-v2.sh |
||
38 | $ diff /usr/sbin/gdp-rest-wrapper.sh /usr/sbin/gdp-rest-wrapper-v2.sh |
||
39 | 12,14c12,14 |
||
40 | < : ${GDP_REST_ARGS:="-D*=10"} |
||
41 | < : ${GDP_REST_BIN:=$GDP_ROOT/sbin/gdp-rest} |
||
42 | < : ${GDP_REST_LOG:=$GDP_LOG_DIR/gdp-rest.log} |
||
43 | --- |
||
44 | > : ${GDP_REST_ARGS:="-D*=10 -p 8002 -u /gdp/v2"} |
||
45 | > : ${GDP_REST_BIN:=/home/rpratt/src-signpost/gdp/apps/gdp-rest} |
||
46 | > : ${GDP_REST_LOG:=$GDP_LOG_DIR/gdp-rest-v2.log} |
||
47 | $ |
||
48 | |||
49 | $ cd /etc/systemd/system |
||
50 | # if the following file already exists, no need to revise it. |
||
51 | $ cp gdp-rest.service gdp-rest-v2.service |
||
52 | $ diff gdp-rest.service gdp-rest-v2.service |
||
53 | 13c13 |
||
54 | < ExecStart=/bin/sh /usr/sbin/gdp-rest-wrapper.sh |
||
55 | --- |
||
56 | > ExecStart=/bin/sh /usr/sbin/gdp-rest-wrapper-v2.sh |
||
57 | 18c18 |
||
58 | < SyslogIdentifier=gdp-rest |
||
59 | --- |
||
60 | > SyslogIdentifier=gdp-rest-v2 |
||
61 | $ |
||
62 | |||
63 | # The following are already configured properly (docs on redmine, if needed): |
||
64 | # |
||
65 | # /etc/lighttpd/lighttpd.conf |
||
66 | # /etc/lighttpd/conf-enabled/10-scgi.conf |
||
67 | # |
||
68 | |||
69 | $ systemctl enable gdp-rest-v2.service |
||
70 | $ systemctl start gdp-rest-v2.service |
||
71 | $ systemctl restart lighttpd |
||
72 | |||
73 | # Edit gdp-rest-testcases.py (see "test_auth" section) and |
||
74 | # /etc/lighttpd/.plainauth to suit development needs. |
||
75 | |||
76 | # Run the testcases to verify development work |
||
77 | $ ./gdp-rest-testcases.py |
||
78 | |||
79 | # lather, rinse, repeat! ;) |
||
80 | |||
81 | # when done with development: |
||
82 | # |
||
83 | a555e771 | Rick Pratt | # 1) do not commit your edited test_auth username,password to the test script! |
84 | # 2) remove any temporarily added test_auth entry from /etc/lighttpd/.plainauth |
||
85 | 04ad7859 | Rick Pratt | # 3) disable /gdp/v2/gcl (sudo systemctl disable --now gdp-rest-v2.service) |
86 | # 4) restart lighttpd (sudo systemctl restart lighttpd.service) |
||
87 | # |
||
88 | # leave everything else in place for the next RESTful todo item... |
||
89 | # |