Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmd time category #172

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions exec/time/time_travel.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (k *TravelTimeActionCommandSpec) LongDesc() string {
}

func (*TravelTimeActionCommandSpec) Categories() []string {
return []string{category.SystemProcess}
return []string{category.SystemTime}
}

type TravelTimeExecutor struct {
Expand Down Expand Up @@ -116,11 +116,11 @@ func (tte *TravelTimeExecutor) SetChannel(channel spec.Channel) {
}

func (tte *TravelTimeExecutor) stop(ctx context.Context) *spec.Response {
response := tte.channel.Run(ctx, "timedatectl", fmt.Sprintf(`set-ntp true`))
response := tte.channel.Run(ctx, "timedatectl", `set-ntp true`)
if !response.Success {
return response
}
return tte.channel.Run(ctx, "hwclock", fmt.Sprintf(`--hctosys`))
return tte.channel.Run(ctx, "hwclock", `--hctosys`)
}

func (tte *TravelTimeExecutor) start(ctx context.Context, timeOffsetStr string, disableNtp bool) *spec.Response {
Expand All @@ -132,7 +132,7 @@ func (tte *TravelTimeExecutor) start(ctx context.Context, timeOffsetStr string,
targetTime := time.Now().Add(duration).Format("01/02/2006 15:04:05")

if disableNtp {
response := tte.channel.Run(ctx, "timedatectl", fmt.Sprintf(`set-ntp false`))
response := tte.channel.Run(ctx, "timedatectl", `set-ntp false`)
if !response.Success {
return response
}
Expand Down