mirror of https://github.com/docker/docs.git
btrfs: information for the information gods
Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
parent
68a25a5b74
commit
318b11f62f
|
@ -60,7 +60,10 @@ func (d *Driver) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) Status() [][2]string {
|
func (d *Driver) Status() [][2]string {
|
||||||
return nil
|
return [][2]string{
|
||||||
|
{"Build Version", BtrfsBuildVersion()},
|
||||||
|
{"Library Version", fmt.Sprintf("%d", BtrfsLibVersion())},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) Cleanup() error {
|
func (d *Driver) Cleanup() error {
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
// +build linux
|
||||||
|
|
||||||
|
package btrfs
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include <btrfs/version.h>
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
func BtrfsBuildVersion() string {
|
||||||
|
return string(C.BTRFS_BUILD_VERSION)
|
||||||
|
}
|
||||||
|
func BtrfsLibVersion() int {
|
||||||
|
return int(C.BTRFS_LIB_VERSION)
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
// +build linux
|
||||||
|
|
||||||
|
package btrfs
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestBuildVersion(t *testing.T) {
|
||||||
|
if len(BtrfsBuildVersion()) == 0 {
|
||||||
|
t.Errorf("expected output from btrfs build version, but got empty string")
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue