mirror of
https://github.com/taigrr/systemctl.git
synced 2025-10-05 16:26:58 +08:00
add property definitions and show test
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/taigrr/systemctl/properties"
|
||||
)
|
||||
|
||||
func TestEnableNonexistant(t *testing.T) {
|
||||
@@ -51,3 +53,17 @@ func TestEnableSuccess(t *testing.T) {
|
||||
t.Errorf("error is %v, but should have been %v", err, nil)
|
||||
}
|
||||
}
|
||||
func TestAllProperties(t *testing.T) {
|
||||
unit := "nginx"
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
opts := Options{
|
||||
usermode: true,
|
||||
}
|
||||
for _, x := range properties.Properties {
|
||||
_, err := Show(ctx, unit, x, opts)
|
||||
if err != nil {
|
||||
t.Errorf("error is %v, but should have been %v", err, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user