add volume timestamps

This commit is contained in:
David Ashpole
2017-03-02 15:01:59 -08:00
parent c5faf1c156
commit a90c7951d4
11 changed files with 41 additions and 17 deletions

View File

@@ -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 {