Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Rename to nasp_

Rename to nasp_ #268

Workflow file for this run

name: Makefile CI
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout nasp-kernel-module
with:
submodules: recursive
path: nasp-kernel-module
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
# with:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow
# limit-access-to-actor: true
- name: Install/setup prerequisites
working-directory: nasp-kernel-module
run: make setup-vm
- name: Build the kernel module
working-directory: nasp-kernel-module
run: make -j$(nproc)
- name: Run the kernel module
working-directory: nasp-kernel-module
run: |
make insmod
sudo dmesg -T
- uses: actions/checkout@v3
name: Checkout nasp
with:
submodules: recursive
repository: cisco-open/nasp
path: nasp
- name: Build CLI
working-directory: nasp
run: make build-cli
- name: Build OPA policy module
working-directory: nasp
run: make build-opa-policy-wasm
- name: Run OPA policy module
working-directory: nasp
run: |
make load-opa-policy-wasm
sudo dmesg -T
- name: Run proxy-wasm smoke test
working-directory: nasp-kernel-module
timeout-minutes: 1
run: |
sudo ../nasp-kernel-module-cli/w3k server &
go run test/file-server.go &
docker run -d --rm -p 8080:80 nginx
sleep 2
# Test downloading a bigger file
curl -v -o /tmp/opa_downloaded.o http://localhost:8000/opa.o
# Test uploading this file
curl -v -F "opa_downloaded.o.o=@/tmp/opa_downloaded.o" http://localhost:8000/upload
diff opa.o opa_downloaded.o
# Test bearssl with non-bearssl compatibility
# TODO somehow this test run locally but not on github
# python3 -m http.server 7000 &
# sleep 1
# curl -k -v -o /dev/null https://localhost:7000/opa.o
# Test sendfile with NGiNX
curl -v http://localhost:8080
sudo dmesg -T | tail -100
sudo kill -9 $(jobs -p)
sudo pkill -9 w3k
- name: Cleanup module
working-directory: nasp-kernel-module
run: make rmmod
- name: Test DKMS
working-directory: nasp-kernel-module
run: |
sudo cp -r . /usr/src/nasp-0.1.0/
sudo dkms add -m nasp -v 0.1.0
if sudo dkms build -m nasp -v 0.1.0; then
echo "DKMS build succeeded"
else
echo "DKMS build failed"
cat /var/lib/dkms/nasp/0.1.0/build/make.log
exit 1
fi
sudo dkms install -m nasp -v 0.1.0
sudo dmesg -T