Uploaded image for project: 'OpenShift Network Plumbing'
  1. OpenShift Network Plumbing
  2. NP-761

[multus] slice bounds out of range error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      Note: This issue is only reprodusible in unit-test so QE cannot reproduce it. hence I add 'noqe' label.

      This unit-test code brakes multus CNI.

      var _ = Describe("other function unit testing", func() {
          It("deleteDefaultGWResultRoutes with invalid config", func() {
              cniRouteConfig := []byte(`[
              { "dst": "0.0.0.0/0", "gw": "10.1.1.1" },
              { "dst": "10.1.1.0/24" },
              { "dst": "0.0.0.0/0", "gw": "10.1.1.1" }
              ]`)
      
              var routes []interface{}
              err := json.Unmarshal(cniRouteConfig, &routes)
              Expect(err).NotTo(HaveOccurred())
      
              newRoute, err := deleteDefaultGWResultRoutes(routes, "0.0.0.0/0")
              Expect(err).NotTo(HaveOccurred())
              routeJSON, err := json.Marshal(newRoute)
              Expect(err).NotTo(HaveOccurred())
              Expect(routeJSON).Should(MatchJSON(`[{"dst":"10.1.1.0/24"}]`))
          })
      })
      

            tohayash@redhat.com Tomofumi Hayashi
            tohayash@redhat.com Tomofumi Hayashi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: