refactor: use nginx -s reload instead of systemd
- doc: add comment
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestParseUnitPropertiesRequiresExactProperties 验证属性解析严格接受恰好三个预期属性,并拒绝缺失、多余或重复属性。
|
||||
func TestParseUnitPropertiesRequiresExactProperties(t *testing.T) {
|
||||
t.Parallel()
|
||||
unit, err := parseUnitProperties("yms-green.service", []byte("LoadState=loaded\nActiveState=inactive\nSubState=dead\n"))
|
||||
@@ -26,6 +27,7 @@ func TestParseUnitPropertiesRequiresExactProperties(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestNewSystemctlRequiresAbsoluteExecutable 验证相对路径会被拒绝,绝对路径会被接受。
|
||||
func TestNewSystemctlRequiresAbsoluteExecutable(t *testing.T) {
|
||||
t.Parallel()
|
||||
if _, err := NewSystemctl("systemctl"); err == nil {
|
||||
@@ -37,6 +39,7 @@ func TestNewSystemctlRequiresAbsoluteExecutable(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestValidateUnitNamePreservesOpaqueValue 验证合法单元名被原样保留,空串或带首尾空白被拒绝。
|
||||
func TestValidateUnitNamePreservesOpaqueValue(t *testing.T) {
|
||||
t.Parallel()
|
||||
if err := validateUnitName("backend-green.service"); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user