Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: script for automation test  (Read 506 times)

0 Members and 1 Guest are viewing this topic.

Offline alt

script for automation test
« on: June 18, 2014, 02:39:00 AM »

I have write a  script to test toolkit automation
this can used to test some condition like flood transaction
I think somebody maye need this too
Code: [Select]
#!/usr/bin/expect -f

set timeout -1

set wallet_name "default"
set account_from "alt"
set account_to "delegate-alt"
send_user "wallet name is: $wallet_name\n"
send_user "wallet passphrase: "
stty -echo
expect_user -re "(.*)\n"
stty echo
set wallet_pass $expect_out(1,string)

spawn ./bitshares_client --server --httpport 9989

expect -exact "--- there are now 1 active connections to the p2p network"
expect -exact "(wallet closed) >>> "
send -- "info\r"
expect -exact "(wallet closed) >>> "
send -- "wallet_open $wallet_name\r"
expect -exact "$wallet_name (locked) >>> "
send -- "wallet_unlock 999999\r"
expect -exact "passphrase: "
send -- "$wallet_pass\r"
#expect -exact "$wallet_name (unlocked) >>> "
#send -- "wallet_rescan_blockchain\r"
sleep 2
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_transfer 10 DRINK $account_from $account_to \"test flood...\"\r"
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_transfer 11 DRINK $account_from $account_to \"test flood...\"\r"
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_transfer 12 DRINK $account_from $account_to \"test flood...\"\r"
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_transfer 13 DRINK $account_from $account_to \"test flood...\"\r"
expect -exact "$wallet_name (unlocked) >>> "
send -- "wallet_account_transaction_history\r"
interact
#expect -exact "$wallet_name (unlocked) >>> "
#send -- "exit\r"
#expect eof

Offline alt

Re: script for automation test
« Reply #1 on: June 18, 2014, 03:44:06 AM »
this is for flood test, 200 transfer everytime

Code: [Select]

#!/usr/bin/expect -f

set timeout -1

set wallet_name "default"
set account_from "alt"
set account_to "delegate-alt"
set loop_time 100
send_user "wallet name is: $wallet_name\n"
send_user "wallet passphrase: "
stty -echo
expect_user -re "(.*)\n"
stty echo
set wallet_pass $expect_out(1,string)

spawn ./bitshares_client --server --httpport 9989

expect -exact "--- there are now 1 active connections to the p2p network"
expect -exact "(wallet closed) >>> "
send -- "info\r"
expect -exact "(wallet closed) >>> "
send -- "wallet_open $wallet_name\r"
expect -exact "$wallet_name (locked) >>> "
send -- "wallet_unlock 999999\r"
expect -exact "passphrase: "
send -- "$wallet_pass\r"
#expect -exact "$wallet_name (unlocked) >>> "
#send -- "wallet_rescan_blockchain\r"
sleep 2

for {set i 1} {$i < $loop_time} {incr i 1} {
  expect -exact "$wallet_name (unlocked) >>> "
  send -- "wallet_transfer 10 DRINK $account_from $account_to \"test flood...\"\r"
  expect -exact "$wallet_name (unlocked) >>> "
  send -- "wallet_transfer 11 DRINK $account_from $account_to \"test flood...\"\r"
}

expect -exact "$wallet_name (unlocked) >>>
send -- "wallet_account_transaction_history\r"
interact

Offline puppies

Re: script for automation test
« Reply #2 on: June 18, 2014, 03:49:58 AM »
Are the missed transactions getting picked up over time?
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline alt

Re: script for automation test
« Reply #3 on: June 18, 2014, 03:52:22 AM »
never

Offline puppies

Re: script for automation test
« Reply #4 on: June 18, 2014, 03:55:08 AM »
interesting.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline crazybit

  • Sr. Member
  • ****
  • Posts: 416
    • View Profile
Re: script for automation test
« Reply #5 on: June 18, 2014, 04:31:19 AM »
cool, it  could be used for stress test. but  i have no much fund.

Offline HackFisher

  • Hero Member
  • *****
  • Posts: 883
    • View Profile
Re: script for automation test
« Reply #6 on: June 18, 2014, 05:31:07 AM »
 +5%, alt!

Just a tip, there are already some testcase scaffolds under toolkit tests folder for regression tests. If anyone would like to help or describe the bug you found, jump to --->

https://github.com/BitShares/bitshares_toolkit/tree/master/tests/regression_tests

https://github.com/BitShares/bitshares_toolkit/tree/master/tests
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline alt

Re: script for automation test
« Reply #7 on: June 18, 2014, 05:41:33 AM »
+5%, alt!

Just a tip, there are already some testcase scaffolds under toolkit tests folder for regression tests. If anyone would like to help or describe the bug you found, jump to --->

https://github.com/BitShares/bitshares_toolkit/tree/master/tests/regression_tests

https://github.com/BitShares/bitshares_toolkit/tree/master/tests
thx, but I am confused, how to use this?

Offline alt

Re: script for automation test
« Reply #8 on: June 18, 2014, 05:42:37 AM »
cool, it  could be used for stress test. but  i have no much fund.
test with other asset  :)
but still need some xts for the fee.

Offline HackFisher

  • Hero Member
  • *****
  • Posts: 883
    • View Profile
Re: script for automation test
« Reply #9 on: June 18, 2014, 05:43:40 AM »
+5%, alt!

Just a tip, there are already some testcase scaffolds under toolkit tests folder for regression tests. If anyone would like to help or describe the bug you found, jump to --->

https://github.com/BitShares/bitshares_toolkit/tree/master/tests/regression_tests

https://github.com/BitShares/bitshares_toolkit/tree/master/tests
thx, but I am confused, how to use this?

Here is the related document.
https://github.com/BitShares/bitshares_toolkit/blob/master/docs/regression_testing.dox
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline alt

Re: script for automation test
« Reply #10 on: June 18, 2014, 05:58:24 AM »
+5%, alt!

Just a tip, there are already some testcase scaffolds under toolkit tests folder for regression tests. If anyone would like to help or describe the bug you found, jump to --->

https://github.com/BitShares/bitshares_toolkit/tree/master/tests/regression_tests

https://github.com/BitShares/bitshares_toolkit/tree/master/tests
thx, but I am confused, how to use this?

Here is the related document.
https://github.com/BitShares/bitshares_toolkit/blob/master/docs/regression_testing.dox
great, I'll learn to use this

 

Google+