mirror of
https://github.com/minio/minio.git
synced 2025-11-23 19:17:43 -05:00
make sure lifecycle rule ID is present (#10084)
This commit is contained in:
@@ -64,6 +64,7 @@ func TestInvalidRules(t *testing.T) {
|
||||
}{
|
||||
{ // Rule without expiration action
|
||||
inputXML: ` <Rule>
|
||||
<ID>rule without expiration</ID>
|
||||
<Status>Enabled</Status>
|
||||
</Rule>`,
|
||||
expectedErr: errMissingExpirationAction,
|
||||
@@ -74,14 +75,26 @@ func TestInvalidRules(t *testing.T) {
|
||||
</Rule>`,
|
||||
expectedErr: errInvalidRuleID,
|
||||
},
|
||||
{ // Rule with empty ID
|
||||
inputXML: `<Rule>
|
||||
<ID></ID>
|
||||
<Expiration>
|
||||
<Days>365</Days>
|
||||
</Expiration>
|
||||
<Status>Enabled</Status>
|
||||
</Rule>`,
|
||||
expectedErr: nil,
|
||||
},
|
||||
{ // Rule with empty status
|
||||
inputXML: ` <Rule>
|
||||
<ID>rule with empty status</ID>
|
||||
<Status></Status>
|
||||
</Rule>`,
|
||||
expectedErr: errEmptyRuleStatus,
|
||||
},
|
||||
{ // Rule with invalid status
|
||||
inputXML: ` <Rule>
|
||||
<ID>rule with invalid status</ID>
|
||||
<Status>OK</Status>
|
||||
</Rule>`,
|
||||
expectedErr: errInvalidRuleStatus,
|
||||
|
||||
Reference in New Issue
Block a user