-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: adds sync_upstream to ssp_authoring_e2e test
Signed-off-by: Jennifer Power <[email protected]>
- Loading branch information
Showing
4 changed files
with
277 additions
and
33 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 |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
TRESTLEBOT_TEST_IMAGE_NAME, | ||
build_test_image, | ||
clean, | ||
repo_setup, | ||
) | ||
from trestlebot import const | ||
from trestlebot.transformers.trestle_rule import ( | ||
|
@@ -58,28 +59,7 @@ def tmp_repo() -> YieldFixture[Tuple[str, Repo]]: | |
"""Create a temporary git repository with an initialized trestle workspace root""" | ||
with TemporaryDirectory(prefix=_TEST_PREFIX) as tmpdir: | ||
tmp_path = pathlib.Path(tmpdir) | ||
try: | ||
args = argparse.Namespace( | ||
verbose=0, | ||
trestle_root=tmp_path, | ||
full=True, | ||
local=False, | ||
govdocs=False, | ||
) | ||
init = InitCmd() | ||
init._run(args) | ||
except Exception as e: | ||
raise TrestleError( | ||
f"Initialization failed for temporary trestle directory: {e}." | ||
) | ||
repo = Repo.init(tmpdir) | ||
with repo.config_writer() as config: | ||
config.set_value("user", "email", "[email protected]") | ||
config.set_value("user", "name", "Test User") | ||
repo.git.add(all=True) | ||
repo.index.commit("Initial commit") | ||
# Create a default branch (main) | ||
repo.git.checkout("-b", "main") | ||
repo: Repo = repo_setup(tmp_path) | ||
yield tmpdir, repo | ||
|
||
try: | ||
|
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,143 @@ | ||
{ | ||
"profile": { | ||
"uuid": "1019f424-1556-4aa3-9df3-337b97c2c856", | ||
"metadata": { | ||
"title": "NIST Special Publication 800-53 Revision 5 MODERATE IMPACT BASELINE", | ||
"last-modified": "2021-06-08T13:57:34.337491-04:00", | ||
"version": "Final", | ||
"oscal-version": "1.0.0", | ||
"roles": [ | ||
{ | ||
"id": "creator", | ||
"title": "Document Creator" | ||
}, | ||
{ | ||
"id": "contact", | ||
"title": "Contact" | ||
} | ||
], | ||
"parties": [ | ||
{ | ||
"uuid": "cde369ce-57f8-4ec1-847f-2681a9a881e7", | ||
"type": "organization", | ||
"name": "Joint Task Force, Transformation Initiative", | ||
"email-addresses": [ | ||
"[email protected]" | ||
], | ||
"addresses": [ | ||
{ | ||
"addr-lines": [ | ||
"National Institute of Standards and Technology", | ||
"Attn: Computer Security Division", | ||
"Information Technology Laboratory", | ||
"100 Bureau Drive (Mail Stop 8930)" | ||
], | ||
"city": "Gaithersburg", | ||
"state": "MD", | ||
"postal-code": "20899-8930" | ||
} | ||
] | ||
} | ||
], | ||
"responsible-parties": [ | ||
{ | ||
"role-id": "creator", | ||
"party-uuids": [ | ||
"cde369ce-57f8-4ec1-847f-2681a9a881e7" | ||
] | ||
}, | ||
{ | ||
"role-id": "contact", | ||
"party-uuids": [ | ||
"cde369ce-57f8-4ec1-847f-2681a9a881e7" | ||
] | ||
} | ||
] | ||
}, | ||
"imports": [ | ||
{ | ||
"href": "trestle://catalogs/simplified_nist_catalog/catalog.json", | ||
"include-controls": [ | ||
{ | ||
"with-ids": [ | ||
"ac-1", | ||
"ac-2", | ||
"ac-2.1", | ||
"ac-2.2", | ||
"ac-2.3", | ||
"ac-2.4", | ||
"ac-2.5", | ||
"ac-2.13", | ||
"ac-3", | ||
"ac-4", | ||
"ac-4.4", | ||
"ac-5", | ||
"ac-6" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"merge": { | ||
"as-is": true | ||
}, | ||
"modify": { | ||
"set-parameters": [ | ||
{ | ||
"param_id": "ac-1_prm_1", | ||
"class": "newclassfromprof", | ||
"depends-on": "newdependsonfromprof", | ||
"usage": "new usage from prof", | ||
"props": [ | ||
{ | ||
"name": "param_1_prop", | ||
"value": "prop value from prof" | ||
}, | ||
{ | ||
"name": "param_1_prop_2", | ||
"value": "new prop value from prof" | ||
} | ||
], | ||
"links": [ | ||
{ | ||
"href": "#123456789", | ||
"text": "new text from prof" | ||
}, | ||
{ | ||
"href": "#new_link", | ||
"text": "new link text" | ||
} | ||
], | ||
"constraints": [ | ||
{ | ||
"description": "new constraint" | ||
} | ||
], | ||
"guidelines": [ | ||
{ | ||
"prose": "new guideline" | ||
} | ||
] | ||
}, | ||
{ | ||
"param_id": "ac-4.4_prm_3", | ||
"values": [ | ||
"hacking the system" | ||
] | ||
}, | ||
{ | ||
"param_id": "loose_2", | ||
"values": [ | ||
"loose_2_val_from_prof" | ||
] | ||
}, | ||
{ | ||
"param_id": "bad_param_id", | ||
"values": [ | ||
"this will cause warning" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
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
Oops, something went wrong.