Skip to content

Commit

Permalink
Compare all 64-bits of return values with expected (#143)
Browse files Browse the repository at this point in the history
Instead of considering only the 32 LSB when comparing the expected
return values with the actual return values, consider all 64 bits.

Fixes #142

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
  • Loading branch information
hawkinsw committed Sep 4, 2023
1 parent 10ae8ad commit db9e025
Show file tree
Hide file tree
Showing 9 changed files with 235 additions and 45 deletions.
24 changes: 24 additions & 0 deletions .github/scripts/build-libbpf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/bash
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: MIT

git clone https://github.com/libbpf/libbpf.git
if [ $? -ne 0 ]; then
echo "Could not clone the libbpf repository."
exit 1
fi

# Jump in to the src directory to do the actual build.
cd libbpf/src

make
if [ $? -ne 0 ]; then
echo "Could not build libbpf source."
exit 1
fi

# Now that the build was successful, install the library (shared
# object and header files) in a spot where FindLibBpf.cmake can
# find it when it is being built.
sudo PREFIX=/usr LIBDIR=/usr/lib/x86_64-linux-gnu/ make install
exit 0
15 changes: 10 additions & 5 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
with:
submodules: 'recursive'

- name: Install prerequisites - Ubuntu-22.04
if: inputs.platform == 'ubuntu-22.04'
- name: Install prerequisites - Ubuntu-latest
if: inputs.platform == 'ubuntu-latest'
run: |
sudo apt-get install -y libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libbpf-dev \
libelf-dev \
lcov
- name: Install prerequisites - macos-11
Expand All @@ -60,6 +60,11 @@ jobs:
ccache \
boost
- name: Build/install libbpf From Source
if: inputs.platform == 'ubuntu-latest'
run: ./.github/scripts/build-libbpf.sh
shell: bash

- name: Cache nuget packages
if: inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022'
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
Expand All @@ -75,7 +80,7 @@ jobs:
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Configure CMake
if: inputs.platform == 'ubuntu-22.04' || inputs.platform == 'macos-11'
if: inputs.platform == 'ubuntu-latest' || inputs.platform == 'macos-11'
run: |
if [ "${{inputs.enable_sanitizers}}" = "true" ]; then
export SANITIZER_FLAGS="-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
Expand Down Expand Up @@ -119,7 +124,7 @@ jobs:
${{github.workspace}}/build/upload
- name: Tests
if: inputs.platform == 'ubuntu-22.04'
if: inputs.platform == 'ubuntu-latest'
working-directory: ${{github.workspace}}
run: |
cmake --build build --target test --
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
ubuntu_release:
uses: ./.github/workflows/Build.yml
with:
platform: ubuntu-22.04
platform: ubuntu-latest
configuration: Release
enable_sanitizers: false
enable_coverage: false
Expand All @@ -69,39 +69,39 @@ jobs:
ubuntu_debug:
uses: ./.github/workflows/Build.yml
with:
platform: ubuntu-22.04
platform: ubuntu-latest
configuration: Debug
enable_sanitizers: false
enable_coverage: false

ubuntu_release_sanitizers:
uses: ./.github/workflows/Build.yml
with:
platform: ubuntu-22.04
platform: ubuntu-latest
configuration: Release
enable_sanitizers: true
enable_coverage: false

ubuntu_debug_sanitizers:
uses: ./.github/workflows/Build.yml
with:
platform: ubuntu-22.04
platform: ubuntu-latest
configuration: Debug
enable_sanitizers: true
enable_coverage: false

ubuntu_release_coverage:
uses: ./.github/workflows/Build.yml
with:
platform: ubuntu-22.04
platform: ubuntu-latest
configuration: Release
enable_sanitizers: false
enable_coverage: true

ubuntu_debug_coverage:
uses: ./.github/workflows/Build.yml
with:
platform: ubuntu-22.04
platform: ubuntu-latest
configuration: Debug
enable_sanitizers: false
enable_coverage: true
Expand All @@ -122,7 +122,7 @@ jobs:
needs:
- ubuntu_release_coverage
- ubuntu_debug_coverage
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2.2.1
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ jobs:

- name: Install prerequisites
run: |
sudo apt-get install -y libboost-dev libboost-filesystem-dev libboost-program-options-dev libbpf-dev
sudo apt-get install -y libboost-dev libboost-filesystem-dev libboost-program-options-dev libelf-dev
- name: Build/install libbpf From Source
run: ./.github/scripts/build-libbpf.sh
shell: bash

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
Expand Down
4 changes: 4 additions & 0 deletions include/bpf_conformance.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@ bpf_conformance(
options.debug = debug;
return bpf_conformance_options(test_files, plugin_path, plugin_options, options);
}

const std::string bpf_conformance_xdp_section_name = "xdp";
const std::string bpf_conformance_default_section_name = ".text";
const std::string bpf_conformance_default_function_name = "main";
Loading

0 comments on commit db9e025

Please sign in to comment.