@@ -27,6 +27,7 @@ import (
27
27
28
28
"kmesh.net/kmesh/daemon/options"
29
29
"kmesh.net/kmesh/pkg/bpf/restart"
30
+ "kmesh.net/kmesh/pkg/constants"
30
31
)
31
32
32
33
func TestRestart (t * testing.T ) {
@@ -71,6 +72,10 @@ func runTestNormal(t *testing.T) {
71
72
if err := bpfLoader .Start (); err != nil {
72
73
assert .ErrorIsf (t , err , nil , "bpfLoader start failed %v" , err )
73
74
}
75
+
76
+ versionPath := filepath .Join (config .BpfFsPath , constants .WorkloadVersionPath )
77
+ _ , err := os .Stat (versionPath )
78
+ assert .NoError (t , err )
74
79
assert .Equal (t , restart .Normal , restart .GetStartType (), "set kmesh start status failed" )
75
80
restart .SetExitType (restart .Normal )
76
81
bpfLoader .Stop ()
@@ -87,9 +92,9 @@ func runTestRestart(t *testing.T) {
87
92
assert .Equal (t , restart .Normal , restart .GetStartType (), "set kmesh start status failed" )
88
93
restart .SetExitType (restart .Restart )
89
94
if config .AdsEnabled () {
90
- versionPath = filepath .Join (config .BpfFsPath + "/bpf_kmesh/map/" )
95
+ versionPath = filepath .Join (config .BpfFsPath , constants . VersionPath )
91
96
} else if config .WdsEnabled () {
92
- versionPath = filepath .Join (config .BpfFsPath + "/bpf_kmesh_workload/map/" )
97
+ versionPath = filepath .Join (config .BpfFsPath , constants . WorkloadVersionPath )
93
98
}
94
99
_ , err := os .Stat (versionPath )
95
100
assert .NoError (t , err )
0 commit comments