Esempio n. 1
0
TInt E32Main()
	{
	test.Title();

	// Turn off evil lazy dll unloading
	RLoader l;
	test(l.Connect()==KErrNone);
	test(l.CancelLazyDllUnload()==KErrNone);
	l.Close();

	test.Start(_L("Preload t_oedll1.dll"));
	RLibrary library;
	test(library.Load(_L("t_oedll1.dll")) == KErrNone);

	test.Next(_L("Run T_OEEXPORT.EXE..."));
	RProcess p;
	TInt r=p.Create(_L("T_OEEXPORT.EXE"), _L("2"));
	test(r==KErrNone);
	TRequestStatus s;
	p.Logon(s);
	p.Resume();
	User::WaitForRequest(s);
	TExitCategoryName aExitCategory = p.ExitCategory();
	test.Printf(_L("Second test exits with: %d,%d,%S\n"),p.ExitType(),p.ExitReason(),&aExitCategory);
	test(p.ExitType()==EExitKill);
	test(p.ExitReason()==0);
	p.Close();

	library.Close();

	test.End();
	return KErrNone;
	}
/**
Starts test step
@internalComponent
@return TVerdict pass / fail
@pre N/A
@post N/A
*/
enum TVerdict CT_WServCapCheckStepTSizeMode::runTestCaseL(const TDesC& aExecutable, const TInt& aExitReason)
	{
	__UHEAP_MARK; // mark the heap state

	//Launch window server client process read fron ini file
	RProcess process;
	User::LeaveIfError(process.Create(aExecutable, KNullDesC));
	process.SetPriority(EPriorityHigh);
	TEST(process.Priority() == EPriorityHigh);
	INFO_PRINTF3(_L("Process Priority: Actual: %d, Expected: %d"), process.Priority(), EPriorityHigh);

	//Wait for the client process to terminate
	TRequestStatus status;
	process.Logon(status);
	process.Resume();
	User::WaitForRequest(status);

	//Check the window server client exit reason
	INFO_PRINTF3(_L("Process Check: Actual: %d, Expected: %d"), process.ExitReason(), aExitReason);
	TEST(process.ExitReason() == aExitReason);

	__UHEAP_MARKEND; // check for no memory leak

	return TestStepResult();
	}
static void RunHelper(const TDesC& aFileToDelete, TInt aExpectedError)
/**
	Invoke the helper executable, tell it to delete the supplied file.
	
	@param	aFileToDelete	Name of file which helper executable should delete
							with RLoader::Delete.
	@param	aExpectedError	The expected return code from RLoader::Delete.
 */
	{
	TInt r;
	
	// run the helper exe, which will try to delete the file with RLoader::Delete
	RProcess ph;
	r = ph.Create(_L("tld_helper_caps.exe"), aFileToDelete);
	test(r == KErrNone);

	TRequestStatus rsh;
	ph.Logon(rsh);
	test(rsh == KRequestPending);
	ph.Resume();
	User::WaitForRequest(rsh);

	// process has died so check the panic category and reason match the expected values
	test(ph.ExitType() == EExitPanic);
	test(ph.ExitCategory() == KTldPanicCat);
	test(ph.ExitReason() == aExpectedError);

	ph.Close();
	}
Esempio n. 4
0
/**
   @SYMTestCaseID UIF-UIKON-0008
  
   @SYMREQ 7736

   @SYMTestCaseDependencies	Following steps should be done before running this test: 
   		1. Uncomment the call to this manual test
   		2. Error codes must be updated. Following files need replacing with those in uikon/test/terror/terrortextwithtitleapp/data.
   			a) //EPOC/master/common/generic/tools/s60_header_compat/commonengineresources/data/errorres.rss
			b) //EPOC/master/common/generic/tools/s60_header_compat/commonengineresources/inc/errorres.loc
		3. Reallyclean and re-compile the following folders:
			a) //EPOC/master/common/generic/tools/s60_header_compat/group95/bld.inf (or later)
			b) Uiktest code (\uikon\test\group\bld.inf), so the test code links against the new rsc files.
  
   @SYMTestCaseDesc Test
  
   @SYMTestPriority High
  
   @SYMTestStatus Implemented
   
   @SYMTestActions This Method invokes terrortextwithtitleapp.exe, which tests the newly added error codes.
     
   @SYMTestExpectedResults terrortextwithtitleapp.exe should terminate with KErrNone, meaning that all its internal
   						   checks inside the app were ok, and hence error message correctly resolved.
 */
void CAppTest::TestErrorWithTitleManuallyL()
	{
	iAppUi->INFO_PRINTF1(_L("Manual Testing for new test error codes added to errorres.rss file"));
	_LIT(KErrorTextWithTitleAppFileName,"z:\\sys\\bin\\terrortextwithtitleapp.exe");
	RProcess errorContextProc;
	TRequestStatus appState;
	TBool jit = User::JustInTime();
	User::SetJustInTime(EFalse);
	TInt ret = errorContextProc.Create(KErrorTextWithTitleAppFileName,KNullDesC);
	iAppUi->TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(errorContextProc);

	//Launching the application
	iAppUi->INFO_PRINTF1(_L("Start terrortextwithtitleapp.exe to test the new test error codes"));
	errorContextProc.Logon(appState);
	errorContextProc.Resume();
	User::WaitForRequest(appState);
	iAppUi->TEST(errorContextProc.ExitReason() == KErrNone);
	iAppUi->TEST(errorContextProc.ExitType() == EExitKill);

	CleanupStack::PopAndDestroy(&errorContextProc);
	User::SetJustInTime(jit);
	iAppUi->INFO_PRINTF1(_L("Manual test completed"));
    }
/**
Creates a second process and do some tests in it.
@param aExecutableName The name of the new process
@param aTestInfo The information for the tests
@leave Gets system wide error code
*/
TInt CTGraphicsResourceInternalBase::CreateSecondProcessAndDoTestL(const TDesC &aExecutableName, TSgResIntTestInfo& aTestInfo)
	{
	// Create a second process
    RProcess process;
    User::LeaveIfError(process.Create(aExecutableName, KNullDesC));
	CleanupClosePushL(process);

	// Specify the id passed to the second process
	TPckg<TSgResIntTestInfo> ptr(aTestInfo);
	TInt err = process.SetParameter(KSecondProcessParametersSlot, ptr);
	TESTEL(KErrNone == err, err);

	// Kick off the second process and wait for it to complete
	// The actual testing is done in the second process
	TRequestStatus status;
	process.Logon(status);
	process.Resume();
	User::WaitForRequest(status);

	//ExitReason() returns the test result
	TInt exitreason = process.ExitReason();
	
	TEST(process.ExitType() == EExitKill);
	
	CleanupStack::PopAndDestroy();
	
	return exitreason;
	}
Esempio n. 6
0
/**
 @SYMTestCaseID APPFWK-APPARC-0018

 @SYMPREQ PREQ1123

 @SYMTestCaseDesc The Test determines that a process is launched and terminated without any problem.\n

 @SYMTestPriority Low

 @SYMTestStatus Implemented

 @SYMTestActions. Creates and launches a process. No Child is created. Parent should launch properly, and on termination should die.
 API Calls:\n
 RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
 RProcess::Resume();
 RProcess::ExitType() const;
 RProcess::ExitReason() const;
 RProcess::Id() const;
 RProcess::Terminate(TInt aReason);
 
 @SYMTestExpectedResults Proper creation and termination.\n

 */
void CT_ProcStep::testParentWithoutAChildL(void)
	{
	TInt ret(0)	;

	//process
	RProcess parentProc;
	ret = parentProc.Create(KParentExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(parentProc);
	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);

	TUint64 parentProcId=parentProc.Id();
	INFO_PRINTF2(_L("	Process Id = 0x%lx "),parentProcId);

	INFO_PRINTF1(_L("	Run the Process "));
	parentProc.Resume();
	//Time for the parent process to launch itself
	User::After(5000000);

	TExitType exitType = parentProc.ExitType();
	TEST(exitType == EExitKill||exitType == EExitPending);
	if(exitType==EExitPending)
		{
		INFO_PRINTF1(_L("	Process running normally "));
		parentProc.Terminate(KTProcTerminatingParent);
		exitType = parentProc.ExitType();
		TEST(exitType==EExitTerminate);
		TInt exitReason = parentProc.ExitReason();
		TEST(exitReason == KTProcTerminatingParent);
		INFO_PRINTF1(_L("	Terminating the process "));
		}
	CleanupStack::PopAndDestroy(&parentProc);
	}
Esempio n. 7
0
void TestServerPanic()
	{
	TRequestStatus status;
	
	test_KErrNone(TheSemaphore.CreateLocal(0));
	
	RDebug::Printf("Main: start server");
	RThread serverThread;
	test_KErrNone(serverThread.Create(_L("server"), ServerThread, 4096, NULL, NULL));
	serverThread.Rendezvous(status);
	serverThread.Resume();
	User::WaitForRequest(status);
	test_KErrNone(status.Int());

	RDebug::Printf("Main: start client");
	RProcess clientProcess;
	test_KErrNone(clientProcess.Create(KMyName, _L("client")));
	clientProcess.Resume();
	clientProcess.Logon(status);
	User::WaitForRequest(status);
	test_KErrNone(clientProcess.ExitReason());
	test_Equal(EExitKill, clientProcess.ExitType());

	RDebug::Printf("Main: kick server");
	TheSemaphore.Signal();
	
	RDebug::Printf("Main: wait for server to exit");
	serverThread.Logon(status);
	User::WaitForRequest(status);
	test_KErrNone(serverThread.ExitReason());
	test_Equal(EExitKill, serverThread.ExitType());

	User::After(1);
	RDebug::Printf("Main: exit");
	}
Esempio n. 8
0
TInt CCapabilityTestStep::CreateServerProcess (RSemaphore& aSemaphore)
	{
	const TUidType serverUid (KNullUid, KNullUid, KServerUid3);

	RProcess server;
	RETURN_IF_ERROR(server.Create(KSipServerName,KNullDesC,serverUid))

	server.Resume ();
	aSemaphore.Wait();
	TInt exitReason = server.ExitReason();
	server.Close ();

    return exitReason;
	}
Esempio n. 9
0
void ExecSlave(TUint aArg)
	{
	RProcess proc;
	TInt r = proc.Create(KSecuritySlavePath, TPtrC((TUint16*) &aArg, sizeof(aArg)/sizeof(TUint16)));
	test(r == KErrNone);
	TRequestStatus status;
	proc.Logon(status);
	proc.Resume();
	User::WaitForRequest(status);
	// The slave must panic
	test_Equal(EExitPanic, proc.ExitType());
	test_Equal(EPlatformSecurityTrap, proc.ExitReason());
	CLOSE_AND_WAIT(proc);
	}
Esempio n. 10
0
void LaunchProcessL(const TDesC& aProcessName, const TDesC& aCmdLine)
	{
	TRequestStatus stat;    
	RProcess p;
	User::LeaveIfError(p.Create(aProcessName, aCmdLine));

	// Asynchronous logon: completes when process terminates with process 
	// exit code
	p.Logon(stat);
	p.Resume();
	User::WaitForRequest(stat);

	TExitType exitType = p.ExitType();
	TInt exitReason = p.ExitReason();

	p.Close();
	User::LeaveIfError(exitReason);
	}
void CPerformanceFunctionalityBase::CloseProcessL(const TDesC& aProcessName, const TInt aIteration)
    {
	_LIT(KillString, "Kill");
	if ( aProcessName != KNullDesC )
		{
		_LIT(KServerRunning,"*** The CntSrv process is running ***");
		_LIT(KServerIteration, "Found server process on iteration: %d");
		INFO_PRINTF1(KServerRunning);
		INFO_PRINTF2(KServerIteration, aIteration);

		// the CntSrv process is running so wait
		RProcess process;
		const TInt OpenError = process.Open(aProcessName);
		if ( OpenError == KErrNone)
			{
			TRequestStatus status;
			process.Logon(status); // ask for a callback when the process ends
			User::WaitForRequest(status);
			const TInt serverError = process.ExitReason();
			TExitCategoryName category = process.ExitCategory();
			_LIT(KServerClosed,"*** The CntSrv process has ended with error type: %S, and error value: %d ***");
			INFO_PRINTF3(KServerClosed, &category, serverError);
			process.Close();
			if( ( category != KillString ) || ( serverError != KErrNone ) )
				{
				_LIT(KServerError,"*** The server caused an error while closing ***");
				ERR_PRINTF1(KServerError);
				TEST1( EFalse, ETrue);
				}
			}
		else
			{
			_LIT(KProcessFailure,"*** Failed to open process, error: %d ***");
			ERR_PRINTF2(KProcessFailure, OpenError);
			TEST1(EFalse, ETrue);
			}
		}
	else
		{
		_LIT(KNoProcess,"*** The CntSrv process is NOT running ***");
		ERR_PRINTF1(KNoProcess);
		TEST1(EFalse, ETrue);
		}
    }
void CAppfwkAmaStarterTestStepStandalone::LaunchExe(const TDesC& aFilename, const TDesC& aArguments, TInt aExitReason)
	{
	RProcess process;
	TInt ret = process.Create(aFilename, aArguments, EOwnerThread);
	TEST(ret == KErrNone);
	
	TRequestStatus	status;
	process.Logon(status);
	User::SetJustInTime(EFalse);
	process.Resume();
	User::WaitForRequest(status);
	User::SetJustInTime(ETrue);
	TInt exitReason = process.ExitReason();
	process.Close();
	
	// Check the process ended with the expected exit reason
	INFO_PRINTF3(_L("Process finished with ExitReason '%d' (expected was '%d')"), exitReason, aExitReason);
	TEST(exitReason == aExitReason);
	}
Esempio n. 13
0
//This function is used in the test code to kill backupSrv or the backuplauncher process.
// It creates a separate process to do this as killing a process requires
// PwrMgmt capability which we don't want to grant to all test exes.
TInt KillProcess(const TDesC& aProcessName)
	{
	_LIT(KProcessKiller, "t_processkiller");
	TRequestStatus stat;
	RProcess p;
	TInt result = p.Create(KProcessKiller, aProcessName);
	
	if(result == KErrNone)
		{
		// Asynchronous logon: completes when process terminates with process exit code
		p.Logon(stat);
		p.Resume();

		User::WaitForRequest(stat);
		result = p.ExitReason();
		p.Close();			
		}

	return result;
	}
// This function launches the TPropertyDefine process which
//	has WriteDeviceData Capabilities enabling it to create the P&S 
//	variables used by this test.
static void LaunchHelperL(TUid aCategory, TInt aKey, TInt aAttr)
	{
	_LIT(KConditionHelper, "TPropertyDefine");
	TRequestStatus stat;
	RProcess p;
	TBuf<32> args;
	args.AppendNum(aCategory.iUid);
	args.Append(KSeparator);
	args.AppendNum(aKey);
	args.Append(KSeparator);
	args.AppendNum(aAttr);
	User::LeaveIfError(p.Create(KConditionHelper, args,EOwnerProcess));
	
	// Asynchronous logon: completes when process terminates with process exit code
	p.Logon(stat);
	p.Resume();

	User::WaitForRequest(stat);
	TInt exitReason = p.ExitReason();
	p.Close();
	User::LeaveIfError(exitReason);
	}
Esempio n. 15
0
/**
   @SYMTestCaseID UIF-TCone7Step-TestWindowPositionL
  
   @SYMDEF PDEF109812: Draw optimization assumes children's position are relative to parent's 
  
   @SYMTestCaseDesc Launches the twindowposition application.
	The application test for position of the non window owning control being drawn.
	
   @SYMTestPriority High
  
   @SYMTestStatus Implemented
   
   @SYMTestActions : Launches an test application as follows.
	Instantiates a CApaCommandLine object. Creates the application KAppFileName using RProcess object
	and sets the process environment. Resumes the process and tests for application's exit reason. 
	The test application draw the controls such that when the child has a parent window and is not 
	relative to the the parent control's window.
	  
   @SYMTestExpectedResults The test application should be started without any error. 
	The test application exit with KErrNone if the position of the child window being drawn matches 
	with co-ordinate space of the parent control. Otherwise it exit with KErrWindowPosDoesNotMatch.

   @SYMTestType : CIT 
 */
TBool CCone7TestAppUi::TestWindowPositionL()
	{
	_LIT(KAppFileName,"z:\\sys\\bin\\twindowposition.exe");
	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();	
	RProcess windowPos;
	TInt ret = windowPos.Create(KAppFileName,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(windowPos);
	INFO_PRINTF1(_L("Create twindowposition process."));
	
	//attach commandline to twindowposition process
	TRAP(ret,cmdLine->SetProcessEnvironmentL(windowPos));
	TEST(ret == KErrNone);
	windowPos.Resume();
	//Time for the twindowposition process to launch itself
	User::After(3000000);
	TEST(windowPos.ExitReason() != KErrWindowPosDoesNotMatch);
	CleanupStack::PopAndDestroy(&windowPos);
	CleanupStack::PopAndDestroy(cmdLine);
	return ETrue;
	}
Esempio n. 16
0
TInt CCapabilityTestStep::CreateServerProcess(RSemaphore& aSemaphore)
{


	TInt err = KErrNone;

	const TUidType serverUid (KNullUid, KNullUid, KServerUid3);

	RProcess server;
	err = server.Create(KSipClientResolverServerName,_L(""),serverUid);
	if (err)
    {
		return err;
    }


	server.Resume ();
	aSemaphore.Wait();
	TInt exitReason = server.ExitReason();
	server.Close ();

    return exitReason;
}
Esempio n. 17
0
/**
@SYMTestCaseID          SYSLIB-LOGENG-CT-4002
@SYMTestCaseDesc	    Tests LogEng APIs for IPC Robustness
@SYMTestPriority 	    High
@SYMTestActions  	    The function calls each of the Logeng APIs through a custom session object
						passing random TInt, Des8 and Des16 data .
@SYMTestExpectedResults The server should be robust to all malformed messages and should not
						hang or panic.
@SYMDEF                	INC114113
*/
LOCAL_C void DoFuzzTestsL ()
    {  
    TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4002 "));
    RProcess server;
    
    LEAVE_IF_ERROR(LaunchServer(server));

    TExitDetails exitDetails;
      
    for(TInt i = 0;i< KNumFunctions;i++)
    	{
    	
    	//Carry out each type of test
    	for(TInt testType = 0; testType < 3;testType++)
    		{
       		//Carry out each test with number of arguments 1 - 4
    		for(TInt argCount = 1;argCount <= 4;argCount++)
    			{
    			PrintTestMessage(KFunctionNumbers[i], testType, argCount);

    			TestServerApi(KFunctionNumbers[i], testType, argCount, exitDetails);
		    	//Kill the server process and verify that it was still running
		    	//If the server was already dead it would return the reason it exited
	    		if(server.ExitType() != EExitPending)
	    			{
	    			server.Kill(0);
	    			TInt exitReason = server.ExitReason();
	    			server.Close();
	    			TEST2(exitReason, 0);    	
	    			LEAVE_IF_ERROR(LaunchServer(server));
	    			}
    			}
	    	
    		TheTest.Printf(_L("\nFuzz Test Successful\n"));
    		}
    	}
    }
Esempio n. 18
0
/**
   @SYMTestCaseID UIF-UIKON-0006
  
   @SYMDEF DEF097643
  
   @SYMTestCaseDesc Test 
  
   @SYMTestPriority High
  
   @SYMTestStatus Implemented
   
   @SYMTestActions This Method invokes terrorapp.exe.
     
   @SYMTestExpectedResults The Method should run terrorapp.exe successfully 
   and terrorapp.exe tests CEikErrorResolver::ResolveError() API by testing the error message resolved.
   Terrorapp.exe should terminate with KErrNone.
 */
void CAppTest::TestErrorAppL()
	{
	_LIT(KErrorAppFileName,"z:\\sys\\bin\\terrorapp.exe");
	RProcess errorAppProc;
	TRequestStatus appState;
	TBool jit = User::JustInTime();
	User::SetJustInTime(EFalse);
	TInt ret = errorAppProc.Create(KErrorAppFileName,KNullDesC);
	User::LeaveIfError(ret);
	CleanupClosePushL(errorAppProc);
	
	//Launching the application
	errorAppProc.Logon(appState);
	errorAppProc.Resume();
	User::WaitForRequest(appState);
	
	ret = errorAppProc.ExitReason();
	iAppUi->TEST(ret == KErrNone);

	CleanupStack::PopAndDestroy(&errorAppProc);
	User::SetJustInTime(jit);
	
	User::LeaveIfError(ret);	
	}
Esempio n. 19
0
/**
 @SYMTestCaseID	APPFWK-APPARC-0015

 @SYMPREQ	PREQ1123

 @SYMTestCaseDesc The Test determines that the Child dies when its Parent is terminated.

 @SYMTestPriority Critical

 @SYMTestStatus Implemented

 @SYMTestActions. Creates and launches a process (parent). Creates another process (child) passing the first(parent) process ID.
 Launches the child process. Terminates parent and checks the existance of child process. The child should die.
 API Calls:\n
 RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
 RProcess::Resume();
 RProcess::ExitType() const;
 RProcess::ExitReason() const;
 RProcess::Id() const;
 CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
 CApaCommandLine::NewLC();
 CApaCommandLine::SetParentProcessId(TProcessId);

 @SYMTestExpectedResults Termination of child process automatically.\n

 */
void CT_ProcStep::testChildSetToTerminateL(void)
	{
	TInt ret(0);

	//commandline for parent process
	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));

	//parent process
	RProcess parentProc;
	ret = parentProc.Create(KParentExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(parentProc);
	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);

	//attach commandline to parent process
	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine to Process "));

	INFO_PRINTF1(_L("	Run Parent Process "));
	parentProc.Resume();
	//Time for the parent process to launch itself
	User::After(500000);

	//commandline for child process
	//Get parent process ID here
	TUint64 parentProcId = parentProc.Id();
	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);

	CApaCommandLine* childProcCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child Process created "));

	//setting the parent process ID to child
	childProcCmdln->SetParentProcessId(parentProcId);
	INFO_PRINTF1(_L("	Set ParentProcessId to Child "));

	//child process
	RProcess childProc;
	ret = childProc.Create(KChildOneExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProc);
	
	INFO_PRINTF2(_L("	Create Child Process returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcCmdln->SetProcessEnvironmentL(childProc));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine to Process "));

	INFO_PRINTF1(_L("	Run Child Process "));
	childProc.Resume();
	//Time for the child process to launch itself
	User::After(500000);

	//child process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcId = childProc.Id();
	INFO_PRINTF2(_L("	Child Process Id = 0x%lx "),childProcId);

	CChildProcess* childProcess=NULL;
	TRAP(ret, childProcess=CChildProcess::NewL(parentProc,childProcId));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupStack::PushL(childProcess);

	TExitType exitType = parentProc.ExitType();
	TEST(exitType == EExitTerminate);
	TInt exitReason = parentProc.ExitReason();
	TEST(exitReason == 0);
	if(exitType==EExitTerminate && exitReason==0)
		{
		INFO_PRINTF1(_L("	Parent process is Terminated"));
		}
	
	exitType = childProc.ExitType();
	TEST(exitType == EExitTerminate);
	exitReason = childProc.ExitReason();
	TEST(exitReason == 0);
	if(exitType == EExitTerminate && exitReason==0)
		{
		INFO_PRINTF1(_L("	The child process is killed automatically ... "));
		}

	CleanupStack::PopAndDestroy(childProcess);
	CleanupStack::PopAndDestroy(&childProc);
	CleanupStack::PopAndDestroy(childProcCmdln);
	CleanupStack::PopAndDestroy(&parentProc);
	CleanupStack::PopAndDestroy(parentProcCmdln);
	}
Esempio n. 20
0
/**
 @SYMTestCaseID APPFWK-APPARC-0019

 @SYMPREQ PREQ1123

 @SYMTestCaseDesc The Test determines that more than one Child for a parent terminate on their Parent's termination.

 @SYMTestPriority Medium

 @SYMTestStatus Implemented

 @SYMTestActions. Creates and launches a process (parent). Creates 3 processes (child I,II,III) passing the first (parent) process ID.
 Launches all the 3 processes. Terminates parent and checks the existance of the child processes. All 3 children should die.
 API Calls:\n
 RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
 RProcess::Resume();
 RProcess::ExitType() const;
 RProcess::ExitReason() const;
 RProcess::Id() const;
 RProcess::Terminate(TInt aReason);
 CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
 CApaCommandLine::NewLC();
 CApaCommandLine::SetParentProcessId(TProcessId);
 
 @SYMTestExpectedResults Termination of all child processes automatically.\n

 */
void CT_ProcStep::testAllChildsSetToTerminateL(void)
	{
	TInt ret(0);

	//commandline for parent process
	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));

	//parent process
	RProcess parentProc;
	ret = parentProc.Create(KParentExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(parentProc);
	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);

	//attach commandline to parent process
	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine to Process "));

	INFO_PRINTF1(_L("	Run Parent Process "));
	parentProc.Resume();
	//Time for the parent process to launch itself
	User::After(500000);

	//Get parent process ID here
	TUint64 parentProcId = parentProc.Id();
	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);

	//Child I
	CApaCommandLine* childProcOneCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child One created "));

	//setting the parent process ID to child
	childProcOneCmdln->SetParentProcessId(parentProcId);
	INFO_PRINTF1(_L("	Set ParentProcessId to Child One "));

	//Child process I
	RProcess childProcOne;
	ret = childProcOne.Create(KChildOneExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProcOne);
	
	INFO_PRINTF2(_L("	Create Child One returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcOneCmdln->SetProcessEnvironmentL(childProcOne));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine of Child One to its Process "));

	INFO_PRINTF1(_L("	Run Child One "));
	TRequestStatus childOnestatus;
	childProcOne.Rendezvous(childOnestatus);
	childProcOne.Resume();
	//Wait for the child process to launch itself
	User::WaitForRequest(childOnestatus);

	//child process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcOneId = childProcOne.Id();
	INFO_PRINTF2(_L("	Child One Id = 0x%lx "),childProcOneId);

	//Child II
	CApaCommandLine* childProcTwoCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child Two created "));

	//setting the parent process ID to child
	childProcTwoCmdln->SetParentProcessId(parentProcId);
	INFO_PRINTF1(_L("	Set ParentProcessId to Child Two "));

	//child process II
	RProcess childProcTwo;
	ret = childProcTwo.Create(KChildTwoExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProcTwo);
	
	INFO_PRINTF2(_L("	Create Child Two returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcTwoCmdln->SetProcessEnvironmentL(childProcTwo));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine of Child Two to its Process "));

	INFO_PRINTF1(_L("	Run Child Two "));
	TRequestStatus childTwostatus;
	childProcTwo.Rendezvous(childTwostatus);
	childProcTwo.Resume();
	//Wait for the child process to launch itself
	User::WaitForRequest(childTwostatus);

	//child process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcTwoId = childProcTwo.Id();
	INFO_PRINTF2(_L("	Child Two Id = 0x%lx "),childProcTwoId);

	//Child III
	CApaCommandLine* childProcThreeCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child Three created "));

	//setting the parent process ID to child
	childProcThreeCmdln->SetParentProcessId(parentProcId);
	INFO_PRINTF1(_L("	Set ParentProcessId to Child Three "));

	//child process III
	RProcess childProcThree;
	ret = childProcThree.Create(KChildThreeExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProcThree);
	
	INFO_PRINTF2(_L("	Create Child Three returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcThreeCmdln->SetProcessEnvironmentL(childProcThree));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine of Child Three to its Process "));

	TRequestStatus childThreestatus;
	childProcThree.Rendezvous(childThreestatus);
	childProcThree.Resume();

	//Wait for the child process to launch itself
	User::WaitForRequest(childThreestatus);

	//child process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcThreeId = childProcThree.Id();
	INFO_PRINTF2(_L("	Child Three Id = 0x%lx "),childProcThreeId);

	CChildProcess* childProcess=NULL;
	TRAP(ret, childProcess=CChildProcess::NewL(parentProc,childProcOneId));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupStack::PushL(childProcess);

	TExitType exitType = parentProc.ExitType();
	TEST(exitType == EExitTerminate);
	TInt exitReason = parentProc.ExitReason();
	TEST(exitReason == 0);
	INFO_PRINTF3(_L("	Parent process - Exit Type = %d, Exit Reason = %d"), exitType, exitReason);
	if(exitType == EExitTerminate && exitReason == 0)
		{
		INFO_PRINTF1(_L("	Parent process is Terminated "));
		}

	exitType = childProcOne.ExitType();
	TEST(exitType == EExitTerminate);
	exitReason = childProcOne.ExitReason();
	TEST(exitReason == 0);
	INFO_PRINTF3(_L("	Child I process - Exit Type = %d, Exit Reason = %d"), exitType, exitReason);
	if(exitType == EExitTerminate && exitReason == 0)
		{
		INFO_PRINTF1(_L("	Child I is killed "));
		}
	
	childProcTwo.Logon(childTwostatus);
	User::WaitForRequest(childTwostatus);
	exitType = childProcTwo.ExitType();
	TEST(exitType == EExitTerminate);
	exitReason = childProcTwo.ExitReason();
	TEST(exitReason == 0);
	INFO_PRINTF3(_L("	Child II process - Exit Type = %d, Exit Reason = %d"), exitType, exitReason);
	if(exitType == EExitTerminate && exitReason == 0)
		{
		INFO_PRINTF1(_L("	Child II is killed "));
		}

	//Wait to close the child process
	childProcThree.Logon(childThreestatus);
	User::WaitForRequest(childThreestatus);
	exitType = childProcThree.ExitType();
	TEST(exitType == EExitTerminate);
	exitReason = childProcThree.ExitReason();
	TEST(exitReason == 0);
	INFO_PRINTF3(_L("	Child III process - Exit Type = %d, Exit Reason = %d"), exitType, exitReason);
	if(exitType == EExitTerminate && exitReason == 0)
		{
		INFO_PRINTF1(_L("	Child III is killed "));
		}

	CleanupStack::PopAndDestroy(childProcess);
	CleanupStack::PopAndDestroy(&childProcThree);
	CleanupStack::PopAndDestroy(childProcThreeCmdln);
	CleanupStack::PopAndDestroy(&childProcTwo);
	CleanupStack::PopAndDestroy(childProcTwoCmdln);
	CleanupStack::PopAndDestroy(&childProcOne);
	CleanupStack::PopAndDestroy(childProcOneCmdln);
	CleanupStack::PopAndDestroy(&parentProc);
	CleanupStack::PopAndDestroy(parentProcCmdln);
	}
Esempio n. 21
0
/**
 @SYMTestCaseID APPFWK-APPARC-0020

 @SYMPREQ PREQ1123

 @SYMTestCaseDesc The Test determines that more than one Child for a Parent remain alive on their parent's termination.

 @SYMTestPriority Medium

 @SYMTestStatus Implemented

 @SYMTestActions. Creates and launches a process (parent). Creates 3 processes (child I,II,III) without passing the first (parent) process ID.
 Launches all the 3 processes. Terminates parent and checks the existance of the child processes. All 3 children should remain alive.
 API Calls:\n
 RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
 RProcess::Resume();
 RProcess::ExitType() const;
 RProcess::ExitReason() const;
 RProcess::Id() const;
 RProcess::Terminate(TInt aReason);
 CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
 CApaCommandLine::NewLC();
 
 @SYMTestExpectedResults Existence of all child processes.\n

 */
void CT_ProcStep::testNoChildSetToTerminateL(void)
	{
	TInt ret(0);

	//commandline for parent process
	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));

	//parent process
	RProcess parentProc;
	ret = parentProc.Create(KParentExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(parentProc);
	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);

	//attach commandline to parent process
	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine to Process "));

	INFO_PRINTF1(_L("	Run Parent Process "));
	parentProc.Resume();
	//Time for the parent process to launch itself
	User::After(500000);

	//commandline for child process
	//Get parent process ID here
	TUint64 parentProcId = parentProc.Id();
	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);

	//Child I
	CApaCommandLine* childProcOneCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child One created "));

	//child process
	RProcess childProcOne;
	ret = childProcOne.Create(KChildOneExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProcOne);
	
	INFO_PRINTF2(_L("	Create Child One returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcOneCmdln->SetProcessEnvironmentL(childProcOne));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine of Child One to its Process "));

	childProcOne.Resume();

	//Time for the child process to launch itself
	User::After(1000000);

	//child process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcOneId = childProcOne.Id();
	INFO_PRINTF2(_L("	Child Process Id = 0x%lx "),childProcOneId);

	//Child II
	CApaCommandLine* childProcTwoCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child Two created "));

	//child process
	RProcess childProcTwo;
	ret = childProcTwo.Create(KChildTwoExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProcTwo);
	
	INFO_PRINTF2(_L("	Create Child Two returned : %d "),ret);

	//attach commandline to child process
	TRAP(ret,childProcTwoCmdln->SetProcessEnvironmentL(childProcTwo));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine of Child Two to its Process "));

	INFO_PRINTF1(_L("	Run Child Two "));
	childProcTwo.Resume();
	//Time for the child process to launch itself
	User::After(1000000);

	//child process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcTwoId = childProcTwo.Id();
	INFO_PRINTF2(_L("	Child Two Id = 0x%lx "),childProcTwoId);

	//Child III
	CApaCommandLine* childProcThreeCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child Three created "));

	//child process
	RProcess childProcThree;
	ret = childProcThree.Create(KChildThreeExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProcThree);
	
	INFO_PRINTF2(_L("	Create Child Three returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcThreeCmdln->SetProcessEnvironmentL(childProcThree));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine of Child Three to its Process "));

	childProcThree.Resume();

	//Time for the child process to launch itself
	User::After(1000000);

	//child process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcThreeId = childProcThree.Id();
	INFO_PRINTF2(_L("	Child Three Id = 0x%lx "),childProcThreeId);

	parentProc.Terminate(KTProcTerminatingParent);
	TExitType exitType = parentProc.ExitType();
	TEST(exitType == EExitTerminate);
	TInt exitReason = parentProc.ExitReason();
	TEST(exitReason == KTProcTerminatingParent);
	INFO_PRINTF1(_L("	Terminating parent process "));

	//Time for the child processes to terminate if they really do
	User::After(500000);

	exitType = childProcOne.ExitType();
	TEST(exitType == EExitPending);
	if(exitType == EExitPending)
		{
		INFO_PRINTF1(_L("	Child I is still running "));
		INFO_PRINTF1(_L("	So Terminating it manually ... "));
		childProcOne.Terminate(KTProcTerminatingChildI);
		exitType = childProcOne.ExitType();
		TEST(exitType==EExitTerminate);
		exitReason = childProcOne.ExitReason();
		TEST(exitReason == KTProcTerminatingChildI);
		}

	exitType = childProcTwo.ExitType();
	TEST(exitType == EExitPending);
	if(exitType == EExitPending)
		{
		INFO_PRINTF1(_L("	Child II is still running "));
		INFO_PRINTF1(_L("	So Terminating it manually ... "));
		childProcTwo.Terminate(KTProcTerminatingChildII);
		exitType = childProcTwo.ExitType();
		TEST(exitType==EExitTerminate);
		exitReason = childProcTwo.ExitReason();
		TEST(exitReason == KTProcTerminatingChildII);
		}

	exitType = childProcThree.ExitType();
	TEST(exitType == EExitPending);
	if(exitType == EExitPending)
		{
		INFO_PRINTF1(_L("	Child III is still running "));
		INFO_PRINTF1(_L("	So Terminating it manually ... "));
		childProcThree.Terminate(KTProcTerminatingChildIII);
		exitType = childProcThree.ExitType();
		TEST(exitType==EExitTerminate);
		exitReason = childProcThree.ExitReason();
		TEST(exitReason == KTProcTerminatingChildIII);
		}

	CleanupStack::PopAndDestroy(&childProcThree);
	CleanupStack::PopAndDestroy(childProcThreeCmdln);
	CleanupStack::PopAndDestroy(&childProcTwo);
	CleanupStack::PopAndDestroy(childProcTwoCmdln);
	CleanupStack::PopAndDestroy(&childProcOne);
	CleanupStack::PopAndDestroy(childProcOneCmdln);
	CleanupStack::PopAndDestroy(&parentProc);
	CleanupStack::PopAndDestroy(parentProcCmdln);
	}
Esempio n. 22
0
/**
 @SYMTestCaseID APPFWK-APPARC-0022

 @SYMPREQ PREQ1123

 @SYMTestCaseDesc The Test determines that the child doesn't receive its parent process ID correctly, when not set during its creation.

 @SYMTestPriority Medium

 @SYMTestStatus Implemented

 @SYMTestActions. Creates and launches a process (parent). Creates another process (child) without setting any parent.
 Parent Process Id is passed to child through SetParameter API. Launches the child process. Child obtains the parent process Id from within.
 Child compares both the Id's. The Id's should not match each other.
 API Calls:\n
 RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
 RProcess::Resume();
 RProcess::ExitType() const;
 RProcess::ExitReason() const;
 RProcess::Id() const;
 RProcess::SetParameter(TInt aSlot, TInt aData);
 CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
 CApaCommandLine::NewLC();
 RFile::Open(RFs &aFs, const TDesC &aName, TUint aFileMode);
 RFile::Read(TInt aPos, TDes8 &aDes) const;
 RFile::Close();
 RFs::Connect(TInt aMessageSlots=KFileServerDefaultMessageSlots);
 RFs::Delete(const TDesC &aName);
 RFs::Close();
 @SYMTestExpectedResults Id received by child process should not match its parent process Id.\n

 */
void CT_ProcStep::testIdNotAvailableToChildL(void)
	{
	TInt ret(0);
	TInt exitReason(0);
	
	//commandline for parent process
	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));

	//parent process
	RProcess parentProc;
	ret = parentProc.Create(KParentExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(parentProc);
	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);

	//attach commandline to parent process
	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine to Process "));

	INFO_PRINTF1(_L("	Run Parent Process "));
	parentProc.Resume();
	//Time for the parent process to launch itself
	User::After(500000);

	//commandline for child process
	//Get parent process ID here
	TUint64 parentProcId = parentProc.Id();
	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);

	CApaCommandLine* childProcCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child Process created "));
	
	//child process
	RProcess childProc;
	ret = childProc.Create(KChildThreeExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProc);
	
	INFO_PRINTF2(_L("	Create Child Process returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcCmdln->SetProcessEnvironmentL(childProc));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine to Process "));

	//Setting the parent process Id in an environment slot for the child to receive.
	ret = childProc.SetParameter(12,parentProcId);
	TEST(ret == KErrNone);
	INFO_PRINTF2(_L("	Set the Parent Process Id - 0x%lx to Child through SetParameter API in Slot 12 "),parentProcId);

	INFO_PRINTF1(_L("	Run Child Process "));
	TRequestStatus status;
	childProc.Rendezvous(status);
	childProc.Resume();
	//Wait for the child process to launch itself
	User::WaitForRequest(status);

	RFs fs;
	RFile file;
	ret = fs.Connect();
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Create File server session "));

	ret = file.Open(fs,KFilePath,EFileWrite | EFileShareAny);
	TEST(ret == KErrNone);
	if(ret == KErrNone)
		{
		INFO_PRINTF1(_L("	File opened successfully "));
		TBuf8<5> readData;
		file.Read(0,readData);
		TBuf8<5> result(KTResultFail); 
		TEST(result==readData);
		if(result==readData)
			{
			INFO_PRINTF1(_L("	Child did not receive the parent process ID as intended..."));
			}
		else
			{
			INFO_PRINTF1(_L("	Child received the Wrong parent process ID ..."));
			}
		file.Close();
		fs.Delete(KFilePath);
		fs.Close();
		INFO_PRINTF1(_L("	File Close & Delete and Session Close "));
		}

	TExitType exitType = parentProc.ExitType();
	TEST(exitType == EExitPending);
	if(exitType == EExitPending)
		{
		INFO_PRINTF1(_L("	Parent is still running "));
		INFO_PRINTF1(_L("	So Terminating it manually ... "));
		parentProc.Terminate(KTProcTerminatingParent);
		exitType = parentProc.ExitType();
		TEST(exitType==EExitTerminate);
		exitReason = parentProc.ExitReason();
		TEST(exitReason == KTProcTerminatingParent);
		}

	exitType = childProc.ExitType();
	TEST(exitType == EExitPending);
	if(exitType == EExitPending)
		{
		INFO_PRINTF1(_L("	Child is still running "));
		INFO_PRINTF1(_L("	So Terminating it manually ... "));
		childProc.Terminate(KTProcTerminatingChildIII);
		exitType = childProc.ExitType();
		TEST(exitType==EExitTerminate);
		exitReason = childProc.ExitReason();
		TEST(exitReason == KTProcTerminatingChildIII);
		}

	CleanupStack::PopAndDestroy(&childProc);
	CleanupStack::PopAndDestroy(childProcCmdln);
	CleanupStack::PopAndDestroy(&parentProc);
	CleanupStack::PopAndDestroy(parentProcCmdln);
	}
Esempio n. 23
0
/**
 @SYMTestCaseID APPFWK-APPARC-0017

 @SYMPREQ PREQ1123

 @SYMTestCaseDesc Test determines that one Child remains and another terminates when their Parent terminates, based on their creation.

 @SYMTestPriority High

 @SYMTestStatus Implemented

 @SYMTestActions. Creates and launches a process (parent). Creates a process (child I) passing the first (parent) process ID.
 Creates a second process (child II) without passing the first (parent) process ID. Launches both the child processes.
 Terminates parent and checks the existance of both the child processes. Child I should die and Child II should remain alive.
 API Calls:\n
 RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
 RProcess::Resume();
 RProcess::ExitType() const;
 RProcess::ExitReason() const;
 RProcess::Id() const;
 RProcess::Terminate(TInt aReason);
 CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
 CApaCommandLine::NewLC();
 CApaCommandLine::SetParentProcessId(TProcessId);
 
 @SYMTestExpectedResults Termination of first child process and existence of the second.\n

 */
void CT_ProcStep::testTwoChildsOneToTerminateAndOtherToRemainL(void)
	{
	TInt ret(0);
	TExitType exitType;

	//commandline for parent process
	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));

	//parent process
	RProcess parentProc;
	ret = parentProc.Create(KParentExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(parentProc);
	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);

	//attach commandline to parent process
	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine to Process "));

	INFO_PRINTF1(_L("	Run Parent Process "));
	parentProc.Resume();
	//Time for the parent process to launch itself
	User::After(500000);

	//commandline for child process
	//Get parent process ID here
	TUint64 parentProcId = parentProc.Id();
	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx"),parentProcId);

	//For Child ONE
	CApaCommandLine* childProcOneCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child One created "));

	//setting the parent process ID to child I
	childProcOneCmdln->SetParentProcessId(parentProcId);
	INFO_PRINTF1(_L("	Set ParentProcessId to Child One "));

	//child process ONE
	RProcess childProcOne;
	ret = childProcOne.Create(KChildOneExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProcOne);
	
	INFO_PRINTF2(_L("	Create Child One returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcOneCmdln->SetProcessEnvironmentL(childProcOne));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine of Child One to its Process "));

	INFO_PRINTF1(_L("	Run Child One "));
	childProcOne.Resume();
	//Time for the child one to launch itself
	User::After(500000);

	//child process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcOneId = childProcOne.Id();
	INFO_PRINTF2(_L("	Child One Id = 0x%lx "),childProcOneId);

	//For Child TWO
	CApaCommandLine* childProcTwoCmdln=CApaCommandLine::NewLC();
	INFO_PRINTF1(_L("	CommandLine for Child Two created "));

	//child process TWO
	RProcess childProcTwo;
	ret = childProcTwo.Create(KChildTwoExe,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(childProcTwo);
	
	INFO_PRINTF2(_L("	Create Child Two returned : %d"),ret);

	//attach commandline to child process
	TRAP(ret,childProcTwoCmdln->SetProcessEnvironmentL(childProcTwo));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	INFO_PRINTF1(_L("	Attach CommandLine of Child Two to its Process "));

	INFO_PRINTF1(_L("	Run Child Two "));
	childProcTwo.Resume();
	//Time for the child one to launch itself
	User::After(500000);

	//child II process Id is reqd to monitor if it gets killed on its parent's termination
	TUint64 childProcTwoId = childProcTwo.Id();
	INFO_PRINTF2(_L("	Child Two Id = 0x%lx "),childProcTwoId);

	CChildProcess* childProcess=NULL;
	TRAP(ret, childProcess=CChildProcess::NewL(parentProc,childProcOneId));
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupStack::PushL(childProcess);

	exitType = parentProc.ExitType();
	TEST(exitType == EExitTerminate);
	TInt exitReason = parentProc.ExitReason();
	TEST(exitReason == 0);
	if(exitType==EExitTerminate && exitReason==0)
		{
		INFO_PRINTF1(_L("	Parent process is Terminated"));
		}
	
	exitType = childProcOne.ExitType();
	TEST(exitType == EExitTerminate);
	exitReason = childProcOne.ExitReason();
	TEST(exitReason == 0);
	if(exitType==EExitTerminate && exitReason==0)
		{
		INFO_PRINTF1(_L("	Child I is killed automatically ... "));
		}

	//Wait and see if child II terminates automatically...
	User::After(10000000);

	exitType = childProcTwo.ExitType();
	TEST(exitType == EExitPending);
	if(exitType==EExitPending)
		{
		INFO_PRINTF1(_L("	Child II running successfully"));
		childProcTwo.Terminate(KTProcTerminatingChildII);
		exitType = childProcTwo.ExitType();
		TEST(exitType==EExitTerminate);
		exitReason = childProcTwo.ExitReason();
		TEST(exitReason == KTProcTerminatingChildII);
		INFO_PRINTF1(_L("	So Terminated it manually ..."));
		}

	CleanupStack::PopAndDestroy(childProcess);
	CleanupStack::PopAndDestroy(&childProcTwo);
	CleanupStack::PopAndDestroy(childProcTwoCmdln);
	CleanupStack::PopAndDestroy(&childProcOne);
	CleanupStack::PopAndDestroy(childProcOneCmdln);
	CleanupStack::PopAndDestroy(&parentProc);
	CleanupStack::PopAndDestroy(parentProcCmdln);
	}