forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utility.h
28 lines (20 loc) · 769 Bytes
/
utility.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include <string>
#include "envoy/config/listener/v3/listener.pb.h"
#include "envoy/config/listener/v3/listener.pb.validate.h"
#include "source/common/protobuf/utility.h"
#include "test/test_common/environment.h"
#include "test/test_common/utility.h"
namespace Envoy {
namespace Server {
inline envoy::config::listener::v3::Listener parseListenerFromV3Yaml(const std::string& yaml) {
envoy::config::listener::v3::Listener listener;
TestUtility::loadFromYamlAndValidate(yaml, listener);
return listener;
}
inline std::string testDomainSocketName() {
return absl::StrCat(TestEnvironment::unixDomainSocketDirectory(), "/",
TestUtility::uniqueFilename("envoy_domain_socket"));
}
} // namespace Server
} // namespace Envoy