mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 10:00:01 +08:00 
			
		
		
		
	 833456e079
			
		
	
	833456e079
	
	
	
		
			
			This PR introduces a test suite for podman machine. It can currently be run on developers' local machines and is not part of the official CI testing; however, the expectation is that any work on machine should come with an accompanying test. At present, the test must be run on Linux. It is untested on Darwin. There is no Makefile target for the test. It can be run like `ginkgo -v pkg/machine/test/.`. It should be run as a unprivileged user. Signed-off-by: Brent Baude <bbaude@redhat.com>
		
			
				
	
	
		
			46 lines
		
	
	
		
			937 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			937 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package e2e
 | |
| 
 | |
| type listMachine struct {
 | |
| 	/*
 | |
| 		--format string   Format volume output using JSON or a Go template (default "{{.Name}}\t{{.VMType}}\t{{.Created}}\t{{.LastUp}}\t{{.CPUs}}\t{{.Memory}}\t{{.DiskSize}}\n")
 | |
| 		--noheading       Do not print headers
 | |
| 		-q, --quiet           Show only machine names
 | |
| 	*/
 | |
| 
 | |
| 	format    string
 | |
| 	noHeading bool
 | |
| 	quiet     bool
 | |
| 
 | |
| 	cmd []string
 | |
| }
 | |
| 
 | |
| func (i *listMachine) buildCmd(m *machineTestBuilder) []string {
 | |
| 	cmd := []string{"machine", "list"}
 | |
| 	if len(i.format) > 0 {
 | |
| 		cmd = append(cmd, "--format", i.format)
 | |
| 	}
 | |
| 	if i.noHeading {
 | |
| 		cmd = append(cmd, "--noheading")
 | |
| 	}
 | |
| 	if i.quiet {
 | |
| 		cmd = append(cmd, "--quiet")
 | |
| 	}
 | |
| 	i.cmd = cmd
 | |
| 	return cmd
 | |
| }
 | |
| 
 | |
| func (i *listMachine) withNoHeading() *listMachine {
 | |
| 	i.noHeading = true
 | |
| 	return i
 | |
| }
 | |
| 
 | |
| func (i *listMachine) withQuiet() *listMachine {
 | |
| 	i.quiet = true
 | |
| 	return i
 | |
| }
 | |
| 
 | |
| func (i *listMachine) withFormat(format string) *listMachine {
 | |
| 	i.format = format
 | |
| 	return i
 | |
| }
 |