This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the C library to the e2e testing
Signed-off-by: phansGithub <[email protected]>
- Loading branch information
phansGithub
committed
Nov 9, 2023
1 parent
38317c2
commit 99d742b
Showing
5 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright(c) 2022 Intel Corporation. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM ubuntu:22.04 | ||
RUN apt-get update \ | ||
&& apt-get install -y iproute2 | ||
COPY ./cTest /bin | ||
COPY ./lib_udsclient.so /lib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "lib_udsclient.h" | ||
#include <stdio.h> | ||
|
||
int main() { | ||
printf("C Library: Client Version: %s \n", GetUdsClientVersion()); | ||
printf("C Library: Server Version: %s \n", GetUdsServerVersion()); | ||
printf("C Library: Xsk Map FD request: %d \n", RequestXskMapFd("enp94s0f0")); | ||
CleanUpConnection(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Build binary, .h, .a and .so files | ||
go build -o lib_udsclient.so -buildmode=c-shared ./cclient.go | ||
gcc -c cTest.c -o cTest.o | ||
cp lib_udsclient.so /lib | ||
gcc -pthread -o cTest cTest.o -L. /lib/lib_udsclient.so | ||
# Build and push image | ||
docker build -t localhost:5000/afxdp-c-test:latest . | ||
docker push localhost:5000/afxdp-c-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: afxdp-c-test | ||
annotations: | ||
k8s.v1.cni.cncf.io/networks: afxdp-e2e-test | ||
spec: | ||
containers: | ||
- name: afxdp-c | ||
image: localhost:5000/afxdp-c-test:latest | ||
securityContext: | ||
privileged: true | ||
imagePullPolicy: Always | ||
command: ["tail", "-f", "/dev/null"] | ||
resources: | ||
requests: | ||
afxdp/e2e: '1' | ||
limits: | ||
afxdp/e2e: '1' | ||
restartPolicy: Never |