Beispiel #1
0
	void test4() {
		Oam oamapi;
		oamapi.setProcessConfig("ProcessManager", "dm1", "BootLaunch", 10);

		oamapi.getProcessConfig("ProcessManager", "dm1", "BootLaunch", Ivalue);

		CPPUNIT_ASSERT(Ivalue == 10);
	};
Beispiel #2
0
	void test1() {
		SystemProcessConfig systemprocessconfig;

		Oam oamapi;
		oamapi.getProcessConfig(systemprocessconfig);

		for( unsigned int i = 0 ; i < systemprocessconfig.processconfig.size(); i++)
		{
			Svalue = systemprocessconfig.processconfig[i].ProcessName;
			CPPUNIT_ASSERT(!Svalue.empty());
	
			Svalue = systemprocessconfig.processconfig[i].ModuleType;
			CPPUNIT_ASSERT(!Svalue.empty());
	
			Svalue = systemprocessconfig.processconfig[i].ProcessLocation;
			CPPUNIT_ASSERT(!Svalue.empty());

			for( int j = 0 ; j < oam::MAX_ARGUMENTS; j++) {
				if (systemprocessconfig.processconfig[i].ProcessArgs[j].empty())
					break;
				Svalue = systemprocessconfig.processconfig[i].ProcessArgs[j];
				CPPUNIT_ASSERT(!Svalue.empty());
			}

			Ivalue = systemprocessconfig.processconfig[i].BootLaunch;
			CPPUNIT_ASSERT(Ivalue != -1);
	
			Ivalue = systemprocessconfig.processconfig[i].LaunchID;
			CPPUNIT_ASSERT(Ivalue != -1);
	
			for( int j = 0 ; j < MAX_DEPENDANCY; j++) {
				if (systemprocessconfig.processconfig[i].DepProcessName[j].empty())
					break;
				Svalue = systemprocessconfig.processconfig[i].DepProcessName[j];
				CPPUNIT_ASSERT(!Svalue.empty());
				Svalue = systemprocessconfig.processconfig[i].DepModuleName[j];
				CPPUNIT_ASSERT(!Svalue.empty());
			}
		}
	};
Beispiel #3
0
	void test2() {
		ProcessConfig processconfig;

		Oam oamapi;
		oamapi.getProcessConfig("ProcessManager", "dm1", processconfig);
		
		Svalue = processconfig.ProcessName;
		CPPUNIT_ASSERT(!Svalue.empty());

		Svalue = processconfig.ModuleType;
		CPPUNIT_ASSERT(!Svalue.empty());

		Svalue = processconfig.ProcessLocation;
		CPPUNIT_ASSERT(!Svalue.empty());

		for( int j = 0 ; j < oam::MAX_ARGUMENTS; j++) {
			if (processconfig.ProcessArgs[j].empty())
				break;
			Svalue = processconfig.ProcessArgs[j];
			CPPUNIT_ASSERT(!Svalue.empty());
		}

		Ivalue = processconfig.BootLaunch;
		CPPUNIT_ASSERT(Ivalue != -1);

		Ivalue = processconfig.LaunchID;
		CPPUNIT_ASSERT(Ivalue != -1);

		for( int j = 0 ; j < MAX_DEPENDANCY; j++) {
			if (processconfig.DepProcessName[j].empty())
				break;
			Svalue = processconfig.DepProcessName[j];
			CPPUNIT_ASSERT(!Svalue.empty());
			Svalue = processconfig.DepModuleName[j];
			CPPUNIT_ASSERT(!Svalue.empty());
		}
	};
Beispiel #4
0
	void test5() {
		ProcessConfig processconfig;
		Oam oamapi;
		oamapi.getProcessConfig("ProcessManager", "dm1", "ModuleTypeBAD", Svalue);
		CPPUNIT_ASSERT(Svalue.size() == 0);
	};
Beispiel #5
0
	void test3() {
		ProcessConfig processconfig;
		Oam oamapi;
		oamapi.getProcessConfig("SNMPTrapDaemonBAD", "dm1", processconfig);
		CPPUNIT_ASSERT(Svalue.size() == 0);
	};