@@ -40,6 +40,41 @@ func TestE2E_CLI(t *testing.T) {
4040 t .Logf ("run output: %s" , out )
4141 })
4242
43+ t .Run ("PS" , func (t * testing.T ) {
44+ out , err := runCLI (t , "ps" )
45+ if err != nil {
46+ t .Fatalf ("cli ps failed: %v\n output: %s" , err , out )
47+ }
48+ // TODO: ps should return lowercased model names like ls does
49+ if ! strings .Contains (strings .ToLower (out ), "smollm2" ) {
50+ t .Errorf ("expected model in ps output, got:\n %s" , out )
51+ }
52+ if ! strings .Contains (out , bc .name ) {
53+ t .Errorf ("expected backend %s in ps output, got:\n %s" , bc .name , out )
54+ }
55+ t .Logf ("ps output:\n %s" , out )
56+ })
57+
58+ t .Run ("Unload" , func (t * testing.T ) {
59+ out , err := runCLI (t , "unload" , bc .model )
60+ if err != nil {
61+ t .Fatalf ("cli unload failed: %v\n output: %s" , err , out )
62+ }
63+ })
64+
65+ t .Run ("PSAfterUnload" , func (t * testing.T ) {
66+ out , err := runCLI (t , "ps" )
67+ if err != nil {
68+ t .Fatalf ("cli ps failed: %v\n output: %s" , err , out )
69+ }
70+ if strings .Contains (out , "smollm2" ) {
71+ t .Errorf ("model still running after unload:\n %s" , out )
72+ }
73+ if strings .Contains (out , bc .name ) {
74+ t .Errorf ("backend %s still running after unload:\n %s" , bc .name , out )
75+ }
76+ })
77+
4378 t .Run ("Remove" , func (t * testing.T ) {
4479 out , err := runCLI (t , "rm" , "-f" , bc .model )
4580 if err != nil {
0 commit comments