-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- modified testInfo parser - added new tests for feature tag Signed-off-by: renfeiw <[email protected]>
- Loading branch information
Showing
3 changed files
with
151 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!-- | ||
# 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 | ||
# | ||
# https://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. | ||
--> | ||
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../TKG/playlist.xsd"> | ||
<test> | ||
<testCaseName>testFeatureFips</testCaseName> | ||
<command>echo "match FIPS140_3_20220501 and everything else by default"; \ | ||
$(TEST_STATUS)</command> | ||
<features> | ||
<feature>FIPS140_3_20220501:applicable</feature> | ||
</features> | ||
</test> | ||
|
||
<test> | ||
<testCaseName>testFeatureFipsNoApplicable</testCaseName> | ||
<command>echo "test excluded on FIPS140_2"; \ | ||
$(TEST_STATUS)</command> | ||
<features> | ||
<feature>FIPS140_2:nonapplicable</feature> | ||
</features> | ||
</test> | ||
|
||
<test> | ||
<testCaseName>testFeatureFipsRequired</testCaseName> | ||
<command>echo "only run on FIPS140_3_20220101"; \ | ||
$(TEST_STATUS)</command> | ||
<features> | ||
<feature>FIPS140_3_20220101:required</feature> | ||
</features> | ||
</test> | ||
|
||
<test> | ||
<testCaseName>testFeatureFipsRegexRequired</testCaseName> | ||
<command>echo "only run on FIPS140_3 from 2022 Dec 01 to 2029 Dec 31"; \ | ||
$(TEST_STATUS)</command> | ||
<features> | ||
<feature>/FIPS140_3_(2022(12\d(2))|202[3-9]\d{4})/:required</feature> | ||
</features> | ||
</test> | ||
</playlist> |
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,56 @@ | ||
################################################################################ | ||
# 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 | ||
# | ||
# https://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. | ||
################################################################################ | ||
|
||
import subprocess | ||
from utils import * | ||
|
||
def run_test(): | ||
rt = True | ||
printTestheader("feature") | ||
|
||
buildList = "TKG/examples/feature" | ||
command = "make _all" | ||
print(f"\t{command}") | ||
result = subprocess.run(f"{EXPORT_BUILDLIST}={buildList}; {CD_TKG}; {MAKE_CLEAN}; {MAKE_COMPILE}; {command}", stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True, check=False) | ||
rt = checkResult(result, {'testFeatureFips_0', 'testFeatureFipsNoApplicable_0'}, set(), set(), set()) | ||
|
||
buildList = "TKG/examples/feature" | ||
command = "make _all" | ||
testFlag = "export TEST_FLAG=FIPS140_2" | ||
print(f"\t{testFlag}; {command}") | ||
result = subprocess.run(f"{EXPORT_BUILDLIST}={buildList}; {testFlag}; {CD_TKG}; {MAKE_CLEAN}; {MAKE_COMPILE}; {command}", stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True, check=False) | ||
rt = checkResult(result, {'testFeatureFips_0'}, set(), set(), set()) | ||
|
||
command = "make _all" | ||
testFlag = "export TEST_FLAG=FIPS140_3_20220501" | ||
print(f"\t{testFlag}; {command}") | ||
result = subprocess.run(f"{EXPORT_BUILDLIST}={buildList}; {testFlag}; {CD_TKG}; {MAKE_CLEAN}; {MAKE_COMPILE}; {command}", stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True, check=False) | ||
rt = checkResult(result, {'testFeatureFips_0', 'testFeatureFipsNoApplicable_0'}, set(), set(), set()) | ||
|
||
command = "make _all" | ||
testFlag = "export TEST_FLAG=FIPS140_3_20230511" | ||
print(f"\t{testFlag}; {command}") | ||
result = subprocess.run(f"{EXPORT_BUILDLIST}={buildList}; {testFlag}; {CD_TKG}; {MAKE_CLEAN}; {MAKE_COMPILE}; {command}", stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True, check=False) | ||
rt = checkResult(result, {'testFeatureFips_0', 'testFeatureFipsNoApplicable_0', 'testFeatureFipsRegexRequired_0'}, set(), set(), set()) | ||
|
||
command = "make _all" | ||
testFlag = "export TEST_FLAG=FIPS140_3_20220101" | ||
print(f"\t{testFlag}; {command}") | ||
result = subprocess.run(f"{EXPORT_BUILDLIST}={buildList}; {testFlag}; {CD_TKG}; {MAKE_CLEAN}; {MAKE_COMPILE}; {command}", stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True, check=False) | ||
rt = checkResult(result, {'testFeatureFips_0', 'testFeatureFipsNoApplicable_0', 'testFeatureFipsRequired_0'}, set(), set(), set()) | ||
|
||
return rt | ||
|
||
if __name__ == "__main__": | ||
run_test() |
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