diff --git a/share/test/do_tests.sh b/share/test/do_tests.sh index 17238f2220..7e07fee314 100755 --- a/share/test/do_tests.sh +++ b/share/test/do_tests.sh @@ -1,8 +1,23 @@ #!/bin/bash #------------------------------------------------------------------------------- -# COMMAND LINE PARSING +# DEFINE THE TESTS #------------------------------------------------------------------------------- +TWD_DIR="../../src" +BASE_DIR=$PWD +TESTS="$TWD_DIR/vnm/test \ + $TWD_DIR/scheduler/src/xml/test \ + $TWD_DIR/scheduler/src/pool/test \ + $TWD_DIR/hm_mad/test \ + $TWD_DIR/common/test \ + $TWD_DIR/host/test \ + $TWD_DIR/template/test \ + $TWD_DIR/image/test \ + $TWD_DIR/authm/test \ + $TWD_DIR/vm/test \ + $TWD_DIR/um/test \ + $TWD_DIR/lcm/test \ + $TWD_DIR/pool/test" #------------------------------------------------------------------------------- # COMMAND LINE PARSING @@ -38,8 +53,6 @@ LOGS="no" CLEAR="no" BUILD="no" -TWD_DIR="../../src" -BASE_DIR=$PWD while true ; do case "$1" in diff --git a/share/test/one.db b/share/test/one.db deleted file mode 100644 index e87cb27bae..0000000000 Binary files a/share/test/one.db and /dev/null differ diff --git a/share/test/src/common/AMTest.cc b/share/test/src/common/AMTest.cc deleted file mode 100644 index c489d89812..0000000000 --- a/share/test/src/common/AMTest.cc +++ /dev/null @@ -1,67 +0,0 @@ -#include "ActionManager.h" -#include -#include - -class AMTest : public ActionListener -{ -public: - AMTest():am() - { - am.addListener(this); - }; - - ~AMTest(){}; - - ActionManager am; - -private: - void do_action(const string &action, void * arg); -}; - -void AMTest::do_action(const string &action, void * arg) -{ - int * i = static_cast(arg); - - cout<<"Event received: "< (arg); - - MT->am.trigger(event,&i); - - sleep(4); - - i = 10; - - MT->am.trigger(event,&i); - - i = 23; - - MT->am.trigger(ActionListener::ACTION_FINALIZE,&i); - - return 0; -} -/* -int main() -{ - pthread_t id; - int i = 3; - AMTest * MT = new AMTest(); - - pthread_create(&id, 0, startThread, MT); - - MT->am.loop(1,&i); - - delete MT; - - pthread_join(id,0); - - return 0; -} -*/ diff --git a/share/test/src/host/TestHostPool.cc b/share/test/src/host/TestHostPool.cc deleted file mode 100644 index 32116e5008..0000000000 --- a/share/test/src/host/TestHostPool.cc +++ /dev/null @@ -1,252 +0,0 @@ -#include "VirtualMachine.h" -#include "VirtualMachineManagerDriver.h" -#include "Nebula.h" - -#include "InformationManagerDriver.h" -#include "InformationManager.h" -#include "Mad.h" - -#include "Host.h" -#include "HostPool.h" - - - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -extern "C" void *test(void *nothing) -{ - ostringstream os; - - sleep(2); - os.str(""); - - int rc; - - Nebula & pn = Nebula::instance(); - - HostPool * thepool = pn.get_hpool(); - Host * host; - int hid; - - thepool->bootstrap(); - - thepool->allocate(&hid,"foo.dacya","mad1","mad2","mad3",true); - - os.str(""); - os << "Host " << hid << " allocated"; - Nebula::log("TST", Log::ERROR, os); - - thepool->allocate(&hid,"foo2.dacya","mad1","mad2","mad3",true); - - os.str(""); - os << "Host " << hid << " allocated"; - Nebula::log("TST", Log::ERROR, os); - - thepool->allocate(&hid,"foo3.dacya","mad1","mad2","mad3",true); - - os.str(""); - os << "Host " << hid << " allocated"; - Nebula::log("TST", Log::ERROR, os); - - host = static_cast(thepool->get(3422,false)); - - if (host != 0) - { - os.str(""); - os << "Test failed. Shouldn't be here."; - Nebula::log("TST", Log::ERROR, os); - } - - host = static_cast(thepool->get(0,true)); - - if (host != 0) - { - os.str(""); - os << "Going fine. Host " << *host << " retrieved."; - Nebula::log("TST", Log::ERROR, os); - - host->unlock(); - } - else - { - os.str(""); - os << "Test failed!. Not able to retrieve host 0"; - Nebula::log("TST", Log::ERROR, os); - } - - - Host * host2 = static_cast(thepool->get(1,false)); - - if (host2 != 0) - { - os.str(""); - os << "Going fine. Host " << *host2 << " retrieved."; - Nebula::log("TST", Log::ERROR, os); - } - - Host * host3 = static_cast(thepool->get(2,false)); - - if (host3 != 0) - { - os.str(""); - os << "Going fine. Host " << *host3 << " retrieved."; - Nebula::log("TST", Log::ERROR, os); - - } - - - Host * host4 = static_cast(thepool->get(32,false)); - - - if (host4 != 0) - { - os.str(""); - os << "Going fine. Host " << *host4 << " retrieved."; - Nebula::log("TST", Log::ERROR, os); - - } - - host3->lock(); - - string host_info_str("cpuArchitecture=x86_32\nnumberCores=1\ncpuSpeed=2211\ntotalMemory=2046\nfreeMemory=125\nusedMemory=1921\ncpupercentage=50\nnetTX=78516\nnetRX=138612\nnetRX=138612\n"); - rc = host3->update_info(host_info_str); - - host3->touch(); - - - os.str(""); - os << "updated host info with RC = " << rc; - Nebula::log("TST", Log::ERROR, os); - - rc = thepool->update_host(host3); - - os.str(""); - os << "updated host into DB with RC = " << rc; - Nebula::log("TST", Log::ERROR, os); - - bool result; - char * error; - - rc = host3->match("numberCores=1 & cpuArchitecture=\"OTRA ARCH\"",result,&error); - - os.str(""); - if ( rc == 0) - { - os << "REQ result = " << result; - } - else - { - os << "REQ error = " << error; - - free(error); - } - Nebula::log("TST", Log::ERROR, os); - - int resulti; - - rc = host3->rank("cpuSpeed + numberCores",resulti,&error); - - os.str(""); - if ( rc == 0) - { - os << "RANK result = " << resulti; - } - else - { - os << "RANK error = " << error; - - free(error); - } - Nebula::log("TST", Log::ERROR, os); - - host3->unlock(); - - host3->lock(); - - string host_info_str2("cpuArchitecture=\"OTRA ARCH\"\n"); - - rc = host3->update_info(host_info_str2); - - host3->touch(); - - rc = thepool->update_host(host3); - - host3->unlock(); - - - host2->lock(); - - string host_info_str3("cpuArchitecture=x86_32\nnumberCores=8\ncpuSpeed=2211\ntotalMemory=2046\nfreeMemory=125\nusedMemory=1921\ncpupercentage=50\nnetTX=78516\nnetRX=138612\nnetRX=138612\n"); - - rc = host2->update_info(host_info_str3); - - host2->touch(); - - rc = thepool->update_host(host2); - - host2->unlock(); - - map test_discover; - - rc = thepool->discover(&test_discover); - - if(rc!=0) - { - os.str(""); - os << "Error discovering hosts."; - Nebula::log("TST", Log::ERROR, os); - } - - os.str(""); - os << "Discover size:" << test_discover.size(); - Nebula::log("TST", Log::ERROR, os); - - map ::iterator it; - - for(it=test_discover.begin();it!=test_discover.end();it++) - { - os.str(""); - os << "IM_MAD:" << it->second << " has to monitor " << it->first; - Nebula::log("TST", Log::ERROR, os); - } - - return 0; -} - - - -int main() -{ - pthread_t test_thread; - - pthread_create(&test_thread,0,test,(void *)0); - - try - { - Nebula& nd = Nebula::instance(); - nd.start(); - } - catch (exception &e) - { - cout << e.what() << endl; - - return -1; - } - - - return 0; -} diff --git a/share/test/src/im/ImTest.cc b/share/test/src/im/ImTest.cc deleted file mode 100644 index e7f12400b7..0000000000 --- a/share/test/src/im/ImTest.cc +++ /dev/null @@ -1,98 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -#include "VirtualMachine.h" -#include "VirtualMachineManagerDriver.h" -#include "Nebula.h" - -#include "InformationManagerDriver.h" -#include "InformationManager.h" -#include "Mad.h" - - - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace std; - - -extern "C" void *test(void *nothing) -{ - sleep(2); - - Nebula& pn = Nebula::instance(); - - InformationManager * im = pn.get_im(); - HostPool * hostp = pn.get_hpool(); - - int * oid; - int rc; - - sleep(2); - - /* rc = hostp->allocate(oid,"aquila03","im_test","xen_ssh","dummy",true); - - if ( rc != 0 ) - { - Nebula::log("TST",Log::ERROR,"Error allocating host!"); - return 0; - } -*/ - - im->load_mads(); - - sleep(600); - - return 0; -} - -int main() -{ - pthread_attr_t pattr; - pthread_t test_thread; - - pthread_attr_init (&pattr); - pthread_attr_setdetachstate (&pattr, PTHREAD_CREATE_JOINABLE); - - pthread_create(&test_thread,&pattr,test,(void *)0); - - try - { - Nebula& nd = Nebula::instance(); - nd.start(); - } - catch (exception &e) - { - cout << e.what() << endl; - - return -1; - } - - - return 0; -} - diff --git a/share/test/src/mad/MMTest.cc b/share/test/src/mad/MMTest.cc deleted file mode 100644 index 1694209388..0000000000 --- a/share/test/src/mad/MMTest.cc +++ /dev/null @@ -1,188 +0,0 @@ -#include -#include -#include - -#include - -#include "MadManager.h" - -pthread_cond_t cond = PTHREAD_COND_INITIALIZER; -pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -bool finalized = false; - -class MadEcho : public Mad -{ -public: - MadEcho(map &attrs):Mad(0,attrs,false) - {} - ; - - ~MadEcho() - {} - ; - - void protocol(string& message); - - void recover() - { - cout<<"Recover Function @ MadEcho\n"; - }; - - void test(const char *a1, const char *a2, const char *a3) - { - ostringstream buf; - - buf << "TEST " << a1 << " " << a2 << " " << a3 << "\n"; - - write(buf); - } - - void first(const char *a1) - { - ostringstream buf; - - buf << "FIRST " << a1 << "\n"; - - write(buf); - } -}; - -void MadEcho::protocol(string& message) -{ - stringbuf sbuf(message); - iostream sstr(&sbuf); - - string field[5]; - - sstr >> field[0] >> ws; - - if ( field[0] == "INIT" ) - { - getline(sstr,field[1]); - - cout << "Init Result: " << field[1] << "\n"; - } - else if ( field[0] == "FINALIZE" ) - { - getline(sstr,field[1]); - - cout << "Finalize Result: " << field[1] << "\n"; - } - else if ( field[0] == "TEST" ) - { - sstr >> field[1] >> field[2] >> field[3] >> ws; - - getline(sstr,field[4]); - - cout << "Test Result: " << field[1] << "\nArg1: " << field[2] - << "\nArg2: " << field[3] << "\nInfo: " << field[4] << "\n"; - } - else if ( field[0] == "FIRST" ) - { - finalized = true; - - sstr >> field[1] >> ws; - getline(sstr,field[2]); - - cout << "First Result: " << field[1] << "\nArg1: " << field[2] << "\n"; - - pthread_cond_signal(&cond); - } -} - -class MMadManager : public MadManager -{ -public: - MMadManager(vector& _mads):MadManager(_mads){}; - ~MMadManager(){}; - - void load_mads(int uid){}; - - int mstart(){ - return start(); - } - - void mstop(){ - stop(); - } - - int madd(Mad *mad){ - return add(mad); - } -}; - -int main() -{ - vector _mads; - MMadManager *mm; - MadEcho * mad_echo; - map attrs; - int rc; - - MadManager::mad_manager_system_init(); - - mm = new MMadManager(_mads); - - rc = mm->mstart(); - - if ( rc != 0 ) - { - goto error_start; - } - - attrs.insert(make_pair("NAME","echo_mad")); - attrs.insert(make_pair("EXECUTABLE","./mad_echo.sh")); - attrs.insert(make_pair("OWNER","foo")); - - mad_echo = new MadEcho(attrs); - /* - rc = mad_echo->start(); - - if ( rc != 0 ) - { - goto error_start_mad; - } - */ - rc = mm->madd(mad_echo); - - if ( rc != 0 ) - { - goto error_register; - } - - mad_echo->test("argument1","argument2","argument3"); - - mad_echo->first("filed1"); - - pthread_mutex_lock(&mutex); - - while ( finalized == false ) - { - pthread_cond_wait(&cond, &mutex); - } - - printf("Mad_Test - OK\n"); - - mm->mstop(); - - delete mm; - - return 0; - -error_register: - cout << "Mad_Test - error register mad\n"; - mm->mstop(); - - delete mm; - delete mad_echo; - - return -1; - -error_start: - cout << "Mad_Test - error start manager\n"; - mm->mstop(); - - delete mm; - - return -1; -} diff --git a/share/test/src/mad/mad_echo.sh b/share/test/src/mad/mad_echo.sh deleted file mode 100755 index 0092ea27a7..0000000000 --- a/share/test/src/mad/mad_echo.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# -------------------------------------------------------------------------- -# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -------------------------------------------------------------------------- - -echo "MAD started" > mad.log - - -while read COMMAND ARG1 ARG2 ARG3 -do - echo "$COMMAND $ARG1 $ARG2 $ARG3" >> mad.log - case $COMMAND in - "INIT" | "init") - echo "INIT SUCCESS" - ;; - "FINALIZE" | "finalize") - echo "FINALIZE SUCCESS" - exit 0 - ;; - "TEST" | "test") - echo "TEST SUCCESS $ARG1 $ARG2 $ARG3" - ;; - "FIRST" | "first") - echo "FIRST SUCCESS $ARG1" - ;; - *) - echo "$COMMAND - FAILURE Unknown command" - ;; - esac -done diff --git a/share/test/src/nebula/log.cc b/share/test/src/nebula/log.cc deleted file mode 100644 index 6121ac8e63..0000000000 --- a/share/test/src/nebula/log.cc +++ /dev/null @@ -1,15 +0,0 @@ -#include "Log.h" -#include - -int main() -{ - Log log("file.log"); - - ostringstream message; - message << "pepe"; - - log.log("module", Log::ERROR, message); - - return 0; -} - diff --git a/share/test/src/pool/TestSQL.cc b/share/test/src/pool/TestSQL.cc deleted file mode 100644 index b06795814b..0000000000 --- a/share/test/src/pool/TestSQL.cc +++ /dev/null @@ -1,173 +0,0 @@ -#include "PoolSQL.h" -#include -#include -#include -#include - -class A : public ObjectSQL -{ -public: - A(int n,string &t):number(n),text(t){oid=n;}; - A(int n,const char *t):number(n),text(t){oid=n;}; - A(int n):number(n){oid=n;}; - A(){}; - ~A(){}; - - int number; - string text; - - int insert(sqlite3 *db); - int select(sqlite3 *db); - int update(sqlite3 *db){return 0;}; -}; - -int A::insert(sqlite3 *db) -{ - const char * sql_cmd; - ostringstream buffer; - string sql; - int rc; - - buffer << "INSERT INTO test (numero,texto) VALUES (" << oid << ",\"" << -text << "\")"; - - sql = buffer.str(); - sql_cmd = sql.c_str(); - - rc = sqlite3_exec(db, - sql_cmd, - NULL, - NULL, - NULL); - - if ( rc != SQLITE_OK ) - { - cout << "ERROR : "<text = values[1]; - - cout << "-" << aclass->text << "-\n"; - - return 0; -} - -int A::select(sqlite3 *db){ - - const char * sql_cmd; - ostringstream buffer; - string sql; - - buffer << "SELECT * FROM test WHERE numero=" << oid; - - - sql = buffer.str(); - sql_cmd = sql.c_str(); - - sqlite3_exec(db, - sql_cmd, - select_cb, - this, - NULL); - - return 0; -}; - -class Apool : public PoolSQL -{ -public: - Apool(sqlite3 *db):PoolSQL(db,"test"){}; - ~Apool(){}; -private: - ObjectSQL* create(){ return (new A);}; - -}; - - -/* -int main() -{ - sqlite3 * db; - - sqlite3_open("pool.db", &db); - - sqlite3_exec(db, - "CREATE TABLE test (numero INTEGER," - "texto TEXT)", - NULL, - NULL, - NULL); - - - A *a; - Apool apool(db); - - - a = new A(-1,"prueba"); - - apool.allocate(a); - - a = new A(4,"otro"); - - apool.allocate(a); - - a = new A(8,"otro mas"); - - apool.allocate(a); - - A * aobj = static_cast(apool.get(1,false)); - - cout << aobj->text << "\n"; - - delete aobj; - - aobj = static_cast(apool.get(0,false)); - - cout << aobj->text << "\n"; - - delete aobj; - - sqlite3_close(db); -} -*/ - -/* -int main() -{ - sqlite3 * db; - string s("HOLA"); - A test(8,s); - A otro(8); - - sqlite3_open("pool.db", &db); - - sqlite3_exec(db, - "CREATE TABLE test (numero INTEGER," - "texto TEXT)", - NULL, - NULL, - NULL); - - test.insert(db); - - otro.select(db); - - cout << "texto : " << otro.text; - - sqlite3_close(db); -}*/ diff --git a/share/test/src/template/ATTest.cc b/share/test/src/template/ATTest.cc deleted file mode 100644 index a66ff43a66..0000000000 --- a/share/test/src/template/ATTest.cc +++ /dev/null @@ -1,122 +0,0 @@ -#include "VirtualMachineTemplate.h" -#include -#include -#include - - -int main() -{ - VirtualMachineTemplate tmp; - Template t; - - char *error; - string st("MEMORY=345\nCPU=4\nDISK=[FILE=\"img\",TYPE=cd]\nDISK=[FILE=\"../f\"]\n"); - - - ostringstream os; - - if ((tmp.parse("vm.template",&error) != 0 ) && - (error != 0)) - { - cout << "Error parsing file: "<< error << endl; - - free(error); - } - - string mrs; - - tmp.marshall(mrs,':'); - - cout << "-" << mrs << "-"; - - if ((t.parse(st,&error) != 0 ) && - (error != 0)) - { - cout << "Error parsing string: "<< error << endl; - - free(error); - } - cout << "TEMPLATE" << endl << t << endl; - cout << "------" << endl << endl; - cout << "TEMPLATE" << endl << tmp << endl; - - string mm("MEMORY"); - vector values; - - tmp.get(mm,values); - - const SingleAttribute *pmemo; - - pmemo = static_cast(values[0]); - - cout << "MEM = " << pmemo->value() << "\n"; - - cout << "TEMPLATE--" << endl << t << endl; - - // ---- Init template DB ---- - /* - - sqlite3 * db; - sqlite3_open("template.db", &db); - - sqlite3_exec(db, - "CREATE TABLE vm_template (id INTEGER," - "name TEXT, value TEXT)", - 0, - 0, - 0); - - cout << tmp.insert(db) << endl; - - VirtualMachineTemplate rtmp(2); - - rtmp.select(db); - - cout << endl << "FROM DB" << endl << rtmp; - - sqlite3_close(db); - - */ - return 0; -} - - -/* -int main() -{ - TemplateAttribute sa1("ejemplo","valor"); - TemplateAttribute sa2("sample","value"); -// Attribute * pa; -// Attribute * pa2; - - cout << sa1.name() << ":" << sa1.value() << "\n"; - cout << sa2.name() << ":" << sa2.value() << "\n"; - - - cout << sa2.name() << ":" << sa2.value() << "\n"; - - - - - //map mymap; - //TemplateAttribute * pta; - - - - //pa = new TemplateAttribute("ejemplo","valor"); - - //cout << str_attr.name(); - //cout << pa->name(); - - //pta = static_cast *> (pa); - - //cout << pa->name(); - - //mymap.insert(make_pair("cadena",pa)); - - //delete pa; - - return 0; -} -*/ - diff --git a/share/test/src/template/vm.template b/share/test/src/template/vm.template deleted file mode 100644 index 171190715d..0000000000 --- a/share/test/src/template/vm.template +++ /dev/null @@ -1,8 +0,0 @@ -MEMORY = 512 -Cpu = 1 - -DISK = [ ImaGE="/local/VM/disk.img",device="sda",TYPE="hd" ] -DISK = [ image="../debian.iso",DEvice="sdb",TYPE="cdrom" ] - -nic = [ MAC="00:01:02", TYPE="bridged", IP="147.3"] - diff --git a/share/test/src/vm/TestVMPool.cc b/share/test/src/vm/TestVMPool.cc deleted file mode 100644 index 8b279fb118..0000000000 --- a/share/test/src/vm/TestVMPool.cc +++ /dev/null @@ -1,74 +0,0 @@ -#include "VirtualMachinePool.h" -#include -#include -#include -#include - -int main() -{ - sqlite3 * db; - - sqlite3_open("pool.db", &db); - - VirtualMachinePool thepool(db); - VirtualMachine * vm; - int eid; - string st("MEMORY=345\nCPU=4\nDISK=[FILE=\"img\",TYPE=cd]\nDISK=[FILE=\"../f\"]\n"); - - thepool.bootstrap(); - - thepool.allocate(0,st,&eid); - cout << eid << endl; - - thepool.allocate(0,st,&eid); - cout << eid << endl; - - thepool.allocate(0,st,&eid); - cout << eid << endl; - - vm = static_cast(thepool.get(444,false)); - - if (vm != 0) - { - cout << *vm; - } - - vm = static_cast(thepool.get(1,true)); - - string vmm = "xen"; - string tm = "gridftp"; - - //vm->add_history(2,2,vmm,tm); - - //thepool.update_history(vm); - - if (vm != 0) - { - cout << *vm << endl; - - vm->unlock(); - } - else - { - cout << "VM es cero!" << endl; - } - - VirtualMachine * vm2 = static_cast(thepool.get(2,false)); - - if (vm2 != 0) - { - - cout << *vm2; - } - - VirtualMachine * vm3 = static_cast(thepool.get(3,true)); - - if (vm3 != 0) - { - cout << *vm3; - - vm3->unlock(); - } - - sqlite3_close(db); -} diff --git a/share/test/src/vmm/VMManager.cc b/share/test/src/vmm/VMManager.cc deleted file mode 100644 index 74dc2a14a0..0000000000 --- a/share/test/src/vmm/VMManager.cc +++ /dev/null @@ -1,56 +0,0 @@ - -#include - -#include "Nebula.h" -#include -#include -#include "VirtualMachine.h" -#include "VirtualMachineManagerDriver.h" - -extern "C" void *test(void *nothing) -{ - VirtualMachineManager *vm_manager; - InformationManager *im_manager; - Nebula& ne = Nebula::instance(); - string s_template; - ostringstream os; - - sleep(20); - - Nebula::log("TST", Log::INFO, "Alive!"); - - vm_manager = ne.get_vmm(); - vm_manager->load_mads(0); - - im_manager = ne.get_im(); - im_manager->load_mads(0); - - return 0; -} - -int main() -{ - pthread_attr_t pattr; - pthread_t test_thread; - - pthread_attr_init (&pattr); - pthread_attr_setdetachstate (&pattr, PTHREAD_CREATE_JOINABLE); - - pthread_create(&test_thread,&pattr,test,(void *)0); - - try - { - Nebula& nd = Nebula::instance(); - nd.start(); - } - catch (exception &e) - { - cout << e.what() << endl; - - return -1; - } - - - return 0; -} -