20 #include <NDBT_Test.hpp>
21 #include <HugoTransactions.hpp>
22 #include <UtilTransactions.hpp>
23 #include <NdbRestarter.hpp>
24 #include <NdbBackup.hpp>
27 #define CHECK(b) if (!(b)) { \
28 g_err << "ERR: "<< step->getName() \
29 << " failed on line " << __LINE__ << endl; \
30 result = NDBT_FAILED; \
36 const char* _database =
"BANK";
39 Bank bank(ctx->m_cluster_connection, _database);
40 int overWriteExisting =
true;
41 if (bank.createAndLoadBank(overWriteExisting) != NDBT_OK)
47 Bank bank(ctx->m_cluster_connection, _database);
51 while (ctx->isTestStopped() ==
false) {
52 bank.performIncreaseTime(wait, yield);
58 Bank bank(ctx->m_cluster_connection, _database);
62 while (ctx->isTestStopped() ==
false) {
63 bank.performTransactions(wait, yield);
69 Bank bank(ctx->m_cluster_connection, _database);
73 while (ctx->isTestStopped() ==
false) {
74 if (bank.performMakeGLs(yield) != NDBT_OK){
75 ndbout <<
"bank.performMakeGLs FAILED" << endl;
83 Bank bank(ctx->m_cluster_connection, _database);
88 while (ctx->isTestStopped() ==
false) {
89 if (bank.performSumAccounts(wait, yield) != NDBT_OK){
90 ndbout <<
"bank.performSumAccounts FAILED" << endl;
98 Bank bank(ctx->m_cluster_connection, _database);
99 if (bank.dropBank() != NDBT_OK)
105 Ndb* pNdb = GETNDB(step);
106 int loops = ctx->getNumLoops();
107 int records = ctx->getNumRecords();
109 int result = NDBT_OK;
111 while (l < loops && result != NDBT_FAILED){
114 result = NDBT_FAILED;
119 NdbSleep_SecSleep(records);
125 result = NDBT_FAILED;
133 NDBT_TESTSUITE(testBank);
136 INITIALIZER(runCreateBank);
138 STEP(runBankTransactions);
141 STEP(runBankController);
142 FINALIZER(runDropBank);
145 NDBT_TESTSUITE_END(testBank);
147 int main(
int argc,
const char** argv){
150 NDBT_TESTSUITE_INSTANCE(testBank);
151 testBank.setCreateTable(
false);
153 return testBank.execute(argc, argv);