mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-06-15 21:45:31 +00:00
* add send notify function * add shell script * add system notiry * remove disk and test common package * update http status * add share function to common * remove temp path * remove /DATA directory initialization - moved to local-storage (#578) * update goreleaser configuration * wip * change service type to notify for systemd so its status is OK only when service is initialized successfully * update CasaOS-Common to fix runtime error * wip * add send notify function * add shell script * add system notiry * remove disk and test common package * update http status * add share function to common * remove temp path * remove /DATA directory initialization - moved to local-storage (#578) * update goreleaser configuration * wip * change service type to notify for systemd so its status is OK only when service is initialized successfully * update CasaOS-Common to fix runtime error * wip * wip * wip * wip * wip * Utilization interface to supplement disk information * fix upload file * wip * wip * add update url * wip * wip * add change log * update changelog Co-authored-by: LinkLeong <a624669980@163.com>
30 lines
629 B
Go
30 lines
629 B
Go
package common
|
|
|
|
import "testing"
|
|
|
|
func TestSendNotify(t *testing.T) {
|
|
notify, err := NewNotifyService("/var/run/casaos")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
err = notify.SendNotify("test", map[string]interface{}{
|
|
"test": "test",
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestSendSystemStatusNotify(t *testing.T) {
|
|
notify, err := NewNotifyService("/var/run/casaos")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
err = notify.SendSystemStatusNotify(map[string]interface{}{
|
|
"sys_usb": `[{"name": "sdc","size": 7747397632,"model": "DataTraveler_2.0","avail": 7714418688,"children": null}]`,
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|