ocitools icon indicating copy to clipboard operation
ocitools copied to clipboard

Convert test_runtime.sh into a go program

Open mrunalp opened this issue 10 years ago • 5 comments

mrunalp avatar Nov 12 '15 20:11 mrunalp

The similar go implementation is here: https://github.com/huawei-openlab/oct/blob/master/validate.go But that is designed for testing multiple cases. I'd like to prepare a single-case one based on your test_runtime.sh and the change in #7 .

I have a question, where should we put the new program to? It is higher level of the current ocitools.

liangchenye avatar Nov 13 '15 15:11 liangchenye

@liangchenye We can have a program here that takes a path to a rootfs and a test case to start with.

mrunalp avatar Nov 16 '15 23:11 mrunalp

The go program is here: https://github.com/liangchenye/ocitools/blob/master/testRuntime.go which is made from oct/validate.go. The command line is not supported yet. Should it became a part of main.go?

liangchenye avatar Nov 19 '15 13:11 liangchenye

@liangchenye Nice! I think it should be a part of main.go. There is a validate which I intended for spec validation. Maybe --runtime or a separate command for runtime validation.

mrunalp avatar Nov 21 '15 01:11 mrunalp

@mrunalp new PR submitted. That is used to verify if a bundle was valid. The code was modified from bundleValidator in OCT. I think it is the 'spec validation' right?

Once the hashing and the archival format are defined in OCI, the relevant codes will also be added to bundle.go.

liangchenye avatar Nov 24 '15 07:11 liangchenye