-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 49c58d9.
- Loading branch information
Showing
5 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (C) 2024 Checkmk GmbH - License: GNU General Public License v2 | ||
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and | ||
# conditions defined in the file COPYING, which is part of this source code package. | ||
|
||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from tests.testlib.site import Site | ||
from tests.testlib.version import version_from_env | ||
|
||
# Apply the skipif marker to all tests in this file for non Managed or Cloud edition | ||
pytestmark = [ | ||
pytest.mark.skipif( | ||
True | ||
not in [version_from_env().is_cloud_edition(), version_from_env().is_managed_edition()], | ||
reason="otel-collector only shipped with Cloud or Managed", | ||
) | ||
] | ||
|
||
|
||
def test_otel_collector_exists(site: Site) -> None: | ||
assert Path(site.root, "bin", "otelcol").exists() | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"command", | ||
[ | ||
["otelcol", "--help"], | ||
["otelcol", "components"], | ||
], | ||
) | ||
def test_otel_collector_command_availability(site: Site, command: list[str]) -> None: | ||
# Commands executed here should return with exit code 0 | ||
site.check_output(command) | ||
|
||
|
||
def test_otel_collector_version(site: Site) -> None: | ||
cmd = [ | ||
"otelcol", | ||
"--version", | ||
] | ||
assert "0.113.0" in site.check_output(cmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters