os/security/cryptomgmtlibs/securitytestfw/test/captestframework/captestframeworkstep.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptomgmtlibs/securitytestfw/test/captestframework/captestframeworkstep.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,93 @@
     1.4 +/*
     1.5 +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +
    1.24 +/**
    1.25 + @file 
    1.26 +*/
    1.27 +#ifndef __CAPTESTFRAMEWORK_STEP_H__
    1.28 +#define __CAPTESTFRAMEWORK_STEP_H__
    1.29 +
    1.30 +#include <test/testexecutestepbase.h>
    1.31 +#include "captestframeworkserver.h"
    1.32 +
    1.33 +#include "captestframework.h"
    1.34 +
    1.35 +
    1.36 +struct TTestEnvironment
    1.37 +	{
    1.38 +	TTestEnvironment(const TCapabilitySet& aCaps, TUid aSid, TUid aVid, TBool aExpectPass);
    1.39 +	
    1.40 +	TCapabilitySet iCaps;
    1.41 +	TUid iSid;
    1.42 +	TUid iVid;
    1.43 +	TBool iExpectPass;
    1.44 +	};
    1.45 +
    1.46 +
    1.47 +class CCapTestFrameworkStep : public CTestStep
    1.48 +	{
    1.49 +public:
    1.50 +	enum TThoroughness 
    1.51 +		{
    1.52 +		EBasicChecks,			// Just test using no capabilities, and capabilities required
    1.53 +		EThoroughChecks,		// Test every subset required
    1.54 +		};
    1.55 +	
    1.56 +public:
    1.57 +	CCapTestFrameworkStep(TThoroughness aThoroughness = EBasicChecks);
    1.58 +	~CCapTestFrameworkStep();
    1.59 +	
    1.60 +	TVerdict doTestStepPreambleL();
    1.61 +	TVerdict doTestStepPostambleL();
    1.62 +	TVerdict doTestStepL();
    1.63 +
    1.64 +private:
    1.65 +	void RunTestDllL(const TDesC& aDllName);
    1.66 +	MCapabilityTestFactory* SetupFactoryL();
    1.67 +	
    1.68 +	void PrintCapabilitySet(const TCapabilitySet& aCapSet, const TDesC& aExtra=KNullDesC);
    1.69 +
    1.70 +	void RunTestStepL(MCapabilityTest* aTest);
    1.71 +
    1.72 +	void GenerateEnvironmentsL(const TCapabilitySet& aCapsNeeded, const TUid& aSidNeeded, const TUid& aVidNeeded, RArray<TTestEnvironment>& aEnvironments);
    1.73 +
    1.74 +	TCapabilitySet InvertCapSet(const TCapabilitySet& aCapSet);
    1.75 +
    1.76 +	
    1.77 +	// Sets the helper up with capabilities
    1.78 +	void SetupHelperL(const TTestEnvironment& aEnvironment);
    1.79 +	
    1.80 +	// Runs helper
    1.81 +	void RunHelperL(TInt aTestNumber, TBool aShouldPass);
    1.82 +
    1.83 +private:
    1.84 +	RFs iFs;
    1.85 +	TThoroughness iThoroughness;
    1.86 +	TInt iCurrentTest;
    1.87 +	MCapabilityTestFactory* iFactory;
    1.88 +	RLibrary iLibrary;
    1.89 +	TPtrC iDllName;
    1.90 +	TBool iOmitTCBCapInComplementSet; // This functionality is needed for testing components that don't have the TCB capability, for example the SIF API.
    1.91 +	};
    1.92 +
    1.93 +_LIT(KRunBasicCapabilityChecks,"RunBasicCapabilityChecks");
    1.94 +_LIT(KRunThoroughCapabilityChecks,"RunThoroughCapabilityChecks");
    1.95 +
    1.96 +#endif /* #ifndef __CAPTESTFRAMEWORK_STEP_H__ */