diff options
Diffstat (limited to 'tests/frontend/project/plugins/randomelement.py')
-rw-r--r-- | tests/frontend/project/plugins/randomelement.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/frontend/project/plugins/randomelement.py b/tests/frontend/project/plugins/randomelement.py new file mode 100644 index 000000000..b36b75c8a --- /dev/null +++ b/tests/frontend/project/plugins/randomelement.py @@ -0,0 +1,36 @@ +import os + +from buildstream import Element + + +class RandomElement(Element): + BST_VIRTUAL_DIRECTORY = True + + def configure(self, node): + pass + + def preflight(self): + pass + + def get_unique_key(self): + pass + + def configure_sandbox(self, sandbox): + pass + + def stage(self, sandbox): + pass + + def assemble(self, sandbox): + rootdir = sandbox.get_virtual_directory() + outputdir = rootdir.descend("output", create=True) + + # Generate non-reproducible output + with outputdir.open_file("random", mode="wb") as f: + f.write(os.urandom(64)) + + return "/output" + + +def setup(): + return RandomElement |