Merge pull request #133 from ityuhui/yh-memory-test-0812

Add the Valgrind memory check for examples
This commit is contained in:
Kubernetes Prow Robot
2022-08-17 08:55:12 -07:00
committed by GitHub
10 changed files with 91 additions and 24 deletions

View File

@@ -15,7 +15,7 @@ jobs:
- name: Prepare
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev libcurl4-openssl-dev uncrustify
sudo apt-get install -y libssl-dev libcurl4-openssl-dev uncrustify valgrind
- name: Prepare libwebsockets
run: |
git clone https://libwebsockets.org/repo/libwebsockets --depth 1 --branch v4.2-stable
@@ -65,3 +65,9 @@ jobs:
kubectl describe node
cd examples/
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/kubernetes/build/:/usr/local/lib make test
- name: Valgrind memory check for examples
run: |
kubectl cluster-info --context kind-chart-testing
kubectl describe node
cd examples/
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/kubernetes/build/:/usr/local/lib make memcheck

View File

@@ -27,12 +27,27 @@ clean:
cd configmap; make clean
test:
cd create_pod; make test; sleep 10
cd create_pod; make test;
kubectl wait --for=condition=ready --all pod -n default --timeout=60s
cd list_pod; make test
cd delete_pod; make test
cd list_secret; make test
cd configmap; make test
cd generic; make test
cd multi_thread; make test; sleep 10
cd multi_thread; make test;
kubectl wait --for=condition=ready pod/test-pod-8 -n default --timeout=60s
kubectl describe po test-pod-8
cd exec_pod; make test
memcheck:
cd create_pod; make memcheck;
kubectl wait --for=condition=ready --all pod -n default --timeout=60s
cd list_pod; make memcheck
cd delete_pod; make memcheck
cd list_secret; make memcheck
cd configmap; make memcheck
cd generic; make memcheck
cd multi_thread; make memcheck;
kubectl wait --for=condition=ready pod/test-pod-8 -n default --timeout=60s
kubectl describe po test-pod-8
cd exec_pod; make memcheck

View File

@@ -3,9 +3,15 @@ LIBS:=-L../../kubernetes/build -lkubernetes -lyaml -lwebsockets -L/usr/local/lib
CFLAGS:=-g
BIN:=configmap_bin
.PHONY : all clean test memcheck
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./$(BIN)
test:
./$(BIN)
memcheck:
valgrind --tool=memcheck --leak-check=full ./$(BIN)
clean:
rm ./$(BIN)

View File

@@ -3,9 +3,15 @@ LIBS:=-L../../kubernetes/build -lkubernetes -lyaml -lwebsockets -L/usr/local/lib
CFLAGS:=-g
BIN:=create_pod_bin
.PHONY : all clean test memcheck
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./$(BIN)
test:
./$(BIN)
memcheck:
valgrind --tool=memcheck --leak-check=full ./$(BIN)
clean:
rm ./$(BIN)

View File

@@ -3,9 +3,15 @@ LIBS:=-L../../kubernetes/build -lkubernetes -lyaml -lwebsockets -L/usr/local/lib
CFLAGS:=-g
BIN:=delete_pod_bin
.PHONY : all clean test memcheck
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./$(BIN)
test:
./$(BIN)
memcheck:
valgrind --tool=memcheck --leak-check=full ./$(BIN)
clean:
rm ./$(BIN)

View File

@@ -3,9 +3,15 @@ LIBS:=-L../../kubernetes/build -lkubernetes -lyaml -lwebsockets -L/usr/local/lib
CFLAGS:=-g
BIN:=exec_pod_bin
.PHONY : all clean test memcheck
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./$(BIN)
test:
./$(BIN) only-run-case-1
memcheck:
valgrind --tool=memcheck --leak-check=full ./$(BIN) only-run-case-1
clean:
rm ./$(BIN)

View File

@@ -3,9 +3,15 @@ LIBS:=-L../../kubernetes/build -lkubernetes -lyaml -lwebsockets -L/usr/local/lib
CFLAGS:=-g
BIN:=generic_bin
.PHONY : all clean test memcheck
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./$(BIN)
test:
./$(BIN)
memcheck:
valgrind --tool=memcheck --leak-check=full ./$(BIN)
clean:
rm ./$(BIN)

View File

@@ -3,9 +3,15 @@ LIBS:=-L../../kubernetes/build -lyaml -lwebsockets -lkubernetes -L/usr/local/lib
CFLAGS:=-g
BIN:=list_pod_bin
.PHONY : all clean test memcheck
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./$(BIN)
test:
./$(BIN)
memcheck:
valgrind --tool=memcheck --leak-check=full ./$(BIN)
clean:
rm ./$(BIN)

View File

@@ -3,9 +3,15 @@ LIBS:=-L../../kubernetes/build -lkubernetes -lyaml -lwebsockets -L/usr/local/lib
CFLAGS:=-g
BIN:=list_secret_bin
.PHONY : all clean test memcheck
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./$(BIN)
memcheck:
valgrind --tool=memcheck --leak-check=full ./$(BIN)
test:
./$(BIN)
clean:
rm ./$(BIN)

View File

@@ -5,14 +5,18 @@ CFLAGS:=-g
BIN:= multi_thread_bin
OBJECTS:=main.o watch_pod.o create_pod.o
.PHONY : all clean test memcheck
all: $(OBJECTS)
$(CC) -o $(BIN) $(OBJECTS) $(LIBS)
$(OBJECTS): %.o: %.c
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
.PHONY : clean test
clean:
rm $(BIN) $(OBJECTS)
test:
./$(BIN)
memcheck:
valgrind --tool=memcheck --leak-check=full ./$(BIN)
clean:
rm $(BIN) $(OBJECTS)