• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender / 1006302423

15 Sep 2023 12:56PM UTC coverage: 78.737% (+0.3%) from 78.482%
1006302423

push

gitlab-ci

oleorhagen
feat(daemon): Add state script support

Ticket: MEN-6637
Changelog: None

Signed-off-by: Ole Petter <ole.orhagen@northern.tech>

194 of 194 new or added lines in 4 files covered. (100.0%)

5984 of 7600 relevant lines covered (78.74%)

1109.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/mender-update/cli/actions.hpp
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
#ifndef MENDER_UPDATE_ACTIONS_HPP
16
#define MENDER_UPDATE_ACTIONS_HPP
17

18
#include <common/error.hpp>
19
#include <common/expected.hpp>
20

21
#include <mender-update/context.hpp>
22

23
namespace mender {
24
namespace update {
25
namespace cli {
26

27
using namespace std;
28

29
namespace error = mender::common::error;
30
namespace expected = mender::common::expected;
31
namespace context = mender::update::context;
32

33
class Action {
34
public:
35
        virtual ~Action() {};
×
36

37
        virtual error::Error Execute(context::MenderContext &main_context) = 0;
38
};
39
using ActionPtr = shared_ptr<Action>;
40
using ExpectedActionPtr = expected::expected<ActionPtr, error::Error>;
41

42
class ShowArtifactAction : virtual public Action {
43
public:
44
        error::Error Execute(context::MenderContext &main_context) override;
45
};
46

47
class ShowProvidesAction : virtual public Action {
48
public:
49
        error::Error Execute(context::MenderContext &main_context) override;
50
};
51

52
class InstallAction : virtual public Action {
53
public:
54
        InstallAction(const string &src, bool reboot_exit_code) :
55
                src_ {src},
56
                reboot_exit_code_ {reboot_exit_code} {
57
        }
58

59
        error::Error Execute(context::MenderContext &main_context) override;
60

61
private:
62
        string src_;
63
        bool reboot_exit_code_;
64
};
65

66
class CommitAction : virtual public Action {
67
public:
68
        error::Error Execute(context::MenderContext &main_context) override;
69
};
70

71
class RollbackAction : virtual public Action {
72
public:
73
        error::Error Execute(context::MenderContext &main_context) override;
74
};
75

76
class DaemonAction : virtual public Action {
77
public:
78
        error::Error Execute(context::MenderContext &main_context) override;
79
};
80

81
} // namespace cli
82
} // namespace update
83
} // namespace mender
84

85
#endif // MENDER_UPDATE_ACTIONS_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc