Skip to content

Commit

Permalink
Fix oval tests based on new data struct
Browse files Browse the repository at this point in the history
Goval parser introduced new data types which caused failure in out
tests. This commit fixed data types in oval tests.
  • Loading branch information
Allda authored and hdonnay committed May 20, 2020
1 parent 41c9dc6 commit b284357
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions oracle/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/xml"
"os"
"testing"
"time"

"github.com/quay/goval-parser/oval"

Expand Down Expand Up @@ -74,9 +75,9 @@ var ovalDef = oval.Definition{XMLName: xml.Name{Space: "http://oval.mitre.org/XM
CveID: "CVE-2016-5416",
Href: "http://linux.oracle.com/cve/CVE-2016-5416.html"},
},
Issued: struct {
Date string "xml:\"date,attr\""
}{Date: "2016-11-09"},
Issued: oval.Date{
Date: time.Date(2016, 11, 9, 0, 0, 0, 0, time.UTC),
},
},
Criteria: oval.Criteria{XMLName: xml.Name{Space: "http://oval.mitre.org/XMLSchema/oval-definitions-5", Local: "criteria"},
Operator: "AND",
Expand Down
18 changes: 9 additions & 9 deletions rhel/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/xml"
"os"
"testing"
"time"

"github.com/quay/goval-parser/oval"

Expand Down Expand Up @@ -155,15 +156,14 @@ var ovalDef = oval.Definition{XMLName: xml.Name{Space: "http://oval.mitre.org/XM
AffectedCPEList: []string{"cpe:/o:redhat:enterprise_linux:3"},
Refs: []oval.Ref(nil),
Bugs: []oval.Bug(nil),
Issued: struct {
Date string "xml:\"date,attr\""
}{
Date: "2010-05-06"},
Updated: struct {
Date string "xml:\"date,attr\""
}{
Date: "2010-05-06"}},
Debian: oval.Debian{XMLName: xml.Name{Space: "", Local: ""}, MoreInfo: "", Date: ""},
Issued: oval.Date{
Date: time.Date(2010, 5, 6, 0, 0, 0, 0, time.UTC),
},
Updated: oval.Date{
Date: time.Date(2010, 5, 6, 0, 0, 0, 0, time.UTC),
},
},
Debian: oval.Debian{XMLName: xml.Name{Space: "", Local: ""}, MoreInfo: "", Date: oval.Date{Date: time.Time{}}},
Criteria: oval.Criteria{XMLName: xml.Name{Space: "http://oval.mitre.org/XMLSchema/oval-definitions-5", Local: "criteria"},
Operator: "AND",
Criterias: []oval.Criteria{
Expand Down

0 comments on commit b284357

Please sign in to comment.