(t *testing.T)
| 60 | } |
| 61 | |
| 62 | func (c cacheTests) testNoninteractiveCacheCmds(t *testing.T) { |
| 63 | tests := []struct { |
| 64 | name string |
| 65 | options []string |
| 66 | needImage bool |
| 67 | expectedEmptyCache bool |
| 68 | expectedOutput string |
| 69 | exit int |
| 70 | }{ |
| 71 | { |
| 72 | name: "clean force", |
| 73 | options: []string{"clean", "--force"}, |
| 74 | expectedOutput: "", |
| 75 | needImage: true, |
| 76 | expectedEmptyCache: true, |
| 77 | exit: 0, |
| 78 | }, |
| 79 | { |
| 80 | name: "clean force days beyond age", |
| 81 | options: []string{"clean", "--force", "--days", "30"}, |
| 82 | expectedOutput: "", |
| 83 | needImage: true, |
| 84 | expectedEmptyCache: false, |
| 85 | exit: 0, |
| 86 | }, |
| 87 | { |
| 88 | name: "clean force days within age", |
| 89 | options: []string{"clean", "--force", "--days", "0"}, |
| 90 | expectedOutput: "", |
| 91 | needImage: true, |
| 92 | expectedEmptyCache: true, |
| 93 | exit: 0, |
| 94 | }, |
| 95 | { |
| 96 | name: "clean help", |
| 97 | options: []string{"clean", "--help"}, |
| 98 | expectedOutput: "Clean your local Apptainer cache", |
| 99 | needImage: false, |
| 100 | exit: 0, |
| 101 | }, |
| 102 | { |
| 103 | name: "list help", |
| 104 | options: []string{"list", "--help"}, |
| 105 | expectedOutput: "List your local Apptainer cache", |
| 106 | needImage: false, |
| 107 | exit: 0, |
| 108 | }, |
| 109 | { |
| 110 | name: "list type", |
| 111 | options: []string{"list", "--type", "net"}, |
| 112 | needImage: true, |
| 113 | expectedOutput: "There are 1 container file", |
| 114 | expectedEmptyCache: false, |
| 115 | exit: 0, |
| 116 | }, |
| 117 | { |
| 118 | name: "list verbose", |
| 119 | needImage: true, |
nothing calls this directly
no test coverage detected