mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
add volume timestamps
This commit is contained in:
@@ -14,20 +14,22 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package volume
|
||||
package volume_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
utiltesting "k8s.io/client-go/util/testing"
|
||||
. "k8s.io/kubernetes/pkg/volume"
|
||||
volumetest "k8s.io/kubernetes/pkg/volume/testing"
|
||||
)
|
||||
|
||||
func TestGetMetricsStatFS(t *testing.T) {
|
||||
metrics := NewMetricsStatFS("")
|
||||
actual, err := metrics.GetMetrics()
|
||||
expected := &Metrics{}
|
||||
if *actual != *expected {
|
||||
if !volumetest.MetricsEqualIgnoreTimestamp(actual, expected) {
|
||||
t.Errorf("Expected empty Metrics from uninitialized MetricsStatFS, actual %v", *actual)
|
||||
}
|
||||
if err == nil {
|
||||
@@ -36,7 +38,7 @@ func TestGetMetricsStatFS(t *testing.T) {
|
||||
|
||||
metrics = NewMetricsStatFS("/not/a/real/directory")
|
||||
actual, err = metrics.GetMetrics()
|
||||
if *actual != *expected {
|
||||
if !volumetest.MetricsEqualIgnoreTimestamp(actual, expected) {
|
||||
t.Errorf("Expected empty Metrics from incorrectly initialized MetricsStatFS, actual %v", *actual)
|
||||
}
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user