forked from lfn-cnti/testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathran_spec.cr
50 lines (44 loc) · 2.1 KB
/
ran_spec.cr
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require "../spec_helper"
require "colorize"
require "../../src/tasks/utils/utils.cr"
require "../../src/tasks/kind_setup.cr"
require "file_utils"
require "sam"
describe "5g" do
before_all do
`./cnf-testsuite setup`
$?.success?.should be_true
end
it "'oran_e2_connection' should pass if the ORAN enabled RAN connects to the RIC using the e2 standard", tags: ["oran"] do
begin
Log.info {`./cnf-testsuite cnf_setup cnf-config=sample-cnfs/sample_srsran_ueauth_open5gs/cnf-testsuite.yml`}
$?.success?.should be_true
Log.info {`./cnf-testsuite cnf_setup cnf-config=sample-cnfs/sample-oran-ric/cnf-testsuite.yml`}
$?.success?.should be_true
response_s = `./cnf-testsuite oran_e2_connection verbose`
Log.info {"response: #{response_s}"}
(/(PASSED).*(RAN connects to a RIC using the e2 standard interface)/ =~ response_s).should_not be_nil
ensure
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample-oran-ric/cnf-testsuite.yml`}
$?.success?.should be_true
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample_open5gs/cnf-testsuite.yml`}
$?.success?.should be_true
end
end
it "'oran_e2_connection' should fail if the ORAN enabled RAN does not connect to the RIC using the e2 standard", tags: ["oran"] do
begin
Log.info {`./cnf-testsuite cnf_setup cnf-config=sample-cnfs/sample_srsran_ueauth_open5gs/cnf-testsuite.yml`}
$?.success?.should be_true
Log.info {`./cnf-testsuite cnf_setup cnf-config=sample-cnfs/sample-oran-noric/cnf-testsuite.yml`}
$?.success?.should be_true
response_s = `./cnf-testsuite oran_e2_connection verbose`
Log.info {"response: #{response_s}"}
(/(FAILED).*(RAN does not connect to a RIC using the e2 standard interface)/ =~ response_s).should_not be_nil
ensure
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample_open5gs/cnf-testsuite.yml`}
$?.success?.should be_true
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample-oran-noric/cnf-testsuite.yml`}
$?.success?.should be_true
end
end
end