// Create an OCI bundle in the specified directory.
//
// Note that the directory will be created, but it's parent is expected to exist.
//
// This function works by copying the already-created test bundle. Ideally,
// the bundle would be recreated for each test, but createRootfs() uses
// docker which on some systems is too slow, resulting in the tests timing
// out.
Create an OCI bundle in the specified directory.

Note that the directory will be created, but it's parent is expected to exist.

This function works by copying the already-created test bundle. Ideally,
the bundle would be recreated for each test, but createRootfs() uses
docker which on some systems is too slow, resulting in the tests timing
out.
// Create an OCI bundle in the specified directory . // // Note that the directory will be created but it ' s parent is expected to exist . // // This function works by copying the already - created test bundle . Ideally // the bundle would be recreated for each test but createRootfs () uses // docker which on some systems is too slow resulting in the tests timing // out .
func makeOCIBundle(bundleDir string) error {
	from := testBundleDir
	to := bundleDir
	base := filepath.Dir(bundleDir)
	for _, dir := range []string{from, base} {
		if !FileExists(dir) {
			return fmt.Errorf("BUG: directory %v should exist", dir)
		}
	}
	output, err := RunCommandFull([]string{"cp", "-a", from, to}, true)
	if err != nil {
		return fmt.Errorf("failed to copy test OCI bundle from %v to %v: %v (output: %v)", from, to, err, output)
	}
	return nil
}
func makeOCIBundle ( bundleDir string ) error { from := testBundleDir to := bundleDir base := filepath . Dir ( bundleDir ) for _ , dir := range [ ] string { from , base } { if ! FileExists ( dir ) { return fmt . Errorf ( " " , dir ) } } output , err := RunCommandFull ( [ ] string { " " , " " , from , to } , true ) if err != nil { return fmt . Errorf ( " " , from , to , err , output ) } return nil }
Create an OCI bundle in the specified directory.
Create an OCI bundle in the specified directory .
// only the basename of bundleDir needs to exist as bundleDir // will get created by cp(1).