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

mendersoftware / mender / 1499142629

16 Oct 2024 06:58PM UTC coverage: 76.305% (-0.06%) from 76.361%
1499142629

push

gitlab-ci

lluiscampos
fix: Invalidate cached inventory

Changelog: Invalidate cached inventory data on unauthentication event
to prevent an issue with which the client would not send inventory
data to the server after being unauthorized and authorized again.

Ticket: MEN-7617

Signed-off-by: Lluis Campos <lluis.campos@northern.tech>

0 of 4 new or added lines in 1 file covered. (0.0%)

268 existing lines in 7 files now uncovered.

7310 of 9580 relevant lines covered (76.3%)

11291.79 hits per line

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

0.0
/src/mender-update/standalone/states.hpp
1
// Copyright 2024 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_STANDALONE_STATES_HPP
16
#define MENDER_UPDATE_STANDALONE_STATES_HPP
17

18
#include <common/state_machine.hpp>
19

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

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

27
using namespace std;
28

29
namespace sm = mender::common::state_machine;
30

31
using StateType = sm::State<Context, StateEvent>;
32

33
class SaveState : virtual public StateType {
34
public:
UNCOV
35
        SaveState(const string &state) :
×
UNCOV
36
                state_ {state} {
×
UNCOV
37
        }
×
38
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override final;
39
        virtual void OnEnterSaveState(Context &ctx, sm::EventPoster<StateEvent> &poster) = 0;
40

41
private:
42
        string state_;
43
};
44

45
class JustSaveState : public SaveState {
46
public:
47
        JustSaveState(const string &state) :
48
                SaveState {state} {
49
        }
50
        void OnEnterSaveState(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
51
};
52

53
class PrepareDownloadState : virtual public StateType {
54
public:
55
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
56
};
57

58
class DownloadState : virtual public StateType {
59
public:
60
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
61
};
62

63
class ArtifactInstallState : virtual public StateType {
64
public:
65
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
66
};
67

68
class RebootAndRollbackQueryState : public SaveState {
69
public:
70
        RebootAndRollbackQueryState();
71
        void OnEnterSaveState(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
72
};
73

74
class ArtifactCommitState : virtual public StateType {
75
public:
76
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
77
};
78

79
class RollbackQueryState : virtual public StateType {
80
public:
81
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
82
};
83

84
class ArtifactRollbackState : virtual public StateType {
85
public:
86
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
87
};
88

89
class ArtifactFailureState : virtual public StateType {
90
public:
91
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
92
};
93

94
class CleanupState : virtual public StateType {
95
public:
96
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
97
};
98

99
class ScriptRunnerState : virtual public StateType {
100
public:
101
        ScriptRunnerState(
102
                executor::State state,
103
                executor::Action action,
104
                executor::OnError on_error,
105
                Result result_on_error) :
106
                state_ {state},
107
                action_ {action},
108
                on_error_ {on_error},
109
                result_on_error_ {result_on_error} {
110
        }
111

112
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
113

114
private:
115
        executor::State state_;
116
        executor::Action action_;
117
        executor::OnError on_error_;
118
        Result result_on_error_;
119
};
120

121
class ExitState : virtual public StateType {
122
public:
123
        ExitState(events::EventLoop &loop) :
124
                loop_ {loop} {
125
        }
126

127
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
128

129
private:
130
        events::EventLoop &loop_;
131
};
132

133
} // namespace standalone
134
} // namespace update
135
} // namespace mender
136

137
#endif // MENDER_UPDATE_STANDALONE_STATES_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