cmd

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "container-structure-test",
	Short: "container-structure-test provides a framework to test the structure of a container image",
	Long: `container-structure-test provides a powerful framework to validate
the structure of a container image.
These tests can be used to check the output of commands in an image, 
as well as verify metadata and contents of the filesystem.`,
	PersistentPreRun: func(c *cobra.Command, s []string) {
		ll, err := logrus.ParseLevel(logLevel)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
		logrus.SetLevel(ll)
	},
}
View Source
var TestCmd = &cobra.Command{
	Use:   "test",
	Short: "Runs the tests",
	Long:  `Runs the tests`,
	Args: func(cmd *cobra.Command, _ []string) error {
		return validateArgs()
	},
	Run: func(cmd *cobra.Command, _ []string) {
		out := &output.OutWriter{
			Verbose: verbose,
			Quiet:   quiet,
		}
		if pass := Run(out); pass {
			os.Exit(0)
		} else {
			os.Exit(1)
		}
	},
}

Functions

func Parse

func Parse(fp string) (types.StructureTest, error)

func Run

func Run(out *output.OutWriter) bool

func RunTests

func RunTests(out *output.OutWriter) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL