Skip to content

Commit 9bbad89

Browse files
committed
chore: move tests
1 parent df1581d commit 9bbad89

1 file changed

Lines changed: 58 additions & 58 deletions

File tree

‎internal/setup/setup_test.go‎

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ var setupTests = []setupTest{{
27362736
},
27372737
relerror: `chisel.yaml: v2-archives is obsolete since format v2`,
27382738
}, {
2739-
summary: "Invalid pro in archives ignored in format v2/v3",
2739+
summary: "Invalid pro in archives ignored",
27402740
input: map[string]string{
27412741
"chisel.yaml": `
27422742
format: v3
@@ -2792,6 +2792,63 @@ var setupTests = []setupTest{{
27922792
EndOfLife: time.Date(2010, time.November, 12, 0, 0, 0, 0, time.UTC),
27932793
},
27942794
},
2795+
}, {
2796+
summary: "Invalid pro in archives ignored in v2-archives",
2797+
input: map[string]string{
2798+
"chisel.yaml": `
2799+
format: v1
2800+
maintenance:
2801+
standard: 2001-02-03
2802+
end-of-life: 2010-11-12
2803+
archives:
2804+
ubuntu:
2805+
version: 20.04
2806+
suites: [focal]
2807+
components: [main]
2808+
public-keys: [test-key]
2809+
default: true
2810+
v2-archives:
2811+
ubuntu-invalid:
2812+
pro: invalid-pro
2813+
version: 20.04
2814+
components: [main]
2815+
suites: [focal]
2816+
public-keys: [test-key]
2817+
public-keys:
2818+
test-key:
2819+
id: ` + testKey.ID + `
2820+
armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + `
2821+
`,
2822+
"slices/mydir/mypkg.yaml": `
2823+
package: mypkg
2824+
`,
2825+
},
2826+
release: &setup.Release{
2827+
Format: "v1",
2828+
Archives: map[string]*setup.Archive{
2829+
"ubuntu": {
2830+
Name: "ubuntu",
2831+
Version: "20.04",
2832+
Suites: []string{"focal"},
2833+
Components: []string{"main"},
2834+
Priority: 1,
2835+
PubKeys: []*packet.PublicKey{testKey.PubKey},
2836+
Maintained: false,
2837+
OldRelease: true,
2838+
},
2839+
},
2840+
Packages: map[string]*setup.Package{
2841+
"mypkg": {
2842+
Name: "mypkg",
2843+
Path: "slices/mydir/mypkg.yaml",
2844+
Slices: map[string]*setup.Slice{},
2845+
},
2846+
},
2847+
Maintenance: &setup.Maintenance{
2848+
Standard: time.Date(2001, time.February, 3, 0, 0, 0, 0, time.UTC),
2849+
EndOfLife: time.Date(2010, time.November, 12, 0, 0, 0, 0, time.UTC),
2850+
},
2851+
},
27952852
}, {
27962853
summary: "Maintenance all dates",
27972854
input: map[string]string{
@@ -2961,63 +3018,6 @@ var setupTests = []setupTest{{
29613018
`,
29623019
},
29633020
relerror: `chisel.yaml: cannot parse maintenance: expected format for "standard" is YYYY-MM-DD`,
2964-
}, {
2965-
summary: "Maintenance: invalid pro in v2-archives ignored",
2966-
input: map[string]string{
2967-
"chisel.yaml": `
2968-
format: v1
2969-
maintenance:
2970-
standard: 2001-02-03
2971-
end-of-life: 2010-11-12
2972-
archives:
2973-
ubuntu:
2974-
version: 20.04
2975-
suites: [focal]
2976-
components: [main]
2977-
public-keys: [test-key]
2978-
default: true
2979-
v2-archives:
2980-
ubuntu-invalid:
2981-
pro: invalid-pro
2982-
version: 20.04
2983-
components: [main]
2984-
suites: [focal]
2985-
public-keys: [test-key]
2986-
public-keys:
2987-
test-key:
2988-
id: ` + testKey.ID + `
2989-
armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + `
2990-
`,
2991-
"slices/mydir/mypkg.yaml": `
2992-
package: mypkg
2993-
`,
2994-
},
2995-
release: &setup.Release{
2996-
Format: "v1",
2997-
Archives: map[string]*setup.Archive{
2998-
"ubuntu": {
2999-
Name: "ubuntu",
3000-
Version: "20.04",
3001-
Suites: []string{"focal"},
3002-
Components: []string{"main"},
3003-
Priority: 1,
3004-
PubKeys: []*packet.PublicKey{testKey.PubKey},
3005-
Maintained: false,
3006-
OldRelease: true,
3007-
},
3008-
},
3009-
Packages: map[string]*setup.Package{
3010-
"mypkg": {
3011-
Name: "mypkg",
3012-
Path: "slices/mydir/mypkg.yaml",
3013-
Slices: map[string]*setup.Slice{},
3014-
},
3015-
},
3016-
Maintenance: &setup.Maintenance{
3017-
Standard: time.Date(2001, time.February, 3, 0, 0, 0, 0, time.UTC),
3018-
EndOfLife: time.Date(2010, time.November, 12, 0, 0, 0, 0, time.UTC),
3019-
},
3020-
},
30213021
}, {
30223022
summary: "Maintenance: all in standard phase",
30233023
input: map[string]string{

0 commit comments

Comments
 (0)