Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BIBO tests
09-27-2020, 12:15 PM
Post: #11
RE: BIBO tests
(09-26-2020 10:04 PM)zhihao Wrote:  design test_insert.sh:

ret = send insert request zengxingliang.json to trajan.d-thinker.org 20050
if ($ret == 200) {
print insert success

dont use print. Use flog. You can set flog_also_stderr=True to make the message go to stderr when you run it interactively.

Quote: return 0
}
else {
print insert failed
return -1
}
[/code]

RR lingu

OK but dont use -1
Find all posts by this user
Quote this message in a reply
09-27-2020, 12:16 PM
Post: #12
RE: BIBO tests
(09-26-2020 10:14 PM)zhihao Wrote:  design test_inquire.sh:
Code:
ret = send inquire request chendengchang-with-blank-line.json to trajan.d-thinker.org 20050

if ($ret == 200) {
  print "inquire success"
  return 0
}
else {
  print "inquire failed"
  return -1
}

RR lingu

OK but pls parameterize the newcase file and the service point (trajan).
Find all posts by this user
Quote this message in a reply
09-27-2020, 12:20 PM
Post: #13
RE: BIBO tests
(09-27-2020 11:46 AM)zhihao Wrote:  add test_pressure.sh design info:

for (i in 1 to 10) {

parameterize 10. e.g., define a var bibo_test_iter_cnt with a default value 1.

Quote: run test_delete.sh
}
[/code]

RR lingu

Better combine small tests, such as test-delete and test-insert. You can make this a combined test test-id (insert delete). For correctness test, bibo_test_iter_cnt=1. For perf and pressure tests, we can set bibo_test_iter_cnt=10, 100, 1000, ...
Find all posts by this user
Quote this message in a reply
10-07-2020, 09:44 PM
Post: #14
RE: BIBO tests
(09-27-2020 12:00 PM)lingu Wrote:  
(09-26-2020 09:38 PM)zhihao Wrote:  design test_select.sh:

insert_ret = run test_insert.sh

can you just run an insert test here?
OK, I'll delete if-else statement

(09-27-2020 12:00 PM)lingu Wrote:  
Quote:if ($insert_ret != 0)
return $insert_ret

ret = send select request sel_zengxingliang.json to trajan.d-thinker.org 20050

dont hard-code trajan. Use a var.

Can you make a simple select test?
I define a var "server_addr" for trajan like server_addr=trajan.d-thinker.org:20050 for these test scripts
yes, I'll make a simple select test as follows:
test_select.sh
Code:
server_addr=trajan.d-thinker.org:20050
flog_also_stderr=True
ret = send select request sel_zengxingliang.json to $server_addr
if ($ret == 200) {
    flog "select success"
    return 0
}
else {
    flog "select failed"
    return 99
}

(09-27-2020 12:00 PM)lingu Wrote:  
Quote:if ($ret == 200) {
print select success
}
else {
print select failed
return -1
}

del_ret = run test_delete.sh

if ($delete_ret != 0)
return $delete_ret

Can you just invoke the delete test?
OK, I'll delete if-else statement

(09-27-2020 12:00 PM)lingu Wrote:  
Quote:ret = send select request sel_zengxingliang.json to trajan.d-thinker.org 20050
if ($ret == 404) {
print select success
return 0
}
else {
print select failed
return -1
}
[/code]

RR lingu

You can summarize the block above as 'expect 404, otherwise return -1'.

-1 is not a good exit status. Use a specific value, such as 99, to indicate the error.

This seems to be a combined test. You can name it test-isds -- insert, select, delete, select.
OK, exit status will change to 99 and I will correct and rename this combined test script and create a new test_select.sh
test_isds.sh:
Code:
server_addr=trajan.d-thinker.org:20050
./test_insert.sh
./test_select.sh
./test_delete.sh
./test_select.sh
Quote this message in a reply
10-07-2020, 11:01 PM
Post: #15
RE: BIBO tests
(09-27-2020 12:14 PM)lingu Wrote:  
(09-26-2020 09:57 PM)zhihao Wrote:  design test_delete.sh:

insert_ret = run test_insert.sh

if ($insert_ret != 0)
print "insert failed, please try again"
return $insert_ret

I think you can remove the above.
removed

(09-27-2020 12:14 PM)lingu Wrote:  
Quote:ret = send delete request del_zengxingliang.json to trajan.d-thinker.org 20050
if ($ret == 200) {
print delete success
}
else {
print delete failed
return -1
}

Pls return different exit code for 200 and 404 scenarios.
added exit code as follows:
test_delete.sh:
Code:
server_addr=trajan.d-thinker.org:20050
flog_also_stderr=True
ret = send delete request del_zengxingliang.json to $server_addr
if ($ret == 200) {
    flog "delete success"
    return 0
}
else {
    flog "delete failed"
    return 99
}

(09-27-2020 12:14 PM)lingu Wrote:  
Quote:ret = send delete request del_zengxingliang.json to trajan.d-thinker.org 20050
if ($ret == 404) {
print delete success
return 0
}
else {
print delete failed
return -1
}
[/code]

RR lingu

You can add the case of deleting a non-existent case in another test, such as isds -- just make it isdsd.
OK, add test_isdsd.sh as follows:
Code:
erver_addr=trajan.d-thinker.org:20050
./test_isds.sh
./test_delete.sh
Quote this message in a reply
10-07-2020, 11:21 PM
Post: #16
RE: BIBO tests
(09-27-2020 12:15 PM)lingu Wrote:  
(09-26-2020 10:04 PM)zhihao Wrote:  design test_insert.sh:

ret = send insert request zengxingliang.json to trajan.d-thinker.org 20050
if ($ret == 200) {
print insert success

dont use print. Use flog. You can set flog_also_stderr=True to make the message go to stderr when you run it interactively.
OK, added flog and exit code
Code:
server_addr=trajan.d-thinker.org:20050
flog_also_stderr=True
ret = send insert request zengxingliang.json to $server_addr
if ($ret == 200) {
    flog "insert success"
    return 0
}
else {
    flog "insert failed"
    return 99
}

(09-27-2020 12:15 PM)lingu Wrote:  
Quote: return 0
}
else {
print insert failed
return -1
}
[/code]

RR lingu

OK but dont use -1
OK, updated
Quote this message in a reply
10-07-2020, 11:29 PM
Post: #17
RE: BIBO tests
(09-27-2020 12:16 PM)lingu Wrote:  
(09-26-2020 10:14 PM)zhihao Wrote:  design test_inquire.sh:
Code:
ret = send inquire request chendengchang-with-blank-line.json to trajan.d-thinker.org 20050

if ($ret == 200) {
  print "inquire success"
  return 0
}
else {
  print "inquire failed"
  return -1
}

RR lingu

OK but pls parameterize the newcase file and the service point (trajan).

updated as follows, and parameterized other test scripts too.
test_inquire.sh:
Code:
casefile=chendengchang-with-blank-line.json
server_addr=trajan.d-thinker.org:20050
flog_also_stderr=True
ret = send inquire request $casefile to $server_addr
if ($ret == 200) {
    flog "inquire success"
    return 0
}
else {
    flog "inquire failed"
    return 99
}
Quote this message in a reply
10-07-2020, 11:38 PM
Post: #18
RE: BIBO tests
(09-27-2020 12:20 PM)lingu Wrote:  
(09-27-2020 11:46 AM)zhihao Wrote:  add test_pressure.sh design info:

for (i in 1 to 10) {

parameterize 10. e.g., define a var bibo_test_iter_cnt with a default value 1.

Quote: run test_delete.sh
}
[/code]

RR lingu

Better combine small tests, such as test-delete and test-insert. You can make this a combined test test-id (insert delete). For correctness test, bibo_test_iter_cnt=1. For perf and pressure tests, we can set bibo_test_iter_cnt=10, 100, 1000, ...

OK, add parameter bibo_test_iter_cnt
test_pressure.sh:
Code:
bibo_test_iter_cnt=1
for (i in 1 to $bibo_test_iter_cnt) {
    ./test_insert.sh
    ./test_delete.sh
    ./test_isdsd.sh
}
Quote this message in a reply
10-09-2020, 12:16 PM
Post: #19
RE: BIBO tests
I think we already implemented some scripts, and we just need organize them. I am adding the tests to cod://bibo
Find all posts by this user
Quote this message in a reply
10-09-2020, 05:09 PM
Post: #20
RE: BIBO tests
(09-26-2020 01:49 PM)lingu Wrote:  test_inquire.sh:
[code]
casefile=chendengchang-with-blank-line.json
server_addr=trajan.d-thinker.org:20050

server_addr'd better be an IP address. Let's rename it bibo_server_addr. Let's use a default addr localhost.

For the port, we can define another var bibo_server_port and it has a default value 62818.

In this way, we can test bibo in an intranet system.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: