-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #991: Fixed mock scripts and added testcases for namespace crea…
…tion Details: * Increased minimum version of pywbem to 1.4.0 (for now, pulling from branch). * Fixed the simple_interop_mock_script.py mock script so that it now creates the Interop MOF always in the interop namespace. The user MOF continues to be created in the default namespace. * Added a simple_foo_mock_script.py mock script that prepares an Interop namespace and then compiles user MOF into a namespace determined by the pragma namespace in the MOF. * Added a new test file test_namespace_creation.py for various cases of namespace creation. * For consistency, changed the simple_disablepull_mock_script.py mock script to also set up the Interop namespace in the same way, and to compile user MOF into root/cimv2, resulting in the same namespace setup as before the change. * This allowed deletion of the no longer used simple_interop_mock_model.mof file, which was a somewhat simple minded approach to setting up an Interop namespace. * Adjusted the expected error message for Interop namespace not found due to a corresponding change in pywbem 1.4.0. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
- Loading branch information
1 parent
3a9493f
commit 69d8578
Showing
11 changed files
with
869 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,225 @@ | ||
// This is a simple mof model that creates the qualifier declarations, | ||
// classes, and instances for a very simplistic model to be used in the | ||
// pywbemcli mock test environment. This model is used for the user | ||
// namespace. | ||
|
||
#pragma locale ("en_US") | ||
#pragma namespace ("foo") | ||
|
||
Qualifier Association : boolean = false, | ||
Scope(association), | ||
Flavor(DisableOverride, ToSubclass); | ||
|
||
Qualifier Indication : boolean = false, | ||
Scope(class, indication), | ||
Flavor(DisableOverride, ToSubclass); | ||
|
||
Qualifier Abstract : boolean = false, | ||
Scope(class, association, indication), | ||
Flavor(EnableOverride, Restricted); | ||
|
||
Qualifier Aggregate : boolean = false, | ||
Scope(reference), | ||
Flavor(DisableOverride, ToSubclass); | ||
|
||
Qualifier EmbeddedInstance : string = null, | ||
Scope(property, method, parameter); | ||
|
||
Qualifier EmbeddedObject : boolean = false, | ||
Scope(property, method, parameter), | ||
Flavor(DisableOverride, ToSubclass); | ||
|
||
Qualifier Description : string = null, | ||
Scope(any), | ||
Flavor(EnableOverride, ToSubclass, Translatable); | ||
|
||
Qualifier In : boolean = true, | ||
Scope(parameter), | ||
Flavor(DisableOverride, ToSubclass); | ||
|
||
Qualifier Key : boolean = false, | ||
Scope(property, reference), | ||
Flavor(DisableOverride, ToSubclass); | ||
|
||
Qualifier Out : boolean = false, | ||
Scope(parameter), | ||
Flavor(DisableOverride, ToSubclass); | ||
|
||
Qualifier Override : string = null, | ||
Scope(property, reference, method), | ||
Flavor(EnableOverride, Restricted); | ||
|
||
Qualifier Static : boolean = false, | ||
Scope(property, method), | ||
Flavor(DisableOverride, ToSubclass); | ||
|
||
[Abstract, Description ("Base class for classes that are referenced")] | ||
class CIM_BaseRef { | ||
[Key, Description ("This is key property.")] | ||
string InstanceID; | ||
}; | ||
|
||
[Description ("Class 1 that is referenced")] | ||
class CIM_FooRef1 : CIM_BaseRef {}; | ||
|
||
[Description ("Class 2 that is referenced")] | ||
class CIM_FooRef2 : CIM_BaseRef {}; | ||
|
||
[Association, Description ("Simple CIM Association")] | ||
class CIM_FooAssoc { | ||
|
||
[Key, Description ("This is key property.")] | ||
CIM_FooRef1 REF Ref1; | ||
|
||
[Key, Description ("This is key property.")] | ||
CIM_FooRef2 REF Ref2; | ||
}; | ||
|
||
[Abstract, Description ("Base class for classes having embedded instances")] | ||
class CIM_BaseEmb {}; | ||
|
||
[Description ("Class 1 that has embedded instances")] | ||
class CIM_FooEmb1 : CIM_BaseEmb {}; | ||
|
||
[Description ("Class 2 that has embedded instances")] | ||
class CIM_FooEmb2 : CIM_BaseEmb {}; | ||
|
||
[Description ("Class 3 that has embedded instances")] | ||
class CIM_FooEmb3 : CIM_BaseEmb {}; | ||
|
||
[Description ("Simple CIM Class")] | ||
class CIM_Foo { | ||
[Key, Description ("This is key property.")] | ||
string InstanceID; | ||
|
||
[Description ("This is Uint32 property.")] | ||
uint32 IntegerProp; | ||
|
||
[Description("Embedded instance property"), EmbeddedInstance("CIM_FooEmb3")] | ||
string cimfoo_emb3; | ||
|
||
[Description ("Method with in and out parameters")] | ||
uint32 Fuzzy( | ||
[IN, OUT, Description("Define data to be returned in output parameter")] | ||
string TestInOutParameter, | ||
[IN, OUT, Description ( "Test of ref in/out parameter")] | ||
CIM_FooRef1 REF TestRef, | ||
[IN ( false ), OUT, Description("Rtns method name if exists on input")] | ||
string OutputParam, | ||
[IN , Description("Defines return value if provided.")] | ||
uint32 OutputRtnValue); | ||
|
||
[Description ("Static method with in and out parameters"), Static] | ||
uint32 FuzzyStatic( | ||
[IN, OUT, Description("Define data to be returned in output parameter")] | ||
string TestInOutParameter, | ||
[IN, OUT, Description ( "Test of ref in/out parameter")] | ||
CIM_Foo REF TestRef, | ||
[IN ( false ), OUT, Description("Rtns method name if exists on input")] | ||
string OutputParam, | ||
[IN , Description("Defines return value if provided.")] | ||
uint32 OutputRtnValue, | ||
[IN, Description("Embedded instance parameter"), EmbeddedInstance("CIM_FooEmb1")] | ||
string cimfoo_emb1); | ||
|
||
[ Description("Method with no parameters but embedded instance return"), | ||
EmbeddedInstance("CIM_FooEmb2") ] | ||
string DeleteNothing(); | ||
}; | ||
|
||
[Description ("Subclass of CIM_Foo")] | ||
class CIM_Foo_sub : CIM_Foo { | ||
string cimfoo_sub; | ||
}; | ||
|
||
[Description ("Subclass of CIM_Foo_sub")] | ||
class CIM_Foo_sub_sub : CIM_Foo_sub { | ||
string cimfoo_sub_sub; | ||
[Description("Sample method with input and output parameters")] | ||
uint32 Method1( | ||
[IN ( false), OUT, Description("Response param 2")] | ||
string OutputParam2); | ||
}; | ||
|
||
class CIM_Foo_sub2 : CIM_Foo { | ||
string cimfoo_sub2; | ||
}; | ||
|
||
|
||
// 1 instance of each CIM_FooRef* class | ||
|
||
instance of CIM_FooRef1 as $fooref11 { | ||
InstanceID = "CIM_FooRef11"; | ||
}; | ||
|
||
instance of CIM_FooRef2 as $fooref21 { | ||
InstanceID = "CIM_FooRef21"; | ||
}; | ||
|
||
|
||
// 1 instance of CIM_FooAssoc | ||
|
||
instance of CIM_FooAssoc as $fooassoc1 { | ||
Ref1 = $fooref11; | ||
Ref2 = $fooref21; | ||
}; | ||
|
||
|
||
// 5 instances of CIM_Foo class | ||
|
||
instance of CIM_Foo as $foo1 { | ||
InstanceID = "CIM_Foo1"; | ||
IntegerProp = 1; | ||
}; | ||
|
||
instance of CIM_Foo as $foo2 { | ||
InstanceID = "CIM_Foo2"; | ||
IntegerProp = 2; | ||
}; | ||
|
||
instance of CIM_Foo as $foo3 { InstanceID = "CIM_Foo3"; }; | ||
|
||
instance of CIM_Foo as $foo3 { InstanceID = "CIM_Foo30"; }; | ||
|
||
instance of CIM_Foo as $foo3 { InstanceID = "CIM_Foo31"; }; | ||
|
||
|
||
// 4 instances of CIM_Foo_sub class | ||
|
||
instance of CIM_Foo_sub as $foosub1{ | ||
InstanceID = "CIM_Foo_sub1"; | ||
IntegerProp = 4; | ||
}; | ||
|
||
instance of CIM_Foo_sub as $foosub1{ | ||
InstanceID = "CIM_Foo_sub2"; | ||
IntegerProp = 5; | ||
}; | ||
|
||
instance of CIM_Foo_sub as $foosub1{ | ||
InstanceID = "CIM_Foo_sub3"; | ||
IntegerProp = 6; | ||
}; | ||
|
||
instance of CIM_Foo_sub as $foosub1{ | ||
InstanceID = "CIM_Foo_sub4"; | ||
IntegerProp = 7; | ||
}; | ||
|
||
// 3 instances of CIM_Foo_sub_sub | ||
|
||
instance of CIM_Foo_sub_sub as $foosubsub1{ | ||
InstanceID = "CIM_Foo_sub_sub1"; | ||
IntegerProp = 8; | ||
}; | ||
|
||
instance of CIM_Foo_sub_sub as $foosubsub1{ | ||
InstanceID = "CIM_Foo_sub_sub2"; | ||
IntegerProp = 9; | ||
}; | ||
|
||
instance of CIM_Foo_sub_sub as $foosubsub1{ | ||
InstanceID = "CIM_Foo_sub_sub3"; | ||
IntegerProp = 10; | ||
|
||
}; |
Oops, something went wrong.