Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: omec-project/pfcpsim
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1dee39f52159c58c8e12efb8ad81132135fe6e20
Choose a base ref
..
head repository: omec-project/pfcpsim
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bea5902b1cfa430d89450440603b5248dd6417ad
Choose a head ref
Showing with 32 additions and 25 deletions.
  1. +1 −1 Makefile
  2. +28 −24 fuzz/ie_fuzz_test.go
  3. +3 −0 internal/pfcpsim/export/export.go
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ golint:
mkdir -p $(CURDIR)/.coverage

test: .coverage
go test -race -coverprofile=.coverage/coverage-unit.txt -covermode=atomic -v ./...
go test -race -coverprofile=.coverage/coverage-unit.txt -covermode=atomic -run=^Test.*$ -v ./...

reuse-lint:
docker run --rm -v $(CURDIR):/pfcpsim -w /pfcpsim omecproject/reuse-verify:latest reuse lint
52 changes: 28 additions & 24 deletions fuzz/ie_fuzz_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2024-present Ian Chen <ychen.cs10@nycu.edu.tw>

package fuzz

import (
@@ -13,30 +16,31 @@ import (
const MaxUint = ^uint(0)
const MaxInt = int(MaxUint >> 1)

func TestBasicFunction(t *testing.T) {
sim := export.NewPfcpSimCfg("eth0", "192.168.0.5", "127.0.0.8")
err := sim.InitPFCPSim()
if err != nil {
require.NoError(t, err, "InitPFCPSim failed")
}
err = sim.Associate()
if err != nil {
require.NoError(t, err, "Associate failed")
}
defer func() {
err = sim.TerminatePFCPSim()
require.NoError(t, err)
}()
err = sim.CreateSession(2,
session.PdrNoFuzz,
session.QerNoFuzz,
session.FarNoFuzz,
session.UrrNoFuzz,
uint(0))
if err != nil {
require.NoError(t, err, "CreateSession failed")
}
}
// Example of a basic function test
// func TestBasicFunction(t *testing.T) {
// sim := export.NewPfcpSimCfg("eth0", "192.168.0.5", "127.0.0.8")
// err := sim.InitPFCPSim()
// if err != nil {
// require.NoError(t, err, "InitPFCPSim failed")
// }
// err = sim.Associate()
// if err != nil {
// require.NoError(t, err, "Associate failed")
// }
// defer func() {
// err = sim.TerminatePFCPSim()
// require.NoError(t, err)
// }()
// err = sim.CreateSession(2,
// session.PdrNoFuzz,
// session.QerNoFuzz,
// session.FarNoFuzz,
// session.UrrNoFuzz,
// uint(0))
// if err != nil {
// require.NoError(t, err, "CreateSession failed")
// }
// }

func Fuzz(f *testing.F) {
var testcases []uint
3 changes: 3 additions & 0 deletions internal/pfcpsim/export/export.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2024-present Ian Chen <ychen.cs10@nycu.edu.tw>

package export

import (